Source for file 7.php
Documentation is available at 7.php
* Description: a SOAP Calendar Server
if (!@include('SOAP'.DIRECTORY_SEPARATOR. 'Server.php')) {
die ('You must have PEAR::SOAP installed');
if (!@include 'Calendar'.DIRECTORY_SEPARATOR. 'Calendar.php') {
define ('CALENDAR_ROOT', '../../');
var $__dispatch_map = array ();
var $__typedef = array ();
function Calendar_Server ()
$this->__dispatch_map['getMonth'] =
array ('in' => array ('year' => 'int', 'month'=> 'int'),
'out' => array ('month' => '{urn:PEAR_SOAP_Calendar}Month'),
$this->__typedef['Month'] = array (
'days' => '{urn:PEAR_SOAP_Calendar}MonthDays'
$this->__typedef['MonthDays'] = array (array ('{urn:PEAR_SOAP_Calendar}Day'));
$this->__typedef['Day'] = array (
function __dispatch ($methodname)
if (isset ($this->__dispatch_map[$methodname]))
return $this->__dispatch_map[$methodname];
function getMonth ($year, $month)
require_once(CALENDAR_ROOT. 'Month'.DIRECTORY_SEPARATOR. 'Weekdays.php');
if (!$Month->isValid ()) {
$V = & $Month->getValidator ();
while ($error = $V->fetch ()) {
$errorMsg .= $error->toString (). "\n";
return new SOAP_Fault ($errorMsg, 'Client');
$monthname = date('F Y', $Month->getTimeStamp ());
while ($Day = & $Month->fetch ()) {
'isFirst' => (int) $Day->isFirst (),
'isLast' => (int) $Day->isLast (),
'isEmpty' => (int) $Day->isEmpty (),
'day' => (int) $Day->thisDay (),
return array ('monthname' => $monthname, 'days' => $days);
$server = new SOAP_Server ();
$server->_auto_translation = true;
$calendar = new Calendar_Server ();
$server->addObjectMap ($calendar, 'urn:PEAR_SOAP_Calendar');
if (strtoupper($_SERVER['REQUEST_METHOD'])== 'POST') {
$server->service ($GLOBALS['HTTP_RAW_POST_DATA']);
require_once 'SOAP'.DIRECTORY_SEPARATOR. 'Disco.php';
$disco = new SOAP_DISCO_Server ($server, "PEAR_SOAP_Calendar");
if (isset ($_SERVER['QUERY_STRING']) &&
strcasecmp($_SERVER['QUERY_STRING'], 'wsdl')==0 ) {
header("Content-type: text/xml");
echo 'This is a PEAR::SOAP Calendar Server. For client try <a href="8.php">here</a><br />';
echo 'For WSDL try <a href="?wsdl">here</a>';
Documentation generated on Mon, 11 Mar 2019 15:37:47 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.
|