Example #1
0
 public function clearFolder($moduleid)
 {
     if (!$moduleid) {
         return false;
     }
     $dir = $this->getSaveDir($moduleid);
     $store = Wind::getComponent('storage');
     //单独使用
     if (!$store instanceof PwStorageLocal) {
         $store->delete($dir, 0);
     } else {
         $dir = Wind::getRealDir('PUBLIC:') . PUBLIC_ATTACH . '/' . $dir;
         WindFolder::clearRecur($dir, true);
     }
     return true;
 }
Example #2
0
 /**
  * 更新成功后备份
  *
  * @return multitype:string
  */
 private function _backSuccess()
 {
     $data_dir = Wind::getRealDir('DATA:');
     $suffix = '[' . Pw::time2str(WEKIT_TIMESTAMP, 'Y-m-d Hi') . ']';
     $up_source = $data_dir . 'upgrade';
     $up_target = $data_dir . 'upgrade' . $suffix;
     PwApplicationHelper::copyRecursive($up_source, $up_target);
     $status = Wekit::cache()->get('system_upgrade');
     $ba_source = $data_dir . 'backup' . DIRECTORY_SEPARATOR . 'phpwind_' . str_replace('.', '', $status['oldversion']) . '_' . $status['oldrelease'];
     $ba_target = $data_dir . 'backup' . $suffix;
     PwApplicationHelper::copyRecursive($ba_source, $ba_target);
     WindFolder::clearRecur($up_source, true);
     WindFolder::clearRecur($ba_source, true);
     return array($up_target, $ba_target);
 }
Example #3
0
 /**
  * 删除应用目录
  *
  */
 public function delFolderAction()
 {
     $folder = $this->getInput('folder', 'post');
     if ($folder) {
         is_dir(EXT_PATH . $folder) && WindFolder::clearRecur(EXT_PATH . $folder, true);
         is_dir(THEMES_PATH . 'extres/' . $folder) && WindFolder::clearRecur(THEMES_PATH . 'extres/' . $folder, true);
     }
     $this->showMessage('success');
 }
Example #4
0
 public function clear()
 {
     if ($this->ftp) {
         $this->ftp->close();
     }
     WindFolder::clearRecur($this->tmpPath, true);
     Wekit::cache()->delete('system_patch_ftp');
 }
 public function clear()
 {
     return WindFolder::clearRecur($this->getCacheDir());
 }
Example #6
0
 /**
  * 删除应用目录
  *
  */
 public function delFolderAction()
 {
     $folder = $this->getInput('folder', 'get');
     $dir = Wind::getRealDir('THEMES:' . $folder);
     WindFolder::clearRecur($dir, true);
     $this->showMessage('success');
 }
 private function _generateAdmin()
 {
     if ($this->need_admin) {
         $classname = $this->_ucwords($this->alias) . '_ConfigDo';
         $hook = array('s_admin_menu' => array('app_' . $this->alias => array('class' => 'EXT:' . $this->alias . '.service.srv.' . $classname, 'loadway' => 'load', 'method' => 'getAdminMenu', 'description' => $this->name . 'admin menu')));
         Wind::import('WIND:parser.WindXmlParser');
         $parser = new WindXmlParser();
         $hook = preg_replace('/<\\?xml[^\\?]+\\?>/i', '', $parser->parseToXml($hook, Wind::getApp()->getResponse()->getCharset()));
         $hook = str_replace('><', ">\n\t<", $hook);
         $this->manifest = strtr($this->manifest, array('{{inject_services}}' => $hook));
         $class = WindFile::read(dirname($this->defaultDir) . '/hook.admin');
         $class = strtr($class, array('{{alias}}' => $this->alias, '{{name}}' => $this->name, '{{classname}}' => $classname, '{{author}}' => $this->author, '{{email}}' => $this->email, '{{website}}' => $this->website));
         WindFolder::mkRecur($this->baseDir . '/service/srv/');
         WindFile::write($this->baseDir . '/service/srv/' . $classname . '.php', $class);
     } else {
         $this->manifest = strtr($this->manifest, array('{{inject_services}}' => ''));
         WindFolder::clearRecur($this->baseDir . '/admin', true);
         WindFolder::clearRecur($this->baseDir . '/template/admin', true);
     }
 }