本文整理汇总了PHP中format::get_context_replica_set_id方法的典型用法代码示例。如果您正苦于以下问题:PHP format::get_context_replica_set_id方法的具体用法?PHP format::get_context_replica_set_id怎么用?PHP format::get_context_replica_set_id使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类format
的用法示例。
在下文中一共展示了format::get_context_replica_set_id方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __call
public function __call($m, $a)
{
$ignore_ofs_methods = array('__destruct');
if (in_array($m, $ignore_ofs_methods)) {
return 'IGNORE_OFS_COMMAND_COMPLETE';
}
// if the command is in the list of commands to run on all ofs objects, do so
$all_ofs_methods = array('append_header', 'append_footer');
if (in_array($m, $all_ofs_methods)) {
foreach ($this->ofs as $set_id => $ofs) {
call_user_func_array(array(&$ofs, $m), $a);
}
return 'ALL_OFS_COMMAND_COMPLETE';
}
$use_replica_set_id = format::get_context_replica_set_id();
if ($use_replica_set_id == -10) {
// context_replica_set_id -10 means object does not have slonySetId defined
// use the natural first replica set as the replica context
$first_replica_set = pgsql8::get_slony_replica_set_natural_first(dbsteward::$new_database);
$use_replica_set_id = (int) $first_replica_set['id'];
}
// make sure replica set id to use is known
if (!isset($this->ofs[$use_replica_set_id])) {
if ($this->skip_unknown_set_ids) {
dbsteward::notice("[OFS RSR] context replica set ID is " . $use_replica_set_id . ", but no replica set by that ID, skipping output");
return FALSE;
}
throw new exception("context replica set ID " . $use_replica_set_id . " not defined");
}
$active_set_ofs = $this->ofs[$use_replica_set_id];
dbsteward::debug("[OFS RSR] __call calling " . $use_replica_set_id . " ofs::" . $m);
return call_user_func_array(array(&$active_set_ofs, $m), $a);
}