Example #1
0
    return $content;
}
$myBot = new BasicBot();
if (isset($_POST['server'])) {
    $serveur = $_POST['server'];
} else {
    if (isset($_GET['server'])) {
        $serveur = $_GET['server'];
    } else {
        $serveur = $_SESSION['server'];
    }
}
$myBot->wikiServer = $serveur;
//echo "Connecting to $serveur.\n";
//echo "Phase 1\n";
$args = array();
// Property array: key=property page and value=type
$propArray = array("Property:changeSetID" => "String", "Property:hasSemanticQuery" => "String", "Property:patchID" => "String", "Property:pushFeedServer" => "URL", "Property:pushFeedName" => "String");
//"Property:hasOperation"=>"String", "String", "String", "String"!!!!!
foreach ($propArray as $source => $type) {
    $args['type'] = $type;
    $result = $myBot->wikiFilter($source, 'addType', '', $args);
}
//echo "Phase 2\n";
//hasOperation is a many-valued property
$source = "Property:hasOperation";
//$args['type'] = "String;String;String;Text";
$args['type'] = "Record]]\n[[has fields::String;String;String;Text";
$result = $myBot->wikiFilter($source, 'addType', '', $args);
echo "Property types are updated!";
echo '<a href="' . $serveur . '/index.php/Special:DSMWAdmin">back</a>';