Example #1
0
 public function clearcache()
 {
     //缓存路径
     $Webpath = './Web/Runtime/';
     $Adminpath = './Admin/Runtime/';
     $Userpath = './User/Runtime/';
     if (is_dir($Webpath)) {
         File::del_dir($Webpath);
     } elseif (is_dir($Adminpath)) {
         File::del_dir($Adminpath);
     } elseif (is_dir($Userpath)) {
         File::del_dir($Userpath);
     }
     //清空前台切换theme的cookie
     cookie('theme', null);
     //清理缓存的模型文件
     $list = scandir('./Web/Lib/Model');
     foreach ($list as $v) {
         if (substr($v, 0, 5) == 'addon') {
             unlink('./Web/Lib/Model/' . $v);
         }
     }
     $msg = '系统缓存清理完毕!';
     $this->assign('waitSecond', 5);
     $this->assign('jumpUrl', U('Index/main'));
     $this->success($msg);
 }
Example #2
0
 public function del()
 {
     $this->checksafeauth();
     $id = strtolower($_GET['id']);
     if (empty($id)) {
         $this->error('request error!');
     }
     if (in_array($id, array('admin', 'index', 'web', 'user'))) {
         $this->error('核心应用不可以删除!');
     }
     if (is_file('./' . $id . '.php') && is_dir('./' . ucfirst($id))) {
         @unlink('./' . $id . '.php');
         File::del_dir('./' . ucfirst($id));
     }
     $this->success('操作成功!', U('App/index'));
 }
 public function over()
 {
     //缓存路径
     $Webpath = './Web/Runtime/';
     $Adminpath = './Admin/Runtime/';
     $Userpath = './User/Runtime/';
     if (is_dir($Webpath)) {
         File::del_dir($Webpath);
     } elseif (is_dir($Adminpath)) {
         File::del_dir($Adminpath);
     } elseif (is_dir($Userpath)) {
         File::del_dir($Userpath);
     }
     //清空前台切换theme的cookie
     cookie('theme', null);
     //清理缓存的模型文件
     $list = scandir('./Web/Lib/Model');
     foreach ($list as $v) {
         if (substr($v, 0, 5) == 'addon') {
             unlink('./Web/Lib/Model/' . $v);
         }
     }
     $this->display();
 }
Example #4
0
 public function clear()
 {
     $path = './Web/Runtime';
     File::del_dir($path);
     $this->success('操作成功!', U('Wap/index'));
 }
Example #5
0
 public function clear()
 {
     //清空cookie
     cookie('theme', null);
     $path = './Web/Runtime';
     File::del_dir($path);
     $this->success('操作成功!', U('Tpl/index'));
 }
 public function del()
 {
     $nowdir = isset($_GET['dir']) ? urldecode($_GET['dir']) : '';
     if (empty($nowdir)) {
         $this->error('参数不正确!');
     }
     $file = '.' . $nowdir;
     if (!file_exists($file)) {
         $this->error('文件不存在!');
     }
     if (is_dir($file)) {
         File::del_dir($file);
     } else {
         @unlink($file);
     }
 }
Example #7
0
 public function clear()
 {
     //缓存路径
     $Webpath = './Web/Runtime';
     $Adminpath = './Admin/Runtime';
     $Userpath = './User/Runtime';
     File::del_dir($Webpath);
     File::del_dir($Adminpath);
     File::del_dir($Userpath);
     //清空前台切换theme的cookie
     cookie('theme', null);
     //清理缓存的模型文件
     $list = scandir('./Web/Lib/Model');
     foreach ($list as $v) {
         if (substr($v, 0, 5) == 'addon') {
             unlink('./Web/Lib/Model/' . $v);
         }
     }
 }
 public function del()
 {
     //安全验证
     $this->checksafeauth();
     $map['title'] = $this->_get('title', false);
     $model = M('plugin');
     if ($model->where($map)->find()) {
         $this->error('请先卸载当前插件!');
     }
     $path = './Public/Plugin/' . $map['title'];
     File::del_dir($path);
     $this->success('操作成功!', U('PluginManage/index'));
 }
Example #9
0
     $phpv = PHP_VERSION;
     $sp_os = PHP_OS;
     $sp_gd = gdversion();
     $sp_server = $_SERVER['SERVER_SOFTWARE'];
     $sp_host = empty($_SERVER['REMOTE_ADDR']) ? $_SERVER['REMOTE_HOST'] : $_SERVER['REMOTE_ADDR'];
     $sp_name = $_SERVER['SERVER_NAME'];
     $sp_max_execution_time = ini_get('max_execution_time');
     $sp_allow_reference = ini_get('allow_call_time_pass_reference') ? '<font color=green>[√]On</font>' : '<font color=red>[×]Off</font>';
     $sp_allow_url_fopen = ini_get('allow_url_fopen') ? '<font color=green>[√]On</font>' : '<font color=red>[×]Off</font>';
     $sp_safe_mode = ini_get('safe_mode') ? '<font color=red>[×]On</font>' : '<font color=green>[√]Off</font>';
     $sp_gd = $sp_gd > 0 ? '<font color=green>[√]On</font>' : '<font color=red>[×]Off</font>';
     $sp_mysql = function_exists('mysql_connect') ? '<font color=green>[√]On</font>' : '<font color=red>[×]Off</font>';
     $sp_PclZip = PclZip_test() ? '<font color=green>[√]On</font>' : '<font color=red>[×]Off</font>';
     $sp_fopen_url = fopen_url_test() ? '<font color=green>[√]On</font>' : '<font color=red>[×]Off</font>';
     @unlink('data.zip');
     File::del_dir('./_data');
     if ($sp_mysql == '<font color=red>[×]Off</font>') {
         $sp_mysql_err = TRUE;
     } else {
         $sp_mysql_err = FALSE;
     }
     $sp_testdirs = array('/', '/Core/*', '/Public/*', '/Admin/*', '/Web/*', '/User/*', '/Install/*');
     include './templates/step-2.html';
     exit;
 } elseif ($step == 3) {
     if (!empty($_SERVER['REQUEST_URI'])) {
         $scriptName = $_SERVER['REQUEST_URI'];
     } else {
         $scriptName = $_SERVER['PHP_SELF'];
     }
     $basepath = preg_replace("#\\/Install(.*)\$#i", '', $scriptName);
Example #10
0
function app_cache($cmspath)
{
    fopen_url($cmspath . '/index.php');
    fopen_url($cmspath . '/admin.php');
    fopen_url($cmspath . '/user.php');
    File::del_dir('../Web/Runtime');
    File::del_dir('../Admin/Runtime');
    File::del_dir('../User/Runtime');
}
 public function remove()
 {
     if (IS_POST) {
         /**
          *  这里需要注意的是,删除桥后      修要删除桥的所有信息  包括图片信息        包括  桥的部件  构件  构件病害   构件图    都要删除
          */
         $post = I('post.');
         $bridge = M('bridge');
         $bridge->where("bid=%d", $post['bid'])->delete();
         $result = $bridge->where("bid=%d", $post['bid'])->select();
         if ($result[0]['bid'] != null) {
             echo "Error";
             exit;
         }
         $info1 = M('info1');
         $info1->where("bid=%d", $post['bid'])->delete();
         $info2 = M('info2');
         $info2->where("bid=%d", $post['bid'])->delete();
         $goujian = M('goujian');
         $goujian->where("bid=%d", $post['bid'])->delete();
         $binghai = M('binghai');
         $binghai->where("bid=%d", $post['bid'])->delete();
         $weixiu = M('weixiu');
         $weixiu->where("bid=%d", $post['bid'])->delete();
         $pingfen = M('pingfen');
         $pingfen->where("bid=%d", $post['bid'])->delete();
         $jilu = M('jilu');
         $jilu->where("bid=%d", $post['bid'])->delete();
         $jilu2 = M('jilu2');
         $jilu2->where("bid=%d", $post['bid'])->delete();
         //删除桥文件夹  以及 里面所有的文件       使用文件类库删除目录
         $url = "C:/wamp/www/Qiao/Application/Home/View/Public/img/" . md5($_SESSION['username'] . $post['bid']);
         import("Org.File.File");
         \File::del_dir($url);
         //          函数删除文件目录
         //     		$url="C:/wamp/www/Qiao/Application/Home/View/Public/img/".md5($_SESSION['username'].$post['bid']);
         //     		$this->delDirAndFile($url,true);
     } else {
         $this->error('非法操作');
     }
 }