本文整理匯總了PHP中WikiFactory::DBToId方法的典型用法代碼示例。如果您正苦於以下問題:PHP WikiFactory::DBToId方法的具體用法?PHP WikiFactory::DBToId怎麽用?PHP WikiFactory::DBToId使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類WikiFactory
的用法示例。
在下文中一共展示了WikiFactory::DBToId方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: wfIsDBLightMode
function wfIsDBLightMode()
{
global $wgExternalSharedDB;
$dbLightMode = WikiFactory::getVarValueByName('wgDBLightMode', WikiFactory::DBToId($wgExternalSharedDB));
return (bool) $dbLightMode;
}
示例2: wfGetDB
if ($count % 1000 == 0) {
echo "Processed " . (1000 + $count - $skip) . " wikis\n";
}
$count++;
$database = $row->Database;
// don't talk to the wikicities cluster or internal mysql tables
if (strstr($database, 'wikicities_') !== false) {
continue;
}
if (array_search($database, ['information_schema', 'mysql', 'tmp', 'logs', 'data']) !== false) {
continue;
}
try {
$wiki_db = wfGetDB(DB_SLAVE, [], $row->Database);
if (!$wiki_db->tableExists($table)) {
$wiki_id = WikiFactory::DBToId($row->Database);
if ($wiki_id != 0) {
$missing[$wiki_id] = $row->Database;
}
}
$wiki_db->close();
} catch (Exception $e) {
print_r($e);
continue;
}
}
print "Found " . count($missing) . " databases missing {$table}\n";
if ($details) {
print_r($missing);
}
if ($updates) {
示例3: newFromName
/**
* newFromName
*
* @access public
*
* @param String $dbname
*/
public function newFromName($dbname)
{
return new WikiStats(WikiFactory::DBToId($dbname));
}