本文整理汇总了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;
}
示例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);
}
}
示例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);
}
示例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()));
}