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


PHP Configure::check方法代码示例

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


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

示例1: load

 public function load()
 {
     if (Cache::read('qe.dbconfig_' . hash("md5", "qe_dbconfig"), QEResp::QUICK_EMAILER_CACHE)) {
         return true;
     }
     if (Configure::check('qe.dbconfig')) {
         if (!file_exists(APP . 'Config' . DS . 'database.php')) {
             return QEResp::RESPOND(QEResp::ERROR, QuickEmailerErrorDefinitions::NO_DATABASE_CONFIGURED());
         }
         try {
             $datasource = ConnectionManager::getDataSource(Configure::read('qe.dbconfig'));
             if ($datasource->connected) {
                 $this->CheckTables($datasource);
                 Cache::write('qe.dbconfig_' . hash("md5", "qe_dbconfig"), true, QEResp::QUICK_EMAILER_CACHE);
                 return true;
             }
             return QEResp::RESPOND(QEResp::ERROR, QuickEmailerErrorDefinitions::NO_DATABASE_CONFIGURED());
         } catch (Exception $e) {
             $excep_message = QuickEmailerResponseHandler::AddExceptionInfo(QuickEmailerErrorDefinitions::NO_DATABASE_CONFIGURED(), $e);
             //TODO: Log errors
             return QEResp::RESPOND(QEResp::ERROR, $excep_message);
         }
     } else {
         return QEResp::RESPOND(QEResp::ERROR, QuickEmailerErrorDefinitions::NO_DATABASE_CONFIGURED());
     }
 }
开发者ID:walisc,项目名称:CakephpQuickEmailer,代码行数:26,代码来源:DALComponent.php

示例2: _setConfig

 /**
  * Set config
  * @param array $config
  */
 private function _setConfig(array $config)
 {
     if (Configure::check('MediaPost')) {
         $config = array_merge($config, Configure::read('MediaPost'));
     }
     $this->config = $config;
 }
开发者ID:lsantosc,项目名称:cakephp-mediapost,代码行数:11,代码来源:MediaPostSource.php

示例3: loadTwitter

 protected function loadTwitter()
 {
     if (isset($this->Twitter)) {
         if ($this->Twitter) {
             return $this->Twitter;
         }
     }
     if (!class_exists('Endroid\\Twitter\\Twitter')) {
         App::uses('endroid/twitter/src/endroid/twitter', 'Vendor');
     }
     if (!class_exists('Endroid\\Twitter\\Twitter')) {
         return false;
     }
     if (!is_file(APP . DS . 'Config' . DS . 'twitter.php')) {
         return false;
     }
     if (!Configure::load('twitter')) {
         return false;
     }
     if (!Configure::check('Twitter')) {
         return false;
     }
     $settings = Configure::read('Twitter');
     if (empty($settings)) {
         return false;
     }
     extract($settings);
     $this->controller->Twitter = new Endroid\Twitter\Twitter($consumerKey, $consumerSecret, $accessToken, $accessTokenSecret);
     return $this->controller->Twitter ?: !$this->log(array("InitializeComponent->twitter" => array('request->here' => $this->controller->request->here, 'request->params' => $this->controller->request->params) + compact('settings')), 'debug');
 }
开发者ID:JacopKane,项目名称:Cake-Nod,代码行数:30,代码来源:InitializeComponent.php

示例4: main

 /**
  * Scans SVN for changes, and queues those plugins for update and refresh.
  *
  * @return int Shell return code.
  */
 function main()
 {
     $max = 100;
     if (isset($this->args[0]) && is_numeric($this->args[0]) && $this->args[0] > 0) {
         $max = (int) $this->args[0];
     }
     $this->out(__('Checking latest revision from SVN...'));
     $latest_revision = $this->_getLatestRevision();
     if (!Configure::check('App.svn_revision')) {
         $this->out(__('<info>First update detected, skipping to revision %d.</info>', $latest_revision));
         $this->Setting->write('App.svn_revision', $latest_revision);
         $this->_unlock();
         return 0;
     }
     $revision = Configure::read('App.svn_revision');
     $last_revision = $revision + $max;
     if ($last_revision > $latest_revision) {
         $last_revision = $latest_revision;
     }
     if ($revision == $latest_revision) {
         $this->out(__('<info>No new changes, finished scanning.</info>'));
         $this->_unlock();
         return 0;
     }
     $this->out(__('Scanning SVN revisions %d through %d...', $revision, $last_revision));
     $plugin_slugs = $this->_getModifiedPlugins($revision, $last_revision);
     $this->_refreshPlugins($plugin_slugs);
     $this->_updatePlugins($plugin_slugs);
     $this->out(__('<info>Finished scanning.</info>'));
     $this->Setting->write('App.svn_revision', $last_revision);
     $this->_unlock();
     return 0;
 }
开发者ID:hasannawaz,项目名称:pluginmirror,代码行数:38,代码来源:ScanShell.php

示例5: __construct

 public function __construct(View $View, $settings = array())
 {
     if (!Configure::check('Ipay')) {
         throw new NotFoundException('Ipay config is not found');
     }
     $this->config = Configure::read('Ipay');
     parent::__construct($View, $settings);
 }
开发者ID:dilab,项目名称:ipay,代码行数:8,代码来源:IpayHelper.php

示例6: send

 /**
  * {@inheritdoc}
  */
 public function send($content, array $records)
 {
     $email = 'CakeEmail';
     if (Configure::check('Email.classname')) {
         $email = Configure::read('Email.classname');
     }
     $email::deliver($this->_to, $this->_subject, $content, $this->_config);
 }
开发者ID:jadb,项目名称:cakephp-monolog,代码行数:11,代码来源:CakeEmailHandler.php

示例7: _checkComplete

 protected function _checkComplete()
 {
     if (!Configure::check('Users.data')) {
         $this->setErrorMessage(__('Users configure settings is absent'));
         return true;
     }
     return false;
 }
开发者ID:vladshish,项目名称:usershell,代码行数:8,代码来源:UsersOperator.php

示例8: find

 /**
  * 名前をキーとしてインスタンスを探す
  *
  * @param string $name 名前
  * @return BcAbstractDetector|null
  */
 public static function find($name)
 {
     $key = static::$_configName . ".{$name}";
     if (!Configure::check($key)) {
         return null;
     }
     return new static($name, Configure::read($key));
 }
开发者ID:baserproject,项目名称:basercms,代码行数:14,代码来源:BcAbstractDetector.php

示例9: getConfig

 public function getConfig()
 {
     $key = 'Socialites.Providers.' . $this->_providerId;
     if (Configure::check($key)) {
         return Configure::read($key);
     }
     return false;
 }
开发者ID:xintesa,项目名称:socialites,代码行数:8,代码来源:SocialitesBaseEventHandler.php

示例10: __construct

 /**
  * Constructor
  *
  * @return ProPayProcessor
  */
 public function __construct()
 {
     $url = 'http://protectpaytest.propay.com/api/sps.svc?wsdl';
     if (Configure::check('ProPay.wsdlUrl')) {
         $url = Configure::read('ProPay.wsdlUrl');
     }
     $this->initialize(new SPS(array(), $url), new ID(Configure::read('ProPay.authenticationToken'), Configure::read('ProPay.billerAccountId')));
 }
开发者ID:clawsonm,项目名称:cakephp-propay,代码行数:13,代码来源:ProPayProcessor.php

示例11: find

 /**
  * 名前をキーとしてインスタンスを探す
  *
  * @param string $name 名前
  * @return BcAgent|null
  */
 public static function find($name)
 {
     $key = "BcAgent.{$name}";
     if (!Configure::check($key)) {
         return null;
     }
     return new static($name, Configure::read($key));
 }
开发者ID:kenz,项目名称:basercms,代码行数:14,代码来源:BcAgent.php

示例12: isDeletable

 /**
  * Checks wether given $path is deletable
  *
  * A file is deleteable when it resides under directories registered in
  * FileManager.deletablePaths
  *
  * @param string $path Path to check
  * @return boolean true when file is deletable
  */
 public function isDeletable($path)
 {
     $deletablePaths = Configure::check('FileManager.deletablePaths') ? Configure::read('FileManager.deletablePaths') : array();
     foreach ($deletablePaths as $deletablePath) {
         if ($this->_isWithinPath($deletablePath, $path)) {
             return true;
         }
     }
     return false;
 }
开发者ID:saydulk,项目名称:croogo,代码行数:19,代码来源:FileManager.php

示例13: init

 /**
  * Initialize the configuration
  *
  * Priority: env(WAKATIME_API_KEY) > config('wakatime.api_key')
  * @throws InvalidArgumentException if no WakaTime API key is detected.
  * @see WakaTimeComponent::initialize()
  * @return void
  */
 public function init()
 {
     if (getenv('WAKATIME_API_KEY')) {
         $this->WakaTime->setApiKey(getenv('WAKATIME_API_KEY'));
     } elseif (Configure::check('wakatime.api_key')) {
         $this->WakaTime->setApiKey(Configure::read('wakatime.api_key'));
     } else {
         throw new InvalidArgumentException('WakaTime config file required for tests.');
     }
 }
开发者ID:chrisvogt,项目名称:cakephp-wakatime,代码行数:18,代码来源:WakaTimeComponentTest.php

示例14: admin_index

 /**
  * List of themes
  */
 public function admin_index()
 {
     $this->set('title_for_layout', __d('hurad', 'Themes'));
     $currentTheme = array();
     $themes = HuradTheme::getThemeData();
     $current = Configure::read('template');
     if (Configure::check('template') && !empty($current)) {
         $currentTheme = $themes[Configure::read('template')];
     }
     $this->set(compact('themes', 'currentTheme'));
 }
开发者ID:hurad,项目名称:hurad,代码行数:14,代码来源:ThemesController.php

示例15: getResizeToSize

 /**
  * Return configured main image resize attributes
  * @return array
  */
 public function getResizeToSize()
 {
     $width = $height = 0;
     if (Configure::check('GalleryOptions.Pictures.resize_to.0')) {
         $width = Configure::read('GalleryOptions.Pictures.resize_to.0');
     }
     if (Configure::check('GalleryOptions.Pictures.resize_to.1')) {
         $height = Configure::read('GalleryOptions.Pictures.resize_to.1');
     }
     $crop = Configure::read('GalleryOptions.Pictures.resize_to.2');
     $action = $crop ? "crop" : "";
     return array('width' => $width, 'height' => $height, 'action' => $action);
 }
开发者ID:AntonKost,项目名称:cakegallery,代码行数:17,代码来源:Picture.php


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