当前位置: 首页>>代码示例>>PHP>>正文


PHP Configure::check方法代码示例

本文整理汇总了PHP中Cake\Core\Configure::check方法的典型用法代码示例。如果您正苦于以下问题:PHP Configure::check方法的具体用法?PHP Configure::check怎么用?PHP Configure::check使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Cake\Core\Configure的用法示例。


在下文中一共展示了Configure::check方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: startup

 /**
  * Override startup of the Shell
  *
  * @return void
  */
 public function startup()
 {
     parent::startup();
     if (isset($this->params['connection'])) {
         $this->connection = $this->params['connection'];
     }
     $class = Configure::read('Acl.classname');
     if (strpos($class, '\\') === false && strpos($class, '.') === false) {
         $className = App::classname('Acl.' . $class, 'Adapter');
     } else {
         $className = App::classname($class, 'Adapter');
     }
     if ($class !== 'DbAcl' && !is_subclass_of($className, 'Acl\\Adapter\\DbAcl')) {
         $out = "--------------------------------------------------\n";
         $out .= __d('cake_acl', 'Error: Your current CakePHP configuration is set to an ACL implementation other than DB.') . "\n";
         $out .= __d('cake_acl', 'Please change your core config to reflect your decision to use DbAcl before attempting to use this script') . "\n";
         $out .= "--------------------------------------------------\n";
         $out .= __d('cake_acl', 'Current ACL Classname: {0}', [$class]) . "\n";
         $out .= "--------------------------------------------------\n";
         $this->err($out);
         $this->_stop();
     }
     if ($this->command) {
         if (Configure::check('Datasource') === null) {
             $this->out(__d('cake_acl', 'Your database configuration was not found. Take a moment to create one.'));
             $this->args = null;
             $this->DbConfig->execute();
             return;
         }
         try {
             TableRegistry::get('Aros')->schema();
             TableRegistry::remove('Aros');
         } catch (\Cake\Database\Exception $e) {
             $this->out(__d('cake_acl', 'Acl database tables not found. To create them, run:'));
             $this->out();
             $this->out('  bin/cake Migrations.migrations migrate -p Acl');
             $this->out();
             $this->_stop();
             return;
         }
         $registry = new ComponentRegistry();
         $this->Acl = new AclComponent($registry);
     }
 }
开发者ID:rashmi,项目名称:newrepo,代码行数:49,代码来源:AclShell.php

示例2: __construct

 /**
  * Constructor
  *
  */
 public function __construct()
 {
     parent::__construct();
     if (Configure::check('Acl.cacheConfig')) {
         $this->_cacheConfig = Configure::read('Acl.cacheConfig');
     }
 }
开发者ID:edukondaluetg,项目名称:acl,代码行数:11,代码来源:CachedDbAcl.php

示例3: render

 public function render(array $data, ContextInterface $context)
 {
     //         debug($data);
     //         debug($this->_templates);
     $date_data = ['type' => 'text', 'name' => $data['name'] . '__date__', 'id' => $this->get_dom_id($data['name'] . '-date'), 'language' => $data['language'], 'datepicker_format' => $data['datepicker_format'], 'upper_datepicker_id' => isset($data['upper_datepicker_name']) ? $this->get_dom_id($data['upper_datepicker_name'] . '-date') : null, 'upper_datepicker_name' => isset($data['upper_datepicker_name']) ? $data['upper_datepicker_name'] : null, 'format_on_blur' => $data['format_on_blur'], 'alaxos_js_format' => $data['alaxos_js_format'], 'class' => 'form-control inputDate'];
     //         debug($date_data);
     $time_data = ['type' => 'text', 'name' => $data['name'] . '__time__', 'id' => $this->get_dom_id($data['name'] . '-time'), 'class' => 'form-control inputTime'];
     $hidden_data = ['type' => 'hidden', 'name' => $data['name'], 'id' => $this->get_dom_id($data['name'] . '-hidden')];
     $display_timezone = null;
     if (Configure::check('display_timezone')) {
         $display_timezone = Configure::read('display_timezone');
     } elseif (Configure::check('default_display_timezone')) {
         $display_timezone = Configure::read('default_display_timezone');
     }
     /*
      * Case of posted data
      */
     if (isset($data['val']) && !empty($data['val']) && is_string($data['val'])) {
         $data['val'] = Time::parse($data['val'], $display_timezone);
     }
     if (isset($data['val']) && (is_a($data['val'], 'Cake\\I18n\\Time') || is_a($data['val'], 'Cake\\I18n\\FrozenTime'))) {
         if (isset($display_timezone)) {
             $data['val']->setTimezone($display_timezone);
             //it doesn't change the timezone internally, but it changes the tz used for display
         }
         $datetime = $data['val'];
         $date_data['value'] = $datetime->format($data['php_date_format']);
         $time_data['value'] = $datetime->format('H:i');
         $hidden_data['value'] = $date_data['value'] . ' ' . $time_data['value'];
     }
     $input = $this->get_html_code($date_data, $time_data, $hidden_data);
     $input .= $this->get_js_code($date_data, $time_data, $hidden_data);
     return $input;
 }
开发者ID:alaxos,项目名称:cakephp3-libs,代码行数:34,代码来源:Datetime.php

示例4: config

 /**
  * Gets config values stored in the configuration.
  * It will first look in the MeCms configuration, then in the application configuration
  * @param string|null $key Configuration key
  * @return mixed Configuration value
  */
 function config($key = null)
 {
     if ($key !== null && Configure::check(sprintf('MeCms.%s', $key))) {
         return Configure::read(sprintf('MeCms.%s', $key));
     }
     return Configure::read($key);
 }
开发者ID:mirko-pagliai,项目名称:me-cms,代码行数:13,代码来源:global_functions.php

示例5: startup

 /**
  * Override startup of the Shell
  *
  * @return void
  */
 public function startup()
 {
     parent::startup();
     if (isset($this->params['connection'])) {
         $this->connection = $this->params['connection'];
     }
     $class = Configure::read('Acl.classname');
     $className = App::classname('Acl.' . $class, 'Adapter');
     if ($class !== 'DbAcl' && !is_subclass_of($className, 'Acl\\Adapter\\DbAcl')) {
         $out = "--------------------------------------------------\n";
         $out .= __d('cake_acl', 'Error: Your current CakePHP configuration is set to an ACL implementation other than DB.') . "\n";
         $out .= __d('cake_acl', 'Please change your core config to reflect your decision to use DbAcl before attempting to use this script') . "\n";
         $out .= "--------------------------------------------------\n";
         $out .= __d('cake_acl', 'Current ACL Classname: %s', $class) . "\n";
         $out .= "--------------------------------------------------\n";
         $this->err($out);
         return $this->_stop();
     }
     if ($this->command) {
         if (Configure::check('Datasource') === null) {
             $this->out(__d('cake_acl', 'Your database configuration was not found. Take a moment to create one.'));
             $this->args = null;
             return $this->DbConfig->execute();
         }
         if (!in_array($this->command, ['initdb'])) {
             $registry = new ComponentRegistry();
             $this->Acl = new AclComponent($registry);
             $controller = new Controller();
         }
     }
 }
开发者ID:ceeram,项目名称:acl,代码行数:36,代码来源:AclShell.php

示例6: initialize

 /**
  * Initialization 
  * @return void
  */
 public function initialize()
 {
     parent::initialize();
     $this->loadComponent('Math');
     if (!Configure::check('twitter')) {
         throw new \LogicException('Configuration Twitter is not defined');
     }
 }
开发者ID:SamHecquet,项目名称:search-term-for-keyhole,代码行数:12,代码来源:PagesController.php

示例7: initialize

 /**
  * Initialize method
  *
  * @param array $config The configuration for the Table.
  * @return void
  */
 public function initialize(array $config)
 {
     $table = Configure::check('CakephpBlueimpUpload.upload_table') ? Configure::read('CakephpBlueimpUpload.upload_table') : 'uploads';
     $this->table($table);
     $this->displayField('id');
     $this->primaryKey('id');
     $this->addBehavior('Timestamp');
 }
开发者ID:waspinator,项目名称:cakephp3-blueimp-upload,代码行数:14,代码来源:UploadsTable.php

示例8: read

 function read($key, $default = null)
 {
     $ret = $default;
     if (Configure::check($key)) {
         $ret = Configure::read($key);
     }
     return $ret;
 }
开发者ID:gourmet,项目名称:platform,代码行数:8,代码来源:functions.php

示例9: index

 /**
  * Index method
  *
  * @return void
  */
 public function index()
 {
     if (Configure::check('Notifications.default_language')) {
         $this->NotificationContents->locale(Configure::read('Notifications.default_language'));
     } else {
         $this->NotificationContents->locale('eng');
     }
     $this->set('notificationContents', $this->paginate($this->NotificationContents));
 }
开发者ID:codekanzlei,项目名称:cake-notifications,代码行数:14,代码来源:NotificationContentsController.php

示例10: __construct

 /**
  * Creates a Transport instance
  *
  * @param array $config transport-specific configuration options
  */
 public function __construct(array $config)
 {
     parent::__construct($config);
     $keys = Configure::read('Notifications.transports.push_message');
     if (Configure::check('Notifications.transports.push_message.' . ENVIRONMENT)) {
         // prefer environment specific config keys
         $keys = Configure::read('Notifications.transports.push_message.' . ENVIRONMENT);
     }
     ParseClient::initialize($keys['app_id'], $keys['rest_key'], $keys['master_key']);
 }
开发者ID:codekanzlei,项目名称:cake-notifications,代码行数:15,代码来源:PushMessageTransport.php

示例11: getOptionParser

 /**
  * Display help for this console.
  *
  * @return ConsoleOptionParser
  */
 public function getOptionParser()
 {
     $file = Runner::ROBOFILE;
     if (Configure::check('Path.robofile')) {
         $file = Configure::read('Path.robofile');
     }
     $parser = new ConsoleOptionParser('robot', false);
     $parser->description('This shell provides a Robo runner.' . "\n\n" . 'You will need to have robo installed for this Shell to work. ')->addOption('config', ['help' => __d('cake_console', 'Path to your RoboFile class'), 'default' => $file]);
     return $parser;
 }
开发者ID:gourmet,项目名称:robo,代码行数:15,代码来源:RobotShell.php

示例12: loopResolver

/**
 * @return LoopInterface
 */
function loopResolver()
{
    if (Configure::check('WyriHaximus.Ratchet.loop') && Configure::read('WyriHaximus.Ratchet.loop') instanceof LoopInterface) {
        return Configure::read('WyriHaximus.Ratchet.loop');
    }
    if (class_exists('PipingBag\\Di\\PipingBag') && Configure::check('WyriHaximus.Ratchet.pipingbag.loop')) {
        return PipingBag::get(Configure::read('WyriHaximus.Ratchet.pipingbag.loop'));
    }
    return Factory::create();
}
开发者ID:mrduongnv,项目名称:Ratchet,代码行数:13,代码来源:functions.php

示例13: _welcome

 protected function _welcome()
 {
     if (!Configure::check('DelayedJobs')) {
         throw new Exception('Could not load config, check your load settings in bootstrap.php');
     }
     $hostname = php_uname('n');
     $this->clear();
     $this->out('Hostname: <info>' . $hostname . '</info>');
     $this->hr();
 }
开发者ID:uafrica,项目名称:delayed-jobs,代码行数:10,代码来源:WatchdogShell.php

示例14: beforeFilter

 /**
  * Event
  *
  * @param Event $event event
  * @return void
  */
 public function beforeFilter(\Cake\Event\Event $event)
 {
     $this->loadModel('Notifications.NotificationContents');
     if (Configure::check('Notifications.default_language')) {
         $this->NotificationContents->locale(Configure::read('Notifications.default_language'));
     } else {
         $this->NotificationContents->locale('eng');
     }
     parent::beforeFilter($event);
 }
开发者ID:kiliansch,项目名称:cake-notifications,代码行数:16,代码来源:NotificationContentsController.php

示例15: dontSeeInConfig

 /**
  * Asserts that a given key (and value) do not exist in the configuration.
  *
  * @param string|array $key Configuration key or array of key/values.
  * @param mixed $value Value to check for. If `NULL`, checks only key.
  */
 public function dontSeeInConfig($key, $value = null)
 {
     if (is_array($key)) {
         array_walk($key, function ($v, $k) {
             $this->dontSeeInConfig($k, $v);
         });
         return;
     }
     $message = "Unexpectedly managed to find the {$key} config key";
     if (is_null($value)) {
         $this->assertFalse(Configure::check($key), $message);
         return;
     }
     $message .= ' with ' . json_encode($value);
     $this->assertNotEquals($value, Configure::read($key), $message);
 }
开发者ID:cakephp,项目名称:codeception,代码行数:22,代码来源:ConfigTrait.php


注:本文中的Cake\Core\Configure::check方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。