當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。