/**
  * 复制资源文件
  *
  * @param unknown_type $alias        	
  * @param unknown_type $manifest        	
  * @return boolean
  */
 private function _copyRes($alias, $manifest)
 {
     $this->app = $this->_appDs()->findByAlias($alias);
     $this->app_id = $this->app['app_id'];
     $this->manifest = new PwManifest($manifest);
     $man_array = $this->manifest->getManifest();
     $log = array();
     if ($man_array['res']) {
         $source = dirname($manifest) . DIRECTORY_SEPARATOR . str_replace('.', DIRECTORY_SEPARATOR, $man_array['res']);
         $targetPath = Wind::getRealDir('THEMES:extres.' . $alias, true);
         if (!is_dir($source)) {
             return false;
         }
         PwApplicationHelper::copyRecursive($source, $targetPath);
         $app_log = $this->_loadInstallLog()->findByAppId($this->app_id);
         $packs_log = array();
         foreach ($app_log as $v) {
             if ($v['log_type'] == 'packs') {
                 $packs_log = $v['data'];
             }
         }
         if (!in_array($targetPath, $packs_log)) {
             $packs_log[] = $targetPath;
         }
         $log[] = array('app_id' => $this->app_id, 'log_type' => 'packs', 'data' => $packs_log, 'created_time' => WEKIT_TIMESTAMP, 'modified_time' => WEKIT_TIMESTAMP);
     }
     $log && $this->_loadInstallLog()->batchAdd($log);
 }
示例#2
0
 /**
  * 获取扩展信息
  */
 public function hookAction()
 {
     $alias = $this->getInput('alias');
     $manifest = Wind::getRealPath('EXT:' . $alias . '.Manifest.xml', true);
     $hooks = $injectors = array();
     if (is_file($manifest)) {
         $man = new PwManifest($manifest);
         $hooks = $man->getHooks();
         $injectors = $man->getInjectServices();
     }
     $this->setOutput(array('hooks' => $hooks, 'injectors' => $injectors));
 }