// Sanatize the input $t_input = $plugin->clean_input($testpage); print_n('Revision:'); print_c($plugin->commit_revision($t_input)); print_n(); print_n('Author/commiter info:'); print_c($plugin->commit_author($t_input)); print_n(); print_n('Parent commits:'); print_c($plugin->commit_parents($t_input)); print_n(); print_n('Commit message:'); print_c($plugin->commit_message($t_input)); print_n(); print_n('Committed files:'); print_c($plugin->commit_files($t_input)); /** * Print the data and a newline. * * @param mixed $data */ function print_c($data) { print_r($data); echo "\n"; } /** * Print the text and a newline. * * @param string $text */
} # Attempt to connect to the database as a privileged user # This will vomit up an error if there are permissions problems $wgDatabase = $dbc->newFromParams($wgDBserver, $wgDBadminuser, $wgDBadminpassword, $wgDBname, 1); if (!$wgDatabase->isOpen()) { # Appears to have failed echo "A connection to the database could not be established. Check the\n"; # Let's be a bit clever and guess at what's wrong if (isset($wgDBadminuser) && isset($wgDBadminpassword)) { # Tell the user the value(s) are wrong echo 'values of $wgDBadminuser and $wgDBadminpassword.' . "\n"; } exit; } print "Going to run database updates for {$wgDBname}\n"; print "Depending on the size of your database this may take a while!\n"; if (!isset($options['quick'])) { print "Abort with control-c in the next five seconds... "; for ($i = 6; $i >= 1;) { print_c($i, --$i); sleep(1); } echo "\n"; } if (isset($options['doshared'])) { $doShared = true; } else { $doShared = false; } do_all_updates($doShared); print "Done.\n";
} switch (strtolower($output)) { case 'rest': print $data; break; case 'xml': header("content-type: text/xml"); print $data; break; default: $program_end = microtime(); header('Content-type: application/json'); if ($_REQUEST['debug'] == 1) { print_c(@json_encode(array('success' => true, 'duration' => microtime_diff($program_start, $program_end), 'cache' => $cache, 'data' => $data, 'debug' => $debug))); } else { print_c(@json_encode(array('success' => true, 'duration' => microtime_diff($program_start, $program_end), 'cache' => $cache, 'data' => $data))); } break; } /** * Function print_c (Print Callback) * This is a wrapper function for print that will place the callback around the output statement **/ function print_c($str) { if (isset($_REQUEST['callback'])) { $cb = $_REQUEST['callback'] . '(' . $str . ')'; } else { $cb = $str; } print $cb;