當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Plugin::configPath方法代碼示例

本文整理匯總了PHP中Cake\Core\Plugin::configPath方法的典型用法代碼示例。如果您正苦於以下問題:PHP Plugin::configPath方法的具體用法?PHP Plugin::configPath怎麽用?PHP Plugin::configPath使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Cake\Core\Plugin的用法示例。


在下文中一共展示了Plugin::configPath方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: __construct

 /**
  * Constructor
  *
  * @param string $message
  * @param int $code Status code, defaults to 500
  */
 public function __construct($message = null, $code = 500)
 {
     if (empty($message)) {
         $message = 'Please copy "' . Plugin::configPath('FrankFoerster/Bitly') . 'bitly.example.php" to "' . CONFIG . 'bitly.php".';
     }
     parent::__construct($message, $code);
 }
開發者ID:frankfoerster,項目名稱:cakephp-bitly,代碼行數:13,代碼來源:MissingConfigurationFileException.php

示例2: _getFilePath

 /**
  * Get file path
  *
  * @param string $key The identifier to write to. If the key has a . it will be treated
  *  as a plugin prefix.
  * @param bool $checkExists Whether to check if file exists. Defaults to false.
  * @return string Full file path
  * @throws \Cake\Core\Exception\Exception When files don't exist or when
  *  files contain '..' as this could lead to abusive reads.
  */
 protected function _getFilePath($key, $checkExists = false)
 {
     if (strpos($key, '..') !== false) {
         throw new Exception('Cannot load/dump configuration files with ../ in them.');
     }
     list($plugin, $key) = pluginSplit($key);
     if ($plugin) {
         $file = Plugin::configPath($plugin) . $key;
     } else {
         $file = $this->_path . $key;
     }
     $file .= $this->_extension;
     if ($checkExists && !is_file($file)) {
         throw new Exception(sprintf('Could not load configuration file: %s', $file));
     }
     return $file;
 }
開發者ID:JesseDarellMoore,項目名稱:CS499,代碼行數:27,代碼來源:FileConfigTrait.php

示例3: _getFilePath

 /**
  * Get file path
  *
  * @param string $key The identifier to write to. If the key has a . it will be treated
  *  as a plugin prefix.
  * @return string Full file path
  */
 protected function _getFilePath($key)
 {
     if (substr($key, -8) === '.ini.php') {
         $key = substr($key, 0, -8);
         list($plugin, $key) = pluginSplit($key);
         $key .= '.ini.php';
     } else {
         if (substr($key, -4) === '.ini') {
             $key = substr($key, 0, -4);
         }
         list($plugin, $key) = pluginSplit($key);
         $key .= '.ini';
     }
     if ($plugin) {
         $file = Plugin::configPath($plugin) . $key;
     } else {
         $file = $this->_path . $key;
     }
     return $file;
 }
開發者ID:maitrepylos,項目名稱:nazeweb,代碼行數:27,代碼來源:IniConfig.php


注:本文中的Cake\Core\Plugin::configPath方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。