function readPage($username = NULL, $password = NULL, $id = NULL, $loginToken = NULL, $editToken = NULL, $title = NULL, $revisionID = NULL) { $__pcpServer = new PCPServer(); $__userCredentials = new PCPUserCredentials($username, $password, $id, $loginToken, $editToken); $_REQUEST = array(); $__pcpServer->login($__userCredentials); // var_dump($__userCredentials,$title, $revisionID); // die; return simplexml_load_string(PCPUtil::createXMLResponse($__pcpServer->readPage($__userCredentials, $title, $revisionID)->toXML()), 'SimpleXMLElement', LIBXML_NOCDATA); }
<?php /** * @file * @ingroup DAPCPExample * * @author Dian */ // the path to your wiki installation home chdir('/xampp/htdocs/wiki'); require_once '/xampp/htdocs/wiki/includes/Webstart.php'; $readTest = new PCPServer(); $uc = new PCPUserCredentials("TestUser", "TestPassword"); if ($readTest->login($uc)) { echo $readTest->readPage($uc, "Main Page"); $readTest->logout(); } else { print "ERROR: Testing failed!"; }
protected function getSimpleTexts($username = NULL, $password = NULL, $id = NULL, $loginToken = NULL, $editToken = NULL, $title = NULL, $revisionID = NULL) { $__pcpServer = new PCPServer(); $__userCredentials = new PCPUserCredentials($username, $password, $id, $loginToken, $editToken); $__pcpServer->login($__userCredentials); $__pom = new POMPage($title, $__pcpServer->readPage($__userCredentials, $title, $revisionID)->text); $__result = array(); $__elementsIterator = $__pom->getSimpleTexts()->listIterator(); while ($__elementsIterator->hasNext()) { $__element =& $__elementsIterator->getNextNodeValueByReference(); $__array = $this->toArray($__element); $__result[get_class($__element)][$__element->id] = $__array; } return $__result; }
private function serializedForm($title) { $__pageReader = new PCPServer(); $__page = $__pageReader->readPage(NULL, "Form:" . $title); return $this->formSerialize($__page->text, false, $__page->text, $title); }
protected function readPages($username = NULL, $password = NULL, $id = NULL, $loginToken = NULL, $title = NULL, $revisionID = NULL) { $__pcpServer = new PCPServer(); $__userCredentials = new PCPUserCredentials($username, $password, $id, $loginToken); $__titles = split("|", $title); $__resultSet = array(); $__result = array(); foreach ($__titles as $__title) { $__resultSet[str_replace(" ", "_", $__title)] = $__pcpServer->readPage($__userCredentials, $__title, $revisionID[$__title])->toHashmap(); } $__result['readPage'] = $__resultSet; return $__result; }