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


PHP CF_Authentication::setDebug方法代碼示例

本文整理匯總了PHP中CF_Authentication::setDebug方法的典型用法代碼示例。如果您正苦於以下問題:PHP CF_Authentication::setDebug方法的具體用法?PHP CF_Authentication::setDebug怎麽用?PHP CF_Authentication::setDebug使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在CF_Authentication的用法示例。


在下文中一共展示了CF_Authentication::setDebug方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: __construct

 /**
  * @see FileBackendStore::__construct()
  * Additional $config params include:
  *    swiftAuthUrl       : Swift authentication server URL
  *    swiftUser          : Swift user used by MediaWiki (account:username)
  *    swiftKey           : Swift authentication key for the above user
  *    swiftAuthTTL       : Swift authentication TTL (seconds)
  *    swiftAnonUser      : Swift user used for end-user requests (account:username)
  *    shardViaHashLevels : Map of container names to sharding config with:
  *                         'base'   : base of hash characters, 16 or 36
  *                         'levels' : the number of hash levels (and digits)
  *                         'repeat' : hash subdirectories are prefixed with all the
  *                                    parent hash directory names (e.g. "a/ab/abc")
  *	  swiftTimeout       : number of seconds timeout consistent with php-cloudfiles. Default: 10
  */
 public function __construct(array $config)
 {
     parent::__construct($config);
     // Required settings
     $this->auth = new CF_Authentication($config['swiftUser'], $config['swiftKey'], null, $config['swiftAuthUrl']);
     /* <Wikia> */
     if (!empty($config['debug'])) {
         $this->auth->setDebug($config['debug']);
     }
     $this->swiftTimeout = isset($config['swiftTimeout']) ? intval($config['swiftTimeout']) : 10;
     /* </Wikia> */
     // Optional settings
     $this->authTTL = isset($config['swiftAuthTTL']) ? $config['swiftAuthTTL'] : 120;
     // some sane number
     $this->swiftAnonUser = isset($config['swiftAnonUser']) ? $config['swiftAnonUser'] : '';
     $this->shardViaHashLevels = isset($config['shardViaHashLevels']) ? $config['shardViaHashLevels'] : '';
     /* <Wikia> */
     // caching credentials
     if (!empty($config['cacheAuthInfo']) && $config['cacheAuthInfo'] === true) {
         $this->srvCache = wfGetMainCache();
     }
     $this->srvCache = $this->srvCache ? $this->srvCache : new EmptyBagOStuff();
     /* </Wikia> */
 }
開發者ID:yusufchang,項目名稱:app,代碼行數:39,代碼來源:SwiftFileBackend.php


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