Exemple #1
0
<?php

/**
 * @file
 * @ingroup DAPCPTest
 * 
 * @author Dian
 */
chdir('C:\\xampp\\htdocs\\mw');
require_once 'C:/xampp/htdocs/mw/includes/Webstart.php';
$editTest = new PCPServer();
$uc = $editTest->login(new PCPUserCredentials("WikiSysop", "!>ontoprise?"));
#var_dump($editTest->getCookies());
#$editTest->getEditToken("Main Page");
$uc->id = NULL;
$uc->un = NULL;
$editTest->updatePage($uc, "Testpage", "Works again.", "Page updated.");
$editTest->logout();
//}else{
//	print ("ERROR: Testing failed!".__FILE__);
//}
<?php

/**
 * @file
 * @ingroup DAPCPExample
 * 
 * @author Dian
 */
/**
 * This group contains all parts of the DataAPI that provide examples for the PCP component
 * @defgroup DAPCPExample
 * @ingroup DAPCP
 */
// the path to your wiki installation home
chdir('/xampp/htdocs/wiki');
require_once '/xampp/htdocs/wiki/includes/Webstart.php';
$createTest = new PCPServer();
$uc = new PCPUserCredentials("TestUser", "TestPassword");
if ($createTest->login($uc)) {
    echo $createTest->createPage($uc, "A test page", "Adding some content");
    $createTest->logout();
} else {
    print "ERROR: Testing failed!";
}
<?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!";
}
Exemple #4
0
/**
 * Enter description here...
 *
 * @param unknown_type $username
 * @param unknown_type $password
 * @param unknown_type $id
 * @param unknown_type $loginToken
 * @param unknown_type $editToken
 */
function logout($username = NULL, $password = NULL, $id = NULL, $loginToken = NULL, $editToken = NULL)
{
    $__pcpServer = new PCPServer();
    $__userCredentils = new PCPUserCredentials($username, $password, $id, $loginToken, $editToken);
    $__pcpServer->logout($__userCredentils);
}