<?php

/**
 * @file
 * @ingroup DAPCPExample
 *
 * @author Dian
 */
require_once '.../extensions/DataAPI/PageCRUD_Plus/PCP.php';
// create the target system object
$smwSystem = new PCPWikiSystem("http://localhost/smw");
// create the user credentials object
$uc = new PCPUserCredentials("user", "pass");
// create the PCP client object
$updateTest = new PCPClient($uc, $smwSystem);
if ($updateTest->login()) {
    echo $updateTest->updatePage($uc, "Testpage", "Updating some content");
    $updateTest->logout();
} else {
    print "ERROR: Testing failed!";
}
Пример #2
0
<?php

/**
 * @file
 * @ingroup DAPCPTest
 * 
 * @author Dian
 */
chdir('F:\\xampp\\htdocs\\mw');
require_once 'F:/xampp/htdocs/mw/includes/Webstart.php';
$uc = new PCPUserCredentials("WikiSysop", "!>ontoprise?");
$ws = new PCPWikiSystem("http://localhost/mw");
$loginTest = new PCPClient($uc, $ws);
$loginTest->cookieFile = getcwd() . "/cookiejar.txt";
if ($loginTest->login($uc)) {
    var_dump($loginTest->readPage(NULL, "Main Page"));
}