Ejemplo n.º 1
0
 public static function write($frp)
 {
     if (!self::$config['enable']) {
         return false;
     }
     foreach ((array) self::$config['sdk'] as $vendor => $conf) {
         $fp = ltrim(iFS::fp($frp, '-iPATH'), '/');
         $client = self::yun($vendor);
         if ($client) {
             $res = $client->uploadFile($frp, $conf['Bucket'], $fp);
             $res = json_decode($res, true);
             if ($res['error']) {
                 self::$error[$vendor] = array('action' => 'write', 'code' => 0, 'state' => 'Error', 'msg' => $res['msg']);
             }
         }
     }
     if (self::$config['local']) {
         iFS::del($frp);
     }
 }
Ejemplo n.º 2
0
 public static function run()
 {
     $updateFile = iPATH . 'update.' . self::$release . '.php';
     if (iFS::ex($updateFile)) {
         require $updateFile;
         $msg = '执行升级程序<iCMS>';
         $msg .= updatePatch();
         $msg .= '升级顺利完成!<iCMS>删除升级程序!';
         iFS::del($updateFile);
     } else {
         $msg = '升级顺利完成!';
     }
     return $msg;
 }
Ejemplo n.º 3
0
 function delArticle($id, $uid = '0', $postype = '1')
 {
     $id = (int) $id;
     $id or iPHP::alert("请选择要删除的文章");
     $uid && ($sql = "and `userid`='{$uid}' and `postype`='{$postype}'");
     $art = articleTable::row($id, 'cid,pic,tags', $sql);
     iACP::CP($art['cid'], 'cd', 'alert');
     $frs = articleTable::select_filedata_indexid($id);
     for ($i = 0; $i < count($frs); $i++) {
         if ($frs[$i]) {
             $path = $frs[$i]['path'] . '/' . $frs[$i]['filename'] . '.' . $frs[$i]['ext'];
             iFS::del(iFS::fp($frs[$i]['path'], '+iPATH'));
             $msg .= $this->del_msg($path . ' 文件删除');
         }
     }
     if ($art['tags']) {
         iPHP::app('tag.class', 'static');
         $msg .= tag::del($art['tags']);
     }
     iDB::query("DELETE FROM `#iCMS@__category_map` WHERE `iid` = '{$id}' AND `appid` = '" . $this->appid . "';");
     iDB::query("DELETE FROM `#iCMS@__prop_map` WHERE `iid` = '{$id}' AND `appid` = '" . $this->appid . "' ;");
     articleTable::del_filedata($id, 'indexid');
     $msg .= $this->del_msg('相关文件数据删除');
     articleTable::del_comment($id);
     $msg .= $this->del_msg('评论数据删除');
     articleTable::del($id);
     articleTable::del_data($id);
     $msg .= $this->del_msg('文章数据删除');
     $this->categoryApp->update_count_one($art['cid'], '-');
     $msg .= $this->del_msg('栏目数据更新');
     $msg .= $this->del_msg('删除完成');
     return $msg;
 }
Ejemplo n.º 4
0
 function do_delfile()
 {
     iACP::MP('FILE.DELETE', 'alert');
     $_GET['path'] or iPHP::alert("请选择要删除的文件");
     strpos($_GET['path'], '..') !== false && iPHP::alert("文件路径中带有..");
     $hash = md5($_GET['path']);
     $FileRootPath = iFS::fp($_GET['path'], '+iPATH');
     if (iFS::del($FileRootPath)) {
         $msg = 'success:#:check:#:文件删除完成!';
         $_GET['ajax'] && iPHP::json(array('code' => 1, 'msg' => $msg));
     } else {
         $msg = 'warning:#:warning:#:找不到相关文件,文件删除失败!';
         $_GET['ajax'] && iPHP::json(array('code' => 0, 'msg' => $msg));
     }
     iPHP::dialog($msg, 'js:parent.$("#' . $hash . '").remove();');
 }