Example #1
0
 /**
  * populateVendorMap method
  *
  * @param bool $reset false
  * @static
  * @return void
  * @access protected
  */
 protected static function _populateVendorMap($reset = false)
 {
     if ($reset || !self::$vendorMap) {
         App::import('Vendor', 'Mi.MiCache');
         $plugins = MiCache::mi('plugins');
         foreach ($plugins as $path => $plugin) {
             if (is_dir($path . DS . 'webroot')) {
                 if (!class_exists('Mi')) {
                     APP::import('Vendor', 'Mi.Mi');
                 }
                 $files = Mi::files($path . DS . 'webroot', null, '.*\\.(css|js)$');
                 foreach ($files as $fPath) {
                     $fPath = realpath($fPath);
                     self::$vendorMap[str_replace(realpath($path . DS . 'webroot') . DS, $plugin . DS, $fPath)] = $fPath;
                 }
             }
         }
         self::log("Populating Vendor Map");
         if (!class_exists('MiCache')) {
             self::log("\tMiCache doesn't exist. Skipping.");
             return;
         }
         self::$vendorMap = am(self::$vendorMap, MiCache::mi('vendors', null, array('shells'), array('excludeFolders' => array('shells', 'simpletest'), 'extension' => array('css', 'js'), 'excludePattern' => false)));
         self::log("\tDone.");
     }
 }