コード例 #1
0
ファイル: eval.php プロジェクト: puring0815/OpenKore
$optionsWithArgs = array('d');
/** */
require_once "commandLine.inc";
if (isset($options['d'])) {
    $d = $options['d'];
    if ($d > 0) {
        $wgDebugLogFile = '/dev/stdout';
    }
    if ($d > 1) {
        foreach ($wgLoadBalancer->mServers as $i => $server) {
            $wgLoadBalancer->mServers[$i]['flags'] |= DBO_DEBUG;
        }
    }
    if ($d > 2) {
        $wgDebugFunctionEntry = true;
    }
}
while (($line = readconsole('> ')) !== false) {
    $val = eval($line . ";");
    if (is_null($val)) {
        echo "\n";
    } elseif (is_string($val) || is_numeric($val)) {
        echo "{$val}\n";
    } else {
        var_dump($val);
    }
    if (function_exists("readline_add_history")) {
        readline_add_history($line);
    }
}
print "\n";
コード例 #2
0
        case 'help':
            print "help: help about a command\n";
            if ($onlyone) {
                break;
            }
        default:
            if ($onlyone) {
                print "{$command}: command does not exist or no help for it\n";
            }
    }
}
do {
    $bad = false;
    $showhelp = false;
    $quit = false;
    $line = readconsole('> ');
    if ($line === false) {
        exit;
    }
    $args = explode(' ', $line);
    $command = array_shift($args);
    // process command
    switch ($command) {
        case 'help':
            // show an help message
            mccShowHelp(array_shift($args));
            break;
        case 'get':
            print "Getting {$args[0]}[{$args[1]}]\n";
            $res = $mcc->get($args[0]);
            if (array_key_exists(1, $args)) {
コード例 #3
0
 * memcached diagnostic tool
 *
 * @todo document
 * @package MediaWiki
 * @subpackage Maintenance
 */
/** */
require_once "commandLine.inc";
require_once "memcached-client.php";
$mcc = new memcached(array('persistant' => true, 'debug' => true));
$mcc->set_servers($wgMemCachedServers);
$mcc->set_debug(true);
do {
    $bad = false;
    $quit = false;
    $line = readconsole("> ");
    if ($line === false) {
        exit;
    }
    $args = explode(" ", $line);
    $command = array_shift($args);
    switch ($command) {
        case "get":
            print "Getting {$args[0]}[{$args[1]}]\n";
            $res = $mcc->get($args[0]);
            if (array_key_exists(1, $args)) {
                $res = $res[$args[1]];
            }
            if ($res === false) {
                #print 'Error: ' . $mcc->error_string() . "\n";
                print "MemCached error\n";
コード例 #4
0
    {
        if (!isset($this->hash[$dbkey])) {
            $this->hash[$dbkey] = Title::newFromDBkey($dbkey);
        }
        return $this->hash[$dbkey];
    }
}
#
print "You should have already run the installer to create a fresh, blank database.\n";
print "Data will be inserted into '{$wgDBname}'. THIS SHOULD BE EMPTY AND ANY DATA IN IN WILL BE ERASED!\n";
print "\nIf that's not what you want, ABORT NOW!\n\n";
print "Please enter the name of the old 'phase 2'-format database that will be used as a source:\n";
print "Old database name [enciclopedia]: ";
$olddb = readconsole();
if (empty($olddb)) {
    $olddb = "enciclopedia";
}
if ($olddb == $wgDBname) {
    die("Can't upgrade in-place! You must create a new database and copy data into it.\n");
}
print "\nSource database: '{$olddb}'\n";
print "  Dest database: '{$wgDBname}'\n";
print "Is this correct? Anything in '{$wgDBname}' WILL BE DESTROYED. [y/N] ";
$response = readconsole();
if (strtolower($response[0]) != 'y') {
    die("\nAborted by user.\n");
}
print "Starting import....\n";
$wgTitle = Title::newFromText("Conversion script");
$importer = new Phase2Importer($olddb);
$importer->importAll();