Exemple #1
0
 public static function get_libs()
 {
     if (self::$libs === null) {
         $libs = array();
         $base = BASE_DIR . self::DIR_VENDOR;
         $vendors = \System\Directory::ls($base, 'd');
         foreach ($vendors as $vendor) {
             $vendor_path = $base . '/' . $vendor;
             $local = \System\Directory::ls($vendor_path, 'd');
             foreach ($local as $key => $lib) {
                 $local[$key] = $vendor . '/' . $lib;
             }
             $libs = array_merge($libs, $local);
         }
         self::$libs = $libs;
     }
     return self::$libs;
 }
Exemple #2
0
 /**
  * Builds static resource cache
  */
 public static function build_static_for($lib = null)
 {
     if ($lib === null) {
         $base = BASE_DIR;
     } else {
         $base = BASE_DIR . \System\Composer::DIR_VENDOR . '/' . $lib;
     }
     $static = $base . '/share';
     $files = \System\Directory::ls($static);
     $target = BASE_DIR . self::DIR_STATIC;
     foreach ($files as $file) {
         if (is_dir($static . DIRECTORY_SEPARATOR . $file)) {
             \System\Directory::copy($static . DIRECTORY_SEPARATOR . $file, $target . DIRECTORY_SEPARATOR . $file);
         } else {
             copy($static . DIRECTORY_SEPARATOR . $file, $target . DIRECTORY_SEPARATOR . $file);
         }
     }
 }