当前位置: 首页>>代码示例>>PHP>>正文


PHP file_del函数代码示例

本文整理汇总了PHP中file_del函数的典型用法代码示例。如果您正苦于以下问题:PHP file_del函数的具体用法?PHP file_del怎么用?PHP file_del使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了file_del函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: save

 function save()
 {
     include load('include.lang');
     if (!$this->is_allow()) {
         return $this->_($L['upload_not_allow']);
     }
     $this->set_savepath($this->savepath);
     $this->set_savename($this->savename);
     if (file_copy($this->file, DT_ROOT . '/' . $this->saveto)) {
         if (!@getimagesize(DT_ROOT . '/' . $this->saveto)) {
             file_del(DT_ROOT . '/' . $this->saveto);
             return $this->_($L['upload_bad']);
         }
         if ($this->maxsize > 0 && filesize(DT_ROOT . '/' . $this->saveto) > $this->maxsize) {
             file_del(DT_ROOT . '/' . $this->saveto);
             return $this->_($L['upload_size_limit'] . ' (' . intval($this->maxsize / 1024) . 'Kb)');
         }
         $this->image = 1;
         return true;
     } else {
         return $this->_($L['upload_failed']);
     }
 }
开发者ID:hcd2008,项目名称:destoon,代码行数:23,代码来源:remote.class.php

示例2: cache_clear

function cache_clear($str, $type = '', $dir = '')
{
    $dir = $dir ? DT_CACHE . '/' . $dir . '/' : DT_CACHE . '/';
    $files = glob($dir . '*');
    if (is_array($files)) {
        if ($type == 'dir') {
            foreach ($files as $file) {
                if (is_dir($file)) {
                    dir_delete($file);
                } else {
                    if (file_ext($file) == $str) {
                        file_del($file);
                    }
                }
            }
        } else {
            foreach ($files as $file) {
                if (!is_dir($file) && strpos(basename($file), $str) !== false) {
                    file_del($file);
                }
            }
        }
    }
}
开发者ID:oneoneplus,项目名称:webshell,代码行数:24,代码来源:global.func.php

示例3: defined

<?php

defined('IN_DESTOON') or exit('Access Denied');
if (!$MOD['sitemaps']) {
    file_del(DT_ROOT . '/sitemaps.xml');
    return false;
}
$today = timetodate($DT_TIME, 3);
$mods = explode(',', $MOD['sitemaps_module']);
$nums = intval($MOD['sitemaps_items'] / count($mods));
$data = '<?xml version="1.0" encoding="UTF-8"?>';
$data .= '<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">';
$data .= '<url>';
$data .= '<loc>' . DT_PATH . '</loc>';
$data .= '<lastmod>' . $today . '</lastmod>';
$data .= '<changefreq>always</changefreq>';
$data .= '<priority>1.0</priority>';
$data .= '<data><display></display></data>';
$data .= '</url>';
$item = '';
foreach ($mods as $mid) {
    if (isset($MODULE[$mid]) && !$MODULE[$mid]['islink'] && !$MODULE[$mid]['domain']) {
        if ($mid == 4 && $CFG['com_domain']) {
            continue;
        }
        $url = $MODULE[$mid]['linkurl'];
        $data .= '<url>';
        $data .= '<loc>' . $url . '</loc>';
        $data .= '<lastmod>' . $today . '</lastmod>';
        $data .= '<changefreq>hourly</changefreq>';
        $data .= '<priority>0.9</priority>';
开发者ID:hiproz,项目名称:zhaotaoci.cc,代码行数:31,代码来源:sitemaps.htm.php

示例4: substr

 $ext = substr($word, -3);
 $file = '';
 $type = 'text';
 if ($str == 'http' && in_array($ext, array('jpg', 'amr', 'mp3', 'mp4'))) {
     if (strpos($word, DT_PATH) === 0) {
         $file = str_replace(DT_PATH, DT_ROOT . '/', $word);
     } else {
         if ($DT['remote_url'] && strpos($word, $DT['remote_url']) === 0) {
             $file = DT_ROOT . '/file/temp/' . date('YmdHis', $DT_TIME) . mt_rand(10, 99) . $_userid . '.' . $ext;
             file_copy($word, $file);
         }
     }
     if (strpos($file, '/file/') !== false && strpos($file, '..') === false && is_file($file)) {
         $arr = $wx->http_upload($file);
         if ($arr[0]) {
             file_del($file);
             $word = $arr[0];
             //Media_ID
             $type = $arr[1];
         } else {
             dalert('上传失败 - ' . $arr[1], '', 'window.parent.chat_show();');
         }
     }
 }
 $arr = $wx->send($openid, $type, $word);
 if ($arr['errcode'] != 0) {
     if ($arr['errcode'] == 45015) {
         dalert('回复时间超过限制[须48小时内回复]', '', 'window.parent.chat_hide(1);');
     }
     dalert('发送失败 - ' . $arr['errmsg'] . '(errcode:' . $arr['errcode'] . ')', '', 'window.parent.chat_show();');
 }
开发者ID:hiproz,项目名称:zhaotaoci.cc,代码行数:31,代码来源:weixin.inc.php

示例5: ob_start

                        if ($typeid == 4) {
                            if (in_array(strtolower(file_ext($flash_src)), array('jpg', 'jpeg', 'png', 'gif', 'bmp'))) {
                                $typeid = 3;
                                $image_src = $flash_src;
                            }
                        }
                    }
                }
                ob_start();
                include template($template, $module);
                $data = ob_get_contents();
                ob_clean();
                file_put($filename, '<!--' . $totime . '-->' . $data);
                if ($typeid > 1) {
                    $data = 'document.write(\'' . dwrite($data) . '\');';
                    file_put(DT_ROOT . '/file/script/A' . $p['pid'] . '.js', $data);
                }
            } else {
                file_del($filename);
                if ($typeid > 1) {
                    if ($p['code']) {
                        file_put(DT_ROOT . '/file/script/A' . $p['pid'] . '.js', $p['code']);
                    } else {
                        file_del(DT_ROOT . '/file/script/A' . $p['pid'] . '.js');
                    }
                }
            }
        }
    }
}
return true;
开发者ID:hiproz,项目名称:zhaotaoci.cc,代码行数:31,代码来源:ad.htm.php

示例6: tpl

             $fields[$k]['name'] = $edit ? $_fields[$k]['name'] : '';
             $fields[$k]['value'] = $edit ? $_fields[$k]['value'] : '';
         }
         include tpl('data_config');
     }
     break;
 case 'download':
     if ($name) {
         file_down(DT_ROOT . '/file/data/' . $name . '.php');
     }
     msg();
     break;
 case 'delete':
     if ($name) {
         file_del(DT_ROOT . '/file/data/' . $name . '.php');
         file_del(DT_ROOT . '/file/data/' . $name . '.inc.php');
     }
     dmsg('删除成功', '?file=' . $file);
     break;
 case 'view':
     $data = array();
     @(include DT_ROOT . '/file/data/' . $name . '.php');
     $data = dstripslashes($data);
     extract($data);
     if ($database == 'mysql') {
         if ($db_host && $db_user && $db_name) {
             $sc = new db_mysql();
             $sc->connect($db_host, $db_user, $db_pass, $db_name, $CFG['db_expires'], $CFG['db_charset'], $CFG['pconnect']);
         } else {
             $sc =& $db;
         }
开发者ID:hcd2008,项目名称:destoon,代码行数:31,代码来源:data.inc.php

示例7: tohtml

     $moduleid = 1;
     $module = 'destoon';
     tohtml('index');
     $msgs = array('保存系统配置.................成功', '数据库连接....................成功', '创建数据库....................成功', '创建数据表....................成功', '插入初始数据.................成功', '设置管理员....................成功', '安装系统模型.................成功', '更新系统缓存.................成功', '更新模块缓存.................成功', '更新模板缓存.................成功', '生成网站密钥.................成功', '生成网站首页.................成功', '锁定安装程序.................就绪');
     $percent = '80%';
     include IN_ROOT . '/step_' . $step . '.tpl.php';
     break;
 case '6':
     //安装成功
     $percent = '100%';
     include IN_ROOT . '/step_' . $step . '.tpl.php';
     $DT_TIME = time();
     file_put(DT_CACHE . '/install.lock', $DT_TIME);
     $index = file_get(DT_ROOT . '/index.html');
     if (strpos($index, 'install/') !== false) {
         file_del(DT_ROOT . '/index.html');
     }
     file_put(DT_ROOT . '/install/index.php', '<script type="text/javascript">window.location="../?success="+Math.random();</script>');
     break;
 case 'db_test':
     if (!mysql_connect($tdb_host, $tdb_user, $tdb_pass)) {
         exit('<script>alert("无法连接到数据库服务器,请检查配置");</script>');
     }
     if (!mysql_select_db($tdb_name)) {
         if (!mysql_query("CREATE DATABASE {$tdb_name}")) {
             exit('<script>alert("指定的数据库不存在\\n\\n系统尝试创建失败,请通过其他方式建立数据库");</script>');
         }
         mysql_select_db($tdb_name);
     }
     $tables = array();
     $query = mysql_list_tables($tdb_name);
开发者ID:hcd2008,项目名称:destoon,代码行数:31,代码来源:index.php

示例8: dftp

     $ftp = new dftp($DT['ftp_host'], $DT['ftp_user'], $DT['ftp_pass'], $DT['ftp_port'], $DT['ftp_path'], $DT['ftp_pasv'], $DT['ftp_ssl']);
     if ($ftp->connected) {
         $exp = explode("file/upload/", $saveto);
         $remote = $exp[1];
         if ($ftp->dftp_put($do->saveto, $remote)) {
             $saveto = $DT['remote_url'] . $remote;
             $DT['ftp_save'] or file_del(DT_ROOT . '/' . $do->saveto);
             if (strpos($do->saveto, '.thumb.') !== false) {
                 $local = str_replace('.thumb.' . $do->ext, '', $do->saveto);
                 $remote = str_replace('.thumb.' . $do->ext, '', $exp[1]);
                 $ftp->dftp_put($local, $remote);
                 $DT['ftp_save'] or file_del(DT_ROOT . '/' . $local);
                 $local = str_replace('.thumb.' . $do->ext, '.middle.' . $do->ext, $do->saveto);
                 $remote = str_replace('.thumb.' . $do->ext, '.middle.' . $do->ext, $exp[1]);
                 $ftp->dftp_put($local, $remote);
                 $DT['ftp_save'] or file_del(DT_ROOT . '/' . $local);
             }
         }
     }
 }
 $fid = isset($fid) ? $fid : '';
 if (isset($old) && $old && in_array($from, array('thumb', 'photo'))) {
     delete_upload($old, $_userid);
 }
 $_saveto = $swfupload ? str_replace('.thumb.' . $do->ext, '', $saveto) : $saveto;
 $_SESSION['uploads'][] = $_saveto;
 if ($DT['uploadlog']) {
     $db->query("INSERT INTO {$upload_table} (item,fileurl,filesize,fileext,upfrom,width,height,moduleid,username,ip,addtime,itemid) VALUES ('" . md5($saveto) . "','{$saveto}','{$do->file_size}','{$do->ext}','{$from}','{$img_w}','{$img_h}','{$moduleid}','{$_username}','{$DT_IP}','{$do->uptime}','{$itemid}')");
 }
 if ($MG['uploadcredit'] > 0) {
     require DT_ROOT . '/include/module.func.php';
开发者ID:hiproz,项目名称:zhaotaoci.cc,代码行数:31,代码来源:upload.php

示例9: array

            $tmp = array();
            foreach (explode('&', $par) as $v) {
                $t = explode('=', $v);
                $tmp[$t[0]] = $t[1];
            }
            $tmp['pic'] = '@' . $pic;
            $par = $tmp;
        }
    }
    $cur = curl_init('https://graph.qq.com/t/' . ($pic ? 'add_pic_t ' : 'add_t'));
    curl_setopt($cur, CURLOPT_POST, 1);
    curl_setopt($cur, CURLOPT_POSTFIELDS, $par);
    curl_setopt($cur, CURLOPT_FOLLOWLOCATION, 1);
    curl_setopt($cur, CURLOPT_HEADER, 0);
    curl_setopt($cur, CURLOPT_SSL_VERIFYPEER, 0);
    curl_setopt($cur, CURLOPT_RETURNTRANSFER, 1);
    if ($headers) {
        curl_setopt($cur, CURLOPT_HTTPHEADER, $headers);
    }
    $rec = curl_exec($cur);
    curl_close($cur);
    if ($pic && strpos($pic, 'file/temp') !== false) {
        file_del($pic);
    }
    #log_write($rec, 'qq', 1);
    if (strpos($rec, '<msg>ok</msg>') === false) {
        //fail
    } else {
        //success
    }
}
开发者ID:hiproz,项目名称:zhaotaoci.cc,代码行数:31,代码来源:post.php

示例10: is_array

     $itemids = is_array($itemid) ? implode(',', $itemid) : $itemid;
     $db->query("DELETE FROM {$DT_PRE}banip WHERE itemid IN ({$itemids})");
     dmsg('删除成功', '?file=' . $file);
     break;
 case 'clear':
     $db->query("DELETE FROM {$DT_PRE}banip WHERE totime>0 and totime<{$DT_TIME}");
     dmsg('清空成功', '?file=' . $file);
     break;
 case 'unban':
     $ip or msg('IP不能为空');
     if (is_array($ip)) {
         foreach ($ip as $v) {
             file_del(DT_CACHE . '/ban/' . $v . '.php');
         }
     } else {
         file_del(DT_CACHE . '/ban/' . $ip . '.php');
     }
     dmsg('删除成功', '?file=' . $file . '&action=ban');
     break;
 case 'ban':
     $ips = glob(DT_CACHE . '/ban/*.php');
     $lists = array();
     if ($ips) {
         foreach ($ips as $k => $v) {
             $lists[$k]['ip'] = basename($v, '.php');
             $lists[$k]['addtime'] = timetodate(filemtime($v), 5);
         }
     }
     include tpl('banip_ban');
     break;
 default:
开发者ID:hiproz,项目名称:zhaotaoci.cc,代码行数:31,代码来源:banip.inc.php

示例11: getimagesize

$w2 = $s2[0];
$h2 = $s2[1];
$s3 = getimagesize($img[3]);
$w3 = $s3[0];
$h3 = $s3[1];
if ($s1 && $s2 && $s3 && $w1 == 128 && $h1 == 128 && $w2 == 48 && $h2 == 48 && $w3 == 20 && $h3 == 20) {
    $md5 = md5($user['username']);
    $dir = DT_ROOT . '/file/avatar/' . substr($md5, 0, 2) . '/' . substr($md5, 2, 2) . '/_' . $user['username'];
    $img[4] = $dir . '.jpg';
    $img[5] = $dir . 'x48.jpg';
    $img[6] = $dir . 'x20.jpg';
    file_put($img[4], base64_decode($pic1));
    file_put($img[5], base64_decode($pic2));
    file_put($img[6], base64_decode($pic3));
    if ($DT['ftp_remote'] && $DT['remote_url']) {
        require DT_ROOT . '/include/ftp.class.php';
        $ftp = new dftp($DT['ftp_host'], $DT['ftp_user'], $DT['ftp_pass'], $DT['ftp_port'], $DT['ftp_path'], $DT['ftp_pasv'], $DT['ftp_ssl']);
        if ($ftp->connected) {
            foreach ($img as $i) {
                $t = explode("/file/", $i);
                $ftp->dftp_put('file/' . $t[1], $t[1]);
            }
        }
    }
    echo '{"status":1}';
} else {
    file_del($img[1]);
    file_del($img[2]);
    file_del($img[3]);
    exit('{"status":3}');
}
开发者ID:hiproz,项目名称:zhaotaoci.cc,代码行数:31,代码来源:upload.php

示例12: dmsg

     }
     dmsg('备份文件恢复失败');
     break;
 case 'download':
     if (!$fileid) {
         msg('文件名不能为空');
     }
     $file_ext = $bakid ? '.' . $bakid . '.bak' : '.css';
     file_down($skin_root . $fileid . $file_ext);
     break;
 case 'delete':
     if (!$fileid) {
         msg('文件名不能为空');
     }
     $file_ext = $bakid ? '.' . $bakid . '.bak' : '.css';
     file_del($skin_root . $fileid . $file_ext);
     dmsg('文件删除成功', $this_forward);
     break;
 default:
     $files = $skins = $baks = array();
     $files = glob($skin_root . '*.*');
     if (!$files) {
         msg('风格文件不存在,请先创建', "?file={$file}&action=add");
     }
     foreach ($files as $k => $v) {
         $filename = str_replace($skin_root, '', $v);
         if (preg_match("/^[0-9a-z_-]+\\.css\$/", $filename)) {
             $fileid = str_replace('.css', '', $filename);
             $skins[$fileid]['fileid'] = $fileid;
             $skins[$fileid]['filename'] = $filename;
             $skins[$fileid]['filesize'] = round(filesize($v) / 1024, 2);
开发者ID:hiproz,项目名称:zhaotaoci.cc,代码行数:31,代码来源:skin.inc.php

示例13: delete_upload

function delete_upload($file, $userid)
{
    global $CFG, $DT, $DT_TIME, $ftp, $db;
    if (!defined('DT_ADMIN') && (!$userid || $userid != match_userid($file))) {
        return false;
    }
    $fileurl = $file;
    if (strpos($file, 'file/upload') === false) {
        //Remote
        if ($DT['ftp_remote'] && $DT['remote_url']) {
            if (strpos($file, $DT['remote_url']) !== false) {
                if (!is_object($ftp)) {
                    require_once DT_ROOT . '/include/ftp.class.php';
                    $ftp = new dftp($DT['ftp_host'], $DT['ftp_user'], $DT['ftp_pass'], $DT['ftp_port'], $DT['ftp_path'], $DT['ftp_pasv'], $DT['ftp_ssl']);
                }
                $file = str_replace($DT['remote_url'], '', $file);
                $ftp->dftp_delete($file);
                if (strpos($file, '.thumb.') !== false) {
                    $ext = file_ext($file);
                    $F = str_replace('.thumb.' . $ext, '', $file);
                    $ftp->dftp_delete($F);
                    $F = str_replace('.thumb.' . $ext, '.middle.' . $ext, $file);
                    $ftp->dftp_delete($F);
                }
            }
        }
    } else {
        $exp = explode("file/upload/", $file);
        $file = DT_ROOT . '/file/upload/' . $exp[1];
        if (is_file($file) && strpos($exp[1], '..') === false) {
            file_del($file);
            if (strpos($file, '.thumb.') !== false) {
                $ext = file_ext($file);
                file_del(str_replace('.thumb.' . $ext, '', $file));
                file_del(str_replace('.thumb.' . $ext, '.middle.' . $ext, $file));
            }
        }
    }
    if ($DT['uploadlog']) {
        $db->query("DELETE FROM {$db->pre}upload_" . $userid % 10 . " WHERE item='" . md5($fileurl) . "'");
    }
}
开发者ID:hcd2008,项目名称:destoon,代码行数:42,代码来源:post.func.php

示例14: Copyright

<?php

/*
	[Destoon B2B System] Copyright (c) 2008-2013 Destoon.COM
	This is NOT a freeware, use is subject to license.txt
*/
defined('IN_DESTOON') or exit('Access Denied');
$menus = array(array('木马扫描', '?file=scan'), array('文件校验', '?file=' . $file));
$sys = array('admin', 'api', 'include', 'javascript', 'lang', 'module', 'template', 'wap');
$fbs = array('file', 'cache');
switch ($action) {
    case 'delete':
        preg_match("/^[0-9]{4}[\\-]{1}[0-9]{2}[\\-]{1}[0-9]{2}[\\s]{1}[0-9]{2}[\\.]{1}[0-9]{2}\$/", $mirror) or msg('请选择镜像文件');
        file_del(DT_ROOT . '/file/md5/' . $mirror . '.php');
        dmsg('删除成功', '?file=' . $file);
        break;
    case 'add':
        $filedir or $filedir = $sys;
        $fileext or $fileext = 'php|js|htm';
        $files = array();
        foreach (glob(DT_ROOT . '/*.*') as $f) {
            if (preg_match("/(config\\.inc\\.php|version\\.inc\\.php)\$/i", $f)) {
                continue;
            }
            if (preg_match("/\\.({$fileext})\$/i", $f)) {
                $files[] = $f;
            }
        }
        foreach ($filedir as $d) {
            $files = array_merge($files, get_file(DT_ROOT . '/' . $d, $fileext));
        }
开发者ID:hcd2008,项目名称:destoon,代码行数:31,代码来源:md5.inc.php

示例15: exit

 case 'template_name':
     $fileid or exit('0');
     $name or exit('0');
     $name = convert($name, 'UTF-8', DT_CHARSET);
     template_name($fileid, $name);
     exit('1');
     break;
 case 'download':
     $fileid or msg();
     $file_ext = $bakid ? '.' . $bakid . '.bak' : '.htm';
     file_down($template_root . '/' . $fileid . $file_ext);
     break;
 case 'delete':
     $fileid or msg();
     $file_ext = $bakid ? '.' . $bakid . '.bak' : '.htm';
     file_del($template_root . '/' . $fileid . $file_ext);
     if (!$bakid) {
         template_name();
     }
     dmsg('删除成功', $this_forward);
     break;
 case 'cache':
     cache_clear('php', 'dir', 'tpl');
     dmsg('更新成功', $this_forward);
     break;
 default:
     $dirs = $files = $templates = $baks = array();
     if (substr($template_root, -1) != '/') {
         $template_root .= '/';
     }
     $files = glob($template_root . '*');
开发者ID:hcd2008,项目名称:destoon,代码行数:31,代码来源:template.inc.php


注:本文中的file_del函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。