3 if (count($argv) != 2) {
4 echo "usage: $argv[0] pagename\n";
8 $wsdl = getenv('PHPWIKI_WSDL_URL');
10 $wsdl = "http://phpwiki.fr/PhpWiki.wsdl";
14 $client = new SoapClient($wsdl);
15 } catch (SoapFault $fault) {
16 die($fault->faultstring);
19 $phpwiki = getenv("HOME")."/.phpwiki";
20 if (!file_exists($phpwiki)) {
21 $login = readline("Login: ");
22 $password = readline("Password: ");
23 $credentials = base64_encode($login.':'.$password);
24 if ($fp = fopen($phpwiki, 'w')) {
25 fprintf($fp, "%s:%s", $login, $password);
27 chmod($phpwiki, 0600);
30 $credentials = base64_encode(file_get_contents($phpwiki));
34 $links = $client->listLinks($argv[1], $credentials);
35 foreach ($links as $link) {
36 echo $link['pagename']."\n";
38 } catch (SoapFault $e) {
39 echo 'Error: ' . $e->getMessage() . "\n";