本文整理匯總了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);
}
示例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;
}
示例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;
}