示例#1
0
 /**
  * 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);
 }
 /**
  * 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
0
 public static function LangDefault()
 {
     $l = Kohana::Config('locale.language');
     if ($l[0] == 'en_US') {
         return false;
     }
     return true;
 }
示例#4
0
 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;
 }