本文整理汇总了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;
}