Ejemplo n.º 1
0
 public function bundle_builder($name, $options = array(), $plugin = "", $type)
 {
     $tag_build = new \AssetTagHelper();
     $b_method = $this->type_mapping[$type]['b_method'];
     if (ENV == "development" && !defined("PRODUCTION_ASSETS")) {
         if ($plugin) {
             $dir = $this->fetch_dir($name, $type);
             if (!$dir) {
                 $dir = array("base" => PLUGIN_DIR . $plugin . "/resources/public/", "dir" => PLUGIN_DIR . $type . "/");
             }
         } else {
             $dir = array("base" => PUBLIC_DIR, "dir" => PUBLIC_DIR . $type . "/" . $name);
         }
         foreach ($this->find_files($dir["dir"], $this->type_mapping[$type]['filter']) as $file) {
             $ret .= $tag_build->{$b_method}("/" . str_replace($dir["base"], "", $file), $options);
         }
     } else {
         $git_rev = \AssetTagHelper::git_revision();
         $ret = $tag_build->{$b_method}("/build/{$git_rev}/{$type}/{$name}", $options);
     }
     return $ret;
 }