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


PHP Configure::consume方法代碼示例

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


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

示例1: initialize

 public function initialize(Controller $controller)
 {
     // Verify AuthTicket Config exists & we have a secret
     Configure::load('auth_ticket');
     if (Configure::read('auth_ticket.secret') == null) {
         // FAILZOR
         throw new InternalErrorException('AuthTicketComponent was unable to setup sucessfully. Missing secret.');
     }
     $this->_key = Configure::consume('auth_ticket.secret');
     $this->_defaultExpiration = Configure::read('auth_ticket.default_expiration') != null ? Configure::read('auth_ticket.default_expiration') : $this->_defaultExpiration;
     $this->_cookieName = Configure::read('auth_ticket.cookie_name') != null ? Configure::read('auth_ticket.cookie_name') : $this->_cookieName;
     $this->_domain = Configure::read('auth_ticket.domain') != null ? Configure::read('auth_ticket.domain') : $this->_cookieName;
 }
開發者ID:ubnetdef,項目名稱:auth_server,代碼行數:13,代碼來源:AuthTicketComponent.php

示例2: startup

 /**
  * startup callback
  *
  * @param \Cake\Event\Event $event Event.
  * @throws Exception If API Key is not provided
  * @return void
  */
 public function startup(Event $event)
 {
     $key = Configure::consume('Openweathermap.key');
     if (isset($key) && !empty($key)) {
         $this->config('key', $key);
     } else {
         throw new \Exception(__d('openweathermap', 'API Key must be provided'));
     }
     $lang = Configure::consume('Openweathermap.lang');
     if (isset($lang) && !empty($lang)) {
         $this->config('lang', $lang);
     }
     $units = Configure::consume('Openweathermap.units');
     if (isset($units) && !empty($units)) {
         $this->config('units', $units);
     }
 }
開發者ID:cakephp-fr,項目名稱:openweathermap,代碼行數:24,代碼來源:OpenweathermapComponent.php

示例3: testConsumeEmpty

 /**
  * testConsumeEmpty
  *
  * @return void
  */
 public function testConsumeEmpty()
 {
     Configure::write('Test', array('key' => 'value', 'key2' => 'value2'));
     $result = Configure::consume('');
     $this->assertNull($result);
     $result = Configure::consume(null);
     $this->assertNull($result);
 }
開發者ID:angel-mendoza,項目名稱:proyecto-pasantia,代碼行數:13,代碼來源:ConfigureTest.php

示例4: array

<?php

$handlerConfig = Hash::merge(array('engine' => 'RedisSession.RedisSession', 'userMap' => true), Configure::consume('RedisSession.handler'));
Configure::write('Session', Hash::merge(Configure::read('Session'), array('defaults' => 'php', 'handler' => $handlerConfig)));
if (isset($handlerConfig['userMap'])) {
    if (extension_loaded('wddx')) {
        ini_set('session.serialize_handler', 'wddx');
    } else {
        CakeLog::critical('wddx not available. user map not enabled');
    }
}
if (class_exists('CroogoNav')) {
    CroogoNav::add('extensions.children.RedisSession', array('title' => __d('redis_session', 'Login Sessions'), 'url' => array('plugin' => 'redis_session', 'controller' => 'session_stores', 'action' => 'index'), 'children' => array()));
}
開發者ID:rchavik,項目名稱:RedisSession,代碼行數:14,代碼來源:bootstrap.php


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