当前位置: 首页>>代码示例>>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;未经允许,请勿转载。