本文整理汇总了PHP中Kohana::Config方法的典型用法代码示例。如果您正苦于以下问题:PHP Kohana::Config方法的具体用法?PHP Kohana::Config怎么用?PHP Kohana::Config使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Kohana
的用法示例。
在下文中一共展示了Kohana::Config方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: factory
/**
* Creates an image wrapper.
*
* @param string image file path
* @param string driver type: GD, ImageMagick, etc
* @return Image
*/
public static function factory($file, $driver = NULL)
{
if ($driver === NULL) {
// Use the default driver
$driver = Kohana::Config('image')->driver;
}
// Set the class name
$class = 'Image_' . $driver;
return new $class($file);
}
示例2: __construct
/**
* Runs [Image_ImageMagick::check] and loads the image.
*
* @return void
* @throws Kohana_Exception
*/
public function __construct($file)
{
// Load ImageMagick path from config
Image_ImageMagick::$_imagemagick = Kohana::Config('imagemagick')->path;
if (!is_dir(Image_ImageMagick::$_imagemagick)) {
throw new Kohana_Exception('ImageMagick path is not a valid directory, check your configuration');
}
if (!Image_ImageMagick::$_checked) {
// Run the install check
Image_ImageMagick::check();
}
parent::__construct($file);
}
示例3: LangDefault
public static function LangDefault()
{
$l = Kohana::Config('locale.language');
if ($l[0] == 'en_US') {
return false;
}
return true;
}
示例4: configs
private static function configs()
{
if (Kohana::config('debug_toolbar.skip_configs') === TRUE) {
return array();
}
$inc_paths = Kohana::include_paths();
$configs = array();
foreach ($inc_paths as $inc_path) {
foreach (glob($inc_path . '/config/*.php') as $filename) {
$filename = pathinfo($filename, PATHINFO_FILENAME);
if (in_array($filename, (array) Kohana::config('debug_toolbar.skip_configs'))) {
continue;
}
if (!isset($configs[$filename])) {
$configs[$filename] = Kohana::Config($filename);
}
}
}
return $configs;
}