/** * Reload Phalanx II service to keep service in sync with blocks added from old Phalanx * * @param int|null $id block ID to be reloaded (or null to reload all blocks) * @return bool true if the request was successful */ private static function reload($id = null) { wfProfileIn(__METHOD__); $service = new PhalanxService(); $res = $service->reload(!is_null($id) ? [$id] : []) === 1; if ($res === false) { Wikia::log(__METHOD__, false, 'reload failed', true); } wfProfileOut(__METHOD__); return $res; }
/** * Delete Phalanx block * * @param $id Int - block ID * @return boolean true or false if error * * @author moli */ public static function onDeletePhalanxBlock($id) { wfProfileIn(__METHOD__); $phalanx = Phalanx::newFromId($id); $id = $phalanx->delete(); if ($id) { $service = new PhalanxService(); $ids = array($id); $ret = $service->reload($ids); } else { $ret = false; } wfProfileOut(__METHOD__); return $ret; }