本文整理汇总了PHP中WikiFactory::getSecondaryClusters方法的典型用法代码示例。如果您正苦于以下问题:PHP WikiFactory::getSecondaryClusters方法的具体用法?PHP WikiFactory::getSecondaryClusters怎么用?PHP WikiFactory::getSecondaryClusters使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类WikiFactory
的用法示例。
在下文中一共展示了WikiFactory::getSecondaryClusters方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: removeFromSecondaryClusters
/**
* Removes user info from secondary clusters so that it can be regenerated from scratch
*
* @author mix
* @author tor
*/
public static function removeFromSecondaryClusters($id)
{
global $wgMemc;
wfProfileIn(__METHOD__);
$clusters = WikiFactory::getSecondaryClusters();
// wikicities with a c1 .. cx cluster suffix.
foreach ($clusters as $clusterName) {
// This is a classic double-check. I do not want to delete the record from the primary cluster.
// No, really! I do not.
if (RenameUserHelper::CLUSTER_DEFAULT != $clusterName) {
$memkey = sprintf("extuser:%d:%s", $id, $clusterName);
$clusterName = 'wikicities_' . $clusterName;
$oDB = wfGetDB(DB_MASTER, array(), $clusterName);
$oDB->delete('`user`', array('user_id' => $id), __METHOD__);
$oDB->commit(__METHOD__);
$wgMemc->delete($memkey);
}
}
wfProfileOut(__METHOD__);
}