예제 #1
0
 /**
  * Constructor 
  * 
  * @author Jonathan Geiger
  */
 public function __construct(array $files, $type, $options = NULL)
 {
     // Only do this once
     if (empty(asset::$config)) {
         asset::$config = Kohana::config('assets');
     }
     // Just for convenience's sake
     $config = asset::$config;
     // String? Append to the prefix
     if (is_string($options)) {
         $options = array('cache' => $options);
     } else {
         if ($options === FALSE) {
             $options = array('cache' => FALSE);
         } else {
             if (!is_array($options)) {
                 $options = array();
             }
         }
     }
     // Load the configuration
     foreach (arr::merge($config[$type], $options) as $key => $value) {
         $this->{$key} = $value;
     }
     // Set the type
     $this->type = $type;
     // Set the working host_root and host, which is determined by the host
     $host = $this->host();
     $this->host_root = $host['root'];
     $this->host = $host['host'];
     // Process the paths
     $this->process_files($files);
 }