/** * Displays an announcement at the top of the screen * * @param string $announcement - optional * @return array */ public function checkAnnouncements($h, $announcement = '') { $announcements = array(); if (SITE_OPEN == "false") { array_push($announcements, $h->lang['main_announcement_site_closed']); } // "All plugins are currently disabled." if (!$h->numActivePlugins()) { array_push($announcements, $h->lang['main_announcement_plugins_disabled']); } // if using the announcement parameter, then add to non-admin pages only: if ($announcement && !$h->isAdmin) { array_push($announcements, $announcement); } // get the announcement set in the Admin Maintenance page: require_once LIBS . 'Maintenance.php'; $maintenance = new Maintenance(); $maintenance->getSiteAnnouncement($h); if ($h->vars['admin_announcement_enabled']) { array_push($announcements, urldecode($h->vars['admin_announcement'])); } // Plugins can add announcements with this: $h->vars['hotaru_announcements'] = $announcements; $h->pluginHook('hotaru_announcements'); $announcements = $h->vars['hotaru_announcements']; if (!is_array($announcements)) { return false; } else { return $announcements; } }
/** * @return void */ public function getDump() { $xoops = Xoops::getInstance(); $maintenance = new Maintenance(); parent::__construct('', "form_dump", "dump.php", 'post', true); $dump_tray = new Xoops\Form\ElementTray(_AM_MAINTENANCE_DUMP_TABLES_OR_MODULES, ''); $select_tables1 = new Xoops\Form\Select('', "dump_tables", '', 7, true); $select_tables1->addOptionArray($maintenance->displayTables(true)); $dump_tray->addElement($select_tables1, false); $ele = new Xoops\Form\Select(' ' . _AM_MAINTENANCE_OR . ' ', 'dump_modules', '', 7, true); $module_list = XoopsLists::getModulesList(); $module_handler = $xoops->getHandlerModule(); foreach ($module_list as $file) { if (XoopsLoad::fileExists(\XoopsBaseConfig::get('root-path') . '/modules/' . $file . '/xoops_version.php')) { clearstatcache(); $file = trim($file); $module = $module_handler->create(); $module->loadInfo($file); if ($module->getInfo('tables') && $xoops->isActiveModule($file)) { $ele->addOption($module->getInfo('dirname'), $module->getInfo('name')); } unset($module); } } $dump_tray->addElement($ele); $this->addElement($dump_tray); $this->addElement(new Xoops\Form\RadioYesNo(_AM_MAINTENANCE_DUMP_DROP, 'drop', 1)); $this->addElement(new Xoops\Form\Hidden("op", "dump_save")); $this->addElement(new Xoops\Form\Button("", "dump_save", XoopsLocale::A_SUBMIT, "submit")); }
public function __construct() { parent::__construct(); $this->addDescription('Parse random pages and compare output to cache.'); $this->addOption('namespace', 'Page namespace number', true, true); $this->addOption('maxpages', 'Number of pages to try', true, true); }
public function __construct() { parent::__construct(); $this->addOption('list', 'List special page names'); $this->addOption('only', 'Only update "page"; case sensitive, ' . 'check correct case by calling this script with --list or on ' . 'includes/QueryPage.php. Ex: --only=BrokenRedirects', false, true); $this->addOption('override', 'Also update pages that have updates disabled'); }
public function __construct() { parent::__construct(); $this->mDescription = "Delete old (non-current) revisions from the database"; $this->addOption('delete', 'Actually perform the deletion'); $this->addOption('page_id', 'List of page ids to work on', false); }
function __construct() { parent::__construct(); $this->mDescription = 'Script to fix bug 20757 assuming that blob_tracking is intact'; $this->addOption('dry-run', 'Report only'); $this->addOption('start', 'old_id to start at', false, true); }
public function __construct() { parent::__construct(); $this->mDescription = "Count of the number of articles and update the site statistics table"; $this->addOption('update', 'Update the site_stats table with the new count'); $this->addOption('use-master', 'Count using the master database'); }
/** * Set script options */ public function __construct() { parent::__construct(); $this->addOption('debug', 'Show a lot of debugging stuff.'); $this->addOption('local', 'Read files from local file system (uses: /raid/images/by_id/).'); $this->mDescription = 'Calculate md5 checksums for images'; }
public function __construct() { parent::__construct(); $this->mDescription = "Show number of jobs waiting in master database"; $this->addOption('group', 'Show number of jobs per job type'); $this->addOption('list', 'Show a complete list of all jobs in a machine-readable format, instead of statistics'); }
public function __construct() { parent::__construct(); $this->mDescription = "Build file cache for content pages"; $this->addOption('agedays', 'How many days old files must be in order to delete', true, true); $this->addOption('subdir', 'Prune one $wgFileCacheDirectory subdirectory name', false, true); }
public function __construct() { parent::__construct(); $this->addOption('outfile', 'File for output. Only a single file may be specified for input.', false, true); $this->addOption('outdir', "Directory for output. If this is not specified, and neither is --outfile, then the\n" . "output files will be sent to the same directories as the input files.", false, true); $this->mDescription = "Minify a file or set of files.\n\n" . "If --outfile is not specified, then the output file names will have a .min extension\n" . "added, e.g. jquery.js -> jquery.min.js."; }
function __construct() { parent::__construct(); $this->addDescription("Remove old objects from the parser cache. " . "This only works when the parser cache is in an SQL database."); $this->addOption('expiredate', 'Delete objects expiring before this date.', false, true); $this->addOption('age', 'Delete objects created more than this many seconds ago, assuming $wgParserCacheExpireTime ' . 'has been consistent.', false, true); }
public function __construct() { parent::__construct(); $this->addDescription('Remove a page record from the database'); $this->addOption('delete', "Actually delete the page"); $this->addArg('title', 'Title to delete'); }
public function __construct() { parent::__construct(); $this->addOption('start-page', 'page_id of the page to start with'); $this->addOption('start-image', 'il_to of the image to start with'); $this->addOption('maxlag', 'Maximum replication lag', false, true); }
public function __construct() { parent::__construct(); $this->mDescription = "Review all pages in reviewable namespaces. " . "A user ID must be given to specifiy the \"reviewer\" who accepted the pages."; $this->addOption('username', 'The user name of the existing user to use as the "reviewer"', true, true); $this->setBatchSize(100); }
function __construct() { parent::__construct(); $this->addArg('path', 'The file name to format', false); $this->addOption('outfile', 'The output file name', false, true); $this->addOption('html', 'Use HTML output format. By default, wikitext is used.'); }
public function loadParamsAndArgs($self = null, $opts = null, $args = null) { parent::loadParamsAndArgs($self, $opts, $args); if (!empty($this->mOptions['wiki_id'])) { putenv("SERVER_ID={$this->mOptions['wiki_id']}"); } }
function __construct() { parent::__construct(); $gz = in_array('compress.zlib', stream_get_wrappers()) ? 'ok' : '(disabled; requires PHP zlib module)'; $bz2 = in_array('compress.bzip2', stream_get_wrappers()) ? 'ok' : '(disabled; requires PHP bzip2 module)'; $this->mDescription = <<<TEXT This script reads pages from an XML file as produced from Special:Export or dumpBackup.php, and saves them into the current wiki. Compressed XML files may be read directly: .gz {$gz} .bz2 {$bz2} .7z (if 7za executable is in PATH) Note that for very large data sets, importDump.php may be slow; there are alternate methods which can be much faster for full site restoration: <https://www.mediawiki.org/wiki/Manual:Importing_XML_dumps> TEXT; $this->stderr = fopen("php://stderr", "wt"); $this->addOption('report', 'Report position and speed after every n pages processed', false, true); $this->addOption('namespaces', 'Import only the pages from namespaces belonging to the list of ' . 'pipe-separated namespace names or namespace indexes', false, true); $this->addOption('dry-run', 'Parse dump without actually importing pages'); $this->addOption('debug', 'Output extra verbose debug information'); $this->addOption('uploads', 'Process file upload data if included (experimental)'); $this->addOption('no-updates', 'Disable link table updates. Is faster but leaves the wiki in an inconsistent state'); $this->addOption('image-base-path', 'Import files from a specified path', false, true); $this->addArg('file', 'Dump file to import [else use stdin]', false); }
public function __construct() { parent::__construct(); $this->mDescription = 'Outputs page text to stdout'; $this->addOption('show-private', 'Show the text even if it\'s not available to the public'); $this->addArg('title', 'Page title'); }
public function __construct() { parent::__construct(); global $wgCategoryCollation; $this->mDescription = <<<TEXT This script will find all rows in the categorylinks table whose collation is out-of-date (cl_collation != '$wgCategoryCollation') and repopulate cl_sortkey using the page title and cl_sortkey_prefix. If everything's collation is up-to-date, it will do nothing. TEXT; $this->addOption( 'force', 'Run on all rows, even if the collation is ' . 'supposed to be up-to-date.' ); $this->addOption( 'previous-collation', 'Set the previous value of ' . '$wgCategoryCollation here to speed up this script, especially if your ' . 'categorylinks table is large. This will only update rows with that ' . 'collation, though, so it may miss out-of-date rows with a different, ' . 'even older collation.', false, true ); $this->addOption( 'target-collation', 'Set this to the new collation type to ' . 'use instead of $wgCategoryCollation. Usually you should not use this, ' . 'you should just update $wgCategoryCollation in LocalSettings.php.', false, true ); $this->addOption( 'dry-run', 'Don\'t actually change the collations, just ' . 'compile statistics.' ); $this->addOption( 'verbose-stats', 'Show more statistics.' ); }
public function __construct() { parent::__construct(); $this->mDescription = 'Converts extension entry points to the new JSON registration format'; $this->addArg('path', 'Location to the PHP entry point you wish to convert', true); $this->addOption('skin', 'Whether to write to skin.json', false, false); }
public function __construct() { parent::__construct(); $this->mDescription = "Pick a database that has pending jobs"; $this->addOption('type', "Search by job type", false, true); $this->addOption('types', "Space separated list of job types to search for", false, true); }
public function __construct() { parent::__construct(); $this->mDescription = "Parse a given wikitext"; $this->addOption('title', 'Title name for the given wikitext (Default: \'CLIParser\')', false, true); $this->addArg('file', 'File containing wikitext (Default: stdin)', false); }
public function __construct() { parent::__construct(); $this->mDescription = "Scan the logging table and purge files that where deleted."; $this->addOption('starttime', 'Starting timestamp', false, true); $this->addOption('endtime', 'Ending timestamp', false, true); }
public function __construct() { parent::__construct(); $this->mDescription = "Script to normalize double-byte latin UTF-8 characters"; $this->addOption('q', 'quiet', false, true); $this->addOption('l', 'How long the searchindex and revision tables will be locked for', false, true); }
public function __construct() { parent::__construct(); $this->mDescription = "Deletes all archived images."; $this->addOption('delete', 'Perform the deletion'); $this->addOption('force', 'Force deletion of rows from filearchive'); }
public function __construct() { parent::__construct(); $this->mDescription = 'Sets up the SMW storage backend currently selected in LocalSettings.php.'; $this->addArg('backend', 'Execute the operation for the storage backend of the given name.', false); $this->addOption('delete', 'Delete all SMW data, uninstall the selected storage backend.'); }
public function finalSetup() { parent::finalSetup(); global $wgMainCacheType, $wgMessageCacheType, $wgParserCacheType, $wgMainWANCache; global $wgLanguageConverterCacheType, $wgUseDatabaseMessages; global $wgLocaltimezone, $wgLocalisationCacheConf; global $wgDevelopmentWarnings; // Inject test autoloader require_once __DIR__ . '/../TestsAutoLoader.php'; // wfWarn should cause tests to fail $wgDevelopmentWarnings = true; $wgMainCacheType = CACHE_NONE; $wgMainWANCache = CACHE_NONE; $wgMessageCacheType = CACHE_NONE; $wgParserCacheType = CACHE_NONE; $wgLanguageConverterCacheType = CACHE_NONE; $wgUseDatabaseMessages = false; # Set for future resets // Assume UTC for testing purposes $wgLocaltimezone = 'UTC'; $wgLocalisationCacheConf['storeClass'] = 'LCStoreNull'; // Bug 44192 Do not attempt to send a real e-mail Hooks::clear('AlternateUserMailer'); Hooks::register('AlternateUserMailer', function () { return false; }); // xdebug's default of 100 is too low for MediaWiki ini_set('xdebug.max_nesting_level', 1000); }
public function __construct() { parent::__construct(); $this->mDescription = "Fix image attribution"; $this->addOption('test', 'Test', false, false, 't'); $this->addOption('conf', 'Configuration file', true, true, 't'); }
function __construct() { parent::__construct(); $this->mDescription = "Rebuilds titlekey table entries for all pages in DB."; $this->setBatchSize(1000); $this->addOption('start', 'Page ID to start from', false, true); }