#!/usr/bin/php faultstring); } $phpwiki = getenv("HOME")."/.phpwiki"; if (!file_exists($phpwiki)) { $login = readline("Login: "); $password = readline("Password: "); $credentials = base64_encode($login.':'.$password); if ($fp = fopen($phpwiki, 'w')) { fprintf($fp, "%s:%s", $login, $password); fclose($fp); chmod($phpwiki, 0600); } } else { $credentials = base64_encode(file_get_contents($phpwiki)); } try { $old_content = $client->getPageContent($argv[1], $credentials); $new_content = str_replace($argv[2], $argv[3], $old_content); if ($new_content != $old_content) { echo $client->doSavePage($argv[1], $new_content, $credentials); echo "\n"; } } catch (SoapFault $e) { echo 'Error: ' . $e->getMessage() . "\n"; }