Ejemplo n.º 1
0
 static function start()
 {
     $rootDir = so_root::make()->dir;
     $export = $rootDir['-so_export'];
     $rootDir['release.php']->copy($export['index.php']);
     $rootDir['.htaccess']->copy($export['.htaccess']);
     $rootDir['php.ini']->copy($export['php.ini']);
     $rootDir['icon.png']->copy($export['icon.png']);
     foreach (so_root::make()->packages as $package) {
         foreach ($package->sources as $source) {
             $file = $source->file;
             if (preg_match('~\\.(js|css|xsl|php|meta.tree|doc.xhtml)$~', $file->name)) {
                 continue;
             }
             $target = $export->go($file->relate($rootDir));
             $file->copy($target);
         }
         $target = $export[$package->name];
         foreach ($package->dir->childs as $file) {
             if ($file->type != 'file') {
                 continue;
             }
             if (!preg_match('~^release\\.~', $file->name)) {
                 continue;
             }
             $file->copy($target[$file->name]);
         }
         $target = $export[$package->name]['-mix'];
         foreach ($package->dir['-mix']->childs as $file) {
             if ($file->type === 'file' && !preg_match('~^(release|bundle)\\.~', $file->name)) {
                 continue;
             }
             $file->copy($target[$file->name]);
         }
     }
     return $export->uri;
 }
Ejemplo n.º 2
0
 function dumpDepends()
 {
     $root = so_root::make();
     $map = array();
     foreach ($this->modules as $base) {
         foreach ($base->uses as $target) {
             $map[$target->dir->relate($root->dir)][$base->dir->relate($root->dir)] = 1;
         }
     }
     foreach ($map as &$module) {
         $module = array_keys($module);
     }
     $this->target['depends.json']->content = json_encode($map, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES);
 }
Ejemplo n.º 3
0
 function root_make()
 {
     return so_root::make($this->dir->parent);
 }