// Use error handler in functions.php set_error_handler("ErrorHandler"); // Set Vanilla to appear first in the list. $supported = array('vanilla1' => array('name' => 'Vanilla 1', 'prefix' => 'LUM_'), 'vanilla2' => array('name' => 'Vanilla 2', 'prefix' => 'GDN_')); // Include individual software porters. // MAKESKIPSTART $paths = glob(dirname(__FILE__) . '/packages/*.php'); foreach ($paths as $path) { if (is_readable($path)) { include_once $path; } } // MAKESKIPEND // If running from cli, execute its command. if (defined('CONSOLE')) { parseCommandLine(); } // Instantiate the appropriate controller or display the input page. $method = 'DoExport'; if (isset($_REQUEST['features'])) { // Feature list or table. $set = isset($_REQUEST['cloud']) ? array('core', 'addons', 'cloud') : false; $set = vanillaFeatures($set); if (isset($_REQUEST['type'])) { viewFeatureList($_REQUEST['type'], $set); } else { viewFeatureTable($set); } } elseif (isset($_POST['type'])) { if (array_key_exists($_POST['type'], $supported)) { // Mini-Factory for conducting exports.
function _setCaseResults($myrow, $xrefCount, &$data) { if (stristr($myrow['caseName'], 'setup') || stristr($myrow['caseName'], 'cleanup')) { return; } $gotCaseName = isset($myrow['caseName']); $runID = $myrow['runID']; $scriptID = $myrow['scriptID']; $caseID = $myrow['caseID']; $caseResultID = $myrow['caseResultID']; $scriptResultsID = $myrow['scriptResultID']; if ($gotCaseName) { $data[runID][$runID][scripts][resultID][$scriptResultsID][$caseID][status] = $myrow['caseStatus']; $data[runID][$runID][scripts][resultID][$scriptResultsID][$caseID][name] = $myrow['caseName']; $data[scriptID][$scriptID][caseID][$caseID][runID][$runID][status] = $myrow['caseStatus']; $data[scriptID][$scriptID][caseID][$caseID][name] = $myrow['caseName']; $data[scriptID][$scriptID][caseID][$caseID][runID][$runID][runID] = $runID; $data[scriptID][$scriptID][caseID][$caseID][runID][$runID][caseResultsID] = $caseResultID; $data[scriptID][$scriptID][caseID][$caseID][commandLine] = parseCommandLine($myrow['scriptCommandLine']); } if (!isset($data[runID][$runID][scripts][resultID][$scriptResultsID])) { # first time encountering this scriptID $data[runID][$runID][scripts][resultID][$scriptResultsID][casesPassed] = 0; $data[runID][$runID][scripts][resultID][$scriptResultsID][casesFailed] = 0; $data[runID][$runID][scripts][resultID][$scriptResultsID][casesSkipped] = 0; $data[runID][$runID][scripts][resultID][$scriptResultsID][casesAborted] = 0; $data[runID][$runID][scripts][resultID][$scriptResultsID][casesRunning] = 0; $data[runID][$runID][scriptCount]++; $data[runID][$runID][caseCount]++; $data[runID][$runID][scripts][resultID][$scriptResultsID][caseCount] = 1; $data[runID][$runID][scripts][scriptID][] = $scriptID; $data[runID][$runID][cases][id][$scriptID][] = $caseID; $data[runID][$runID][cases][$caseID][xref] = $xrefCount; if ($myrow['scriptStatus'] == 'RUNNING') { $data[runID][$runID][scripts][total]++; } if ($myrow['scriptStatus'] == 'PASSED') { $data[runID][$runID][scripts][passed]++; } if ($myrow['caseStatus'] == 'PASSED') { $data[runID][$runID][scripts][resultID][$scriptResultsID][casesPassed]++; } elseif ($myrow['caseStatus'] == 'FAILED') { $data[runID][$runID][scripts][resultID][$scriptResultsID][casesFailed]++; } elseif ($myrow['caseStatus'] == 'SKIPPED') { $data[runID][$runID][scripts][resultID][$scriptResultsID][casesSkipped]++; } elseif ($myrow['caseStatus'] == 'ABORTED') { $data[runID][$runID][scripts][resultID][$scriptResultsID][casesAborted]++; } elseif ($myrow['caseStatus'] == 'RUNNING') { $data[runID][$runID][scripts][resultID][$scriptResultsID][casesRunning]++; } } else { # so this is just another case in a script that we've already seen $data[runID][$runID][caseCount]++; $data[runID][$runID][cases][id][$scriptID][] = $caseID; $data[runID][$runID][scripts][resultID][$scriptResultsID][caseCount]++; $data[runID][$runID][cases][$caseID][xref] = $xrefCount; if ($myrow['caseStatus'] == 'PASSED') { $data[runID][$runID][scripts][resultID][$scriptResultsID][casesPassed]++; } elseif ($myrow['caseStatus'] == 'FAILED') { $data[runID][$runID][scripts][resultID][$scriptResultsID][casesFailed]++; } elseif ($myrow['caseStatus'] == 'SKIPPED') { $data[runID][$runID][scripts][resultID][$scriptResultsID][casesSkipped]++; } elseif ($myrow['caseStatus'] == 'ABORTED') { $data[runID][$runID][scripts][resultID][$scriptResultsID][casesAborted]++; } elseif ($myrow['caseStatus'] == 'RUNNING') { $data[runID][$runID][scripts][resultID][$scriptResultsID][casesRunning]++; } } }
case 'd': $wsexportConfig['debug'] = true; error_reporting(E_STRICT | E_ALL); break; case 'nocredits': $options['credits'] = false; break; } } if (!$lang or !$title) { throw new WSExportInvalidArgumentException(); } return ['title' => $title, 'lang' => $lang, 'format' => $format, 'path' => $path, 'options' => $options]; } if (isset($argc)) { try { $arguments = parseCommandLine(); $creator = BookCreator::forLanguage($arguments['lang'], $arguments['format'], $arguments['options']); list($book, $file) = $creator->create($arguments['title'], $arguments['path']); echo "The ebook has been created: {$file}\n"; } catch (WSExportInvalidArgumentException $exception) { if (!empty($exception->getMessage())) { fwrite(STDERR, $exception->getMessage() . "\n\n"); } fwrite(STDERR, file_get_contents($basePath . '/cli/help/book.txt')); exit(1); } catch (Exception $exception) { fwrite(STDERR, "Error: {$exception}\n"); exit(1); } }
} else { $inputFilePath = realPath($arg); } } } } } } } } } } } } } return array($inputFilePath, $outputFileName); } $options = new OA_CompilerOptions(); // Set the default grammar file location: We default to assuming that the parser grammar is right next to the // entry-point script (as it is in the package). $grammarFilePath = realpath(dirname($argv[0]) . '/grammar.xml'); if (false !== $grammarFilePath) { $options->parserGrammarFilePath = $grammarFilePath; } list($inputFilePath, $outputFileName) = parseCommandLine($options, $argc, $argv); if (null !== $inputFilePath) { $compiler = new OA_PhpCompiler($options); $compiler->compile($inputFilePath, $outputFileName); } else { echo "Usage: p2pc.php [-I include/path]* [-g ignored_file]* [-o output_file] [--preprocess] [--strip] [--parser <grammar.xml>] [--symbolTable <symbol_table_output>] [--testLexer] input_file\n"; }
global $beginTime, $wgCommandLineMode, $wgUser, $numberOfBytes, $wdDefaultViewDataSet; function getUserId( $real_name ) { $dbr = wfGetDB( DB_SLAVE ); $queryResult = $dbr->query( "SELECT user_id FROM user where user_real_name = '$real_name'" ); if ( $row = $dbr->fetchObject( $queryResult ) ) { return( $row->user_id ); } else { return( - 1 ); } } $options = parseCommandLine( array( new CommandLineOption( "dataset", true ) ) ); $datasetName = $options["dataset"]; $beginTime = time(); $wgCommandLineMode = true; $wdDefaultViewDataSet = $datasetName; global $dataSet; $dataSet = new WikiDataSet( wdGetDataSetContext() ); // $arg = reset( $argv ); // if ( $arg !== false ){ // $wdDefaultViewDataSet = next( $argv ); // }
echo "Dropping indices from table " . $table->getIdentifier() . ".\n"; dropAllIndicesFromTable( $table->getIdentifier() ); echo "Creating new indices for table " . $table->getIdentifier() . ".\n"; addIndexesForTable( $table, $purpose ); } global $beginTime, $wgCommandLineMode; $beginTime = time(); $wgCommandLineMode = true; $options = parseCommandLine( array( new CommandLineOption( "purpose", true, array( "WebSite", "MassUpdate" ) ), new CommandLineOption( "dataset", false ), new CommandLineOption( "table", false ) ) ); $purpose = $options["purpose"]; if ( isset( $options["dataset"] ) ) $prefixes = array( $options["dataset"] ); else $prefixes = retrieve_datasets(); foreach ( $prefixes as $prefix ) { $dataSet = new WikiDataSet( $prefix ); if ( isset( $options["table"] ) ) $tables = array( $dataSet->getTableWithIdentifier( $options["table"] ) );