當前位置: 首頁>>代碼示例>>PHP>>正文


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怎麽用?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);
 }
開發者ID:williammoran,項目名稱:DBSteward,代碼行數:33,代碼來源:ofs_replica_set_router.php


注:本文中的format::get_context_replica_set_id方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。