• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP file_delete函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: fieldsFormSubmit

 public function fieldsFormSubmit($rid)
 {
     global $_W, $_GPC;
     $id = intval($_GPC['replyid']);
     $data = array('rid' => $rid, 'weid' => $_W['weid'], 'sn' => $_GPC['sn'], 'token' => $_GPC['apitoken'], 'maxuse' => intval($_GPC['maxuse']), 'maxtotal' => intval($_GPC['maxtotal']), 'adtype' => intval($_GPC['adtype']), 'adurlv' => $_GPC['adurlv'], 'adurlh' => $_GPC['adurlh'], 'admsg' => $_GPC['admsg'], 'leavemsg' => $_GPC['leavemsg'], 'fontfamily' => $_GPC['fontfamily'], 'fontcolor' => $_GPC['fontcolor'], 'qrcode' => $_GPC['qrcode'], 'mainpic' => $_GPC['mainpic'], 'adpics' => '', 'width' => $_GPC['width'], 'height' => $_GPC['height'], 'size' => intval($_GPC['photosize']), 'status' => intval($_GPC['status']), 'enableauthcode' => intval($_GPC['enableauthcode']), 'enablemsg' => intval($_GPC['enablemsg']), 'content' => $_GPC['content'], 'tipsentry' => $_GPC['tipsentry'], 'tipssuccess' => $_GPC['tipssuccess'], 'tipserror' => $_GPC['tipserror']);
     if (!empty($_GPC['sort'])) {
         asort($_GPC['sort']);
         foreach ($_GPC['sort'] as $key => $value) {
             $data['adpics'][] = $_GPC['adpics'][$key];
         }
         $data['adpics'] = iserializer($data['adpics']);
     } else {
         $data['adpics'] = iserializer($_GPC['adpics']);
     }
     if (empty($id)) {
         pdo_insert('we7_photomaker', $data);
     } else {
         if (!empty($_GPC['qrcode'])) {
             file_delete($_GPC['qrcode-old']);
         }
         if (!empty($_GPC['mainpic'])) {
             file_delete($_GPC['mainpic-old']);
         }
         pdo_update('we7_photomaker', $data, array('id' => $id));
     }
 }
开发者ID:alextiannus,项目名称:wormwood_wechat,代码行数:26,代码来源:module.php


示例2: doWebSetting

 public function doWebSetting()
 {
     global $_W, $_GPC;
     checklogin();
     load()->func('tpl');
     $item = pdo_fetch("SELECT * FROM " . tablename($this->modulename . '_setting') . " WHERE weid = :weid", array(':weid' => $_W['uniacid']));
     if (!empty($item)) {
         if (!empty($item['share_image'])) {
             $share_image = tomedia($item['share_image']);
         }
     }
     if (checksubmit('submit')) {
         $data = array('weid' => $_W['weid'], 'share_title' => trim($_GPC['share_title']), 'share_desc' => trim($_GPC['share_desc']), 'share_cancel' => trim($_GPC['share_cancel']), 'share_url' => trim($_GPC['share_url']), 'follow_url' => trim($_GPC['follow_url']));
         if (!empty($_GPC['share_image'])) {
             $data['share_image'] = $_GPC['share_image'];
             load()->func('file');
             file_delete($_GPC['share_image-old']);
         }
         if (!empty($item)) {
             pdo_update($this->modulename . '_setting', $data, array('weid' => $_W['uniacid']));
         } else {
             pdo_insert($this->modulename . '_setting', $data);
         }
         message('更新成功!', $this->createWebUrl('setting'), 'success');
     }
     include $this->template('setting');
 }
开发者ID:keycoolkui,项目名称:weixinfenxiao,代码行数:27,代码来源:site.php


示例3: doWebList

 public function doWebList($ischeck = 1)
 {
     global $_GPC, $_W;
     // AJAX
     if ($_W['isajax']) {
         $op = $_GPC['op'];
         $id = intval($_GPC['id']);
         $result = array('state' => -1, 'message' => '');
         if ($op == 'delete') {
             $item = $this->item_fetch($id);
             if ($item['id']) {
                 load()->func('file');
                 file_delete($item['photo']);
                 pdo_delete('qiyue_canvas', array('id' => $item['id']));
                 $result['state'] = 0;
             }
         } elseif ($op == 'check') {
             if ($this->item_check($id)) {
                 $result['state'] = 0;
             }
         }
         message($result, '', 'ajax');
     }
     $title = '图片管理';
     $result = $this->all_list(array('ischeck' => $ischeck));
     include $this->template('manage');
 }
开发者ID:keycoolkui,项目名称:weixinfenxiao,代码行数:27,代码来源:site.php


示例4: addStreamFormSubmit

 function addStreamFormSubmit($form_id, $form_values)
 {
     module_load_include('inc', 'Fedora_Repository', 'api/fedora_utils');
     module_load_include('inc', 'Fedora_Repository', 'api/fedora_item');
     module_load_include('php', 'Fedora_Repository', 'ObjectHelper');
     $types = array('application/vnd.openxmlformats-officedocument.wordprocessingml.document', 'application/vnd.wordperfect', 'application/wordperfect', 'application/vnd.oasis.opendocument.text', 'text/rtf', 'application/rtf', 'application/msword', 'application/vnd.ms-powerpoint', 'application/pdf');
     global $user;
     /* TODO Modify the validators array to suit your needs.
        This array is used in the revised file_save_upload */
     $fileObject = file_save_upload('file_uploaded');
     if (!in_array($fileObject->filemime, $types)) {
         drupal_set_message(t('The detected mimetype %s is not supported', array('%s' => $fileObject->filemime)), 'error');
         return false;
     }
     file_move($fileObject->filepath, 0, 'FILE_EXISTS_RENAME');
     $objectHelper = new ObjectHelper();
     $pid = $form_values['pid'];
     $fedora_item = new Fedora_Item($pid);
     $test = NULL;
     $test = $fedora_item->add_datastream_from_file($fileObject->filepath, 'OBJ');
     if ($test) {
         $this->updateMODSStream($form_values['pid'], $form_values['version'], $form_values['usage']);
     }
     file_delete($fileObject->filepath);
     return true;
 }
开发者ID:roblib,项目名称:islandora_scholar_upei,代码行数:26,代码来源:IrClass.php


示例5: settingsDisplay

 public function settingsDisplay($settings)
 {
     global $_W, $_GPC;
     load()->func('file');
     $_W['page']['title'] = '签文参数设置';
     if ($_W['isajax'] && $_GPC['op'] == 'delete' && $_GPC['filename']) {
         file_delete($_GPC['filename']);
         exit('ok');
     }
     if (checksubmit()) {
         // 配置
         $dat = $_GPC['add'];
         $dat['imgUrl'] = $_GPC['imgUrl'];
         $this->saveSettings($dat);
         // 签文
         $qian = $_GPC['qian'];
         $f_exp = "::::::";
         $r_exp = PHP_EOL;
         $morepic = "";
         for ($i = 0; $i < count($qian['filename']); $i++) {
             //替换非法字符
             $name = str_replace($f_exp, "", $qian['title'][$i]);
             $name = str_replace($r_exp, "", $name);
             $pic = str_replace($f_exp, "", $qian['filename'][$i]);
             $pic = str_replace($r_exp, "", $pic);
             if ($pic) {
                 $morepic .= $pic . $f_exp . $name . $r_exp;
             }
         }
         // 去掉最后的字符
         // $morepic = substr($morepic,0,strlen($morepic)-2);
         $morepic = trim($morepic);
         $check = pdo_fetchcolumn("SELECT COUNT(*) FROM " . tablename('qiyue_qiuqian') . " WHERE uniacid=:uniacid", array(':uniacid' => $_W['uniacid']));
         if ($check) {
             pdo_update('qiyue_qiuqian', array('morepic' => $morepic), array('uniacid' => $_W['uniacid']));
         } else {
             $add['uniacid'] = $_W['uniacid'];
             $add['morepic'] = $morepic;
             pdo_insert('qiyue_qiuqian', $add);
         }
         message('设置成功', 'referer', 'success');
     }
     if (empty($settings)) {
         $settings = array('title' => '新年祈福签', 'desc' => '我在' . $_W['account']['name'] . '求了一支新年签,你也来吧!', 'imgUrl' => tomedia('./addons/qiuqian/icon.jpg'));
     }
     $qian_r = pdo_fetch("SELECT * FROM " . tablename('qiyue_qiuqian') . " WHERE uniacid=:uniacid", array(':uniacid' => $_W['uniacid']));
     $morepic = array();
     if ($qian_r['morepic']) {
         $f_exp = "::::::";
         $r_exp = PHP_EOL;
         $rr = explode($r_exp, $qian_r['morepic']);
         for ($i = 0; $i < count($rr); $i++) {
             $fr = explode($f_exp, $rr[$i]);
             $morepic[] = array('title' => $fr['1'], 'filename' => $fr['0']);
         }
         unset($qian_r['morepic']);
     }
     include $this->template('setting');
 }
开发者ID:aspnmy,项目名称:weizan,代码行数:59,代码来源:module.php


示例6: delete

 public function delete($filename)
 {
     if (file_delete('./Public/upload/' . $filename) && file_delete('./Public/upload/thumb_' . $filename)) {
         $this->success('删除成功');
     } else {
         $this->error('删除失败');
     }
 }
开发者ID:szwork2013,项目名称:distribution,代码行数:8,代码来源:IndexAction.class.php


示例7: submitForm

 function submitForm(array &$form, FormStateInterface $form_state)
 {
     $result = ManageStorage::fetchRowFields('id', $this->id, array('fid'));
     file_delete($result['fid']);
     ManageStorage::delete($this->id);
     drupal_set_message('CSV deleted successfully.');
     $form_state->setRedirect('node_csv_uploader.admin');
 }
开发者ID:mehulmakwana97,项目名称:Drupal-Module,代码行数:8,代码来源:DeleteCSVForm.php


示例8: removeFile

 private static function removeFile($imageFileId, $moduleName, $fieldName)
 {
     $file = $imageFileId ? file_load($imageFileId) : FALSE;
     if ($file) {
         file_usage_delete($file, $moduleName, $fieldName, $file->fid);
         file_delete($file);
     }
     return $file;
 }
开发者ID:poupouxios,项目名称:drupal-resume,代码行数:9,代码来源:ImageHelper.php


示例9: removePicture

function removePicture($FID, $moduleName)
{
    $f = file_load($FID);
    if ($f != null) {
        file_usage_delete($f, "CROMA - {$moduleName}");
        file_delete($f);
    } else {
        drupal_set_message('File does not exist!', 'error');
    }
}
开发者ID:ChapResearch,项目名称:CROMA,代码行数:10,代码来源:pictureFunctions.php


示例10: doMobileAjaxdelete

 public function doMobileAjaxdelete()
 {
     global $_GPC;
     $delurl = $_GPC['pic'];
     if (file_delete($delurl)) {
         echo 1;
     } else {
         echo 0;
     }
 }
开发者ID:alextiannus,项目名称:wormwood_wechat,代码行数:10,代码来源:site.php


示例11: doWebList

 public function doWebList()
 {
     global $_GPC, $_W;
     load()->func('tpl');
     $operation = !empty($_GPC['op']) ? $_GPC['op'] : 'display';
     if ($operation == 'display') {
         if (!empty($_GPC['displayorder'])) {
             foreach ($_GPC['displayorder'] as $id => $displayorder) {
                 pdo_update('meepomailattachment', array('displayorder' => $displayorder), array('id' => $id));
             }
             message('分类排序更新成功!', $this->createWebUrl('List', array('op' => 'display')), 'success');
         }
         $list = pdo_fetchall("SELECT * FROM " . tablename('meepomailattachment') . " WHERE weid = '{$_W['weid']}' ORDER BY id ASC, displayorder DESC");
         include $this->template('list');
     } elseif ($operation == 'post') {
         $id = intval($_GPC['id']);
         if (!empty($id)) {
             $list = pdo_fetch("SELECT * FROM " . tablename('meepomailattachment') . " WHERE id = '{$id}'");
         } else {
             $list = array('displayorder' => 0);
         }
         if (checksubmit('submit')) {
             if (empty($_GPC['attachmentname']) || empty($_GPC['description'])) {
                 message('文件名称以及文件描述是必填项!', $this->createWebUrl('list'), 'error');
             }
             $data = array('weid' => $_W['weid'], 'attachmentname' => $_GPC['attachmentname'], 'isshow' => intval($_GPC['isshow']), 'displayorder' => intval($_GPC['displayorder']), 'description' => $_GPC['description']);
             if (!empty($_FILES['thumb']['tmp_name'])) {
                 load()->func('file');
                 file_delete($_GPC['thumb_old']);
                 $upload = $this->file_upload($data['attachmentname'], $_FILES['thumb']);
                 if (is_error($upload)) {
                     message($upload['message'], '', 'error');
                 }
                 $data['thumb'] = $upload['path'];
             }
             if (!empty($id)) {
                 unset($data['id']);
                 pdo_update('meepomailattachment', $data, array('id' => $id));
             } else {
                 pdo_insert('meepomailattachment', $data);
                 $id = pdo_insertid();
             }
             message('更新附件成功!', $this->createWebUrl('list', array('op' => 'display')), 'success');
         }
         include $this->template('list');
     } elseif ($operation == 'delete') {
         $id = intval($_GPC['id']);
         $category = pdo_fetch("SELECT id FROM " . tablename('meepomailattachment') . " WHERE id = '{$id}'");
         if (empty($category)) {
             message('抱歉,附件不存在或是已经被删除!', $this->createWebUrl('list', array('op' => 'display')), 'error');
         }
         pdo_delete('meepomailattachment', array('id' => $id), 'OR');
         message('附件信息删除成功!', $this->createWebUrl('list', array('op' => 'display')), 'success');
     }
 }
开发者ID:eduNeusoft,项目名称:weixin,代码行数:55,代码来源:site.php


示例12: mc_issue_attachment_delete

/**
 * Delete an issue attachment given its id.
 *
 * @param string $p_username  The name of the user trying to add an attachment to an issue.
 * @param string $p_password  The password of the user.
 * @param integer $p_issue_attachment_id  The id of the attachment to be deleted.
 * @return true: success, false: failure
 */
function mc_issue_attachment_delete( $p_username, $p_password, $p_issue_attachment_id ) {
	$t_user_id = mci_check_login( $p_username, $p_password );
	if( $t_user_id === false ) {
		return mci_soap_fault_login_failed();
	}
	$t_bug_id = file_get_field( $p_issue_attachment_id, 'bug_id' );
	if( !access_has_bug_level( config_get( 'update_bug_threshold' ), $t_bug_id, $t_user_id ) ) {
		return mci_soap_fault_access_denied( $t_user_id );
	}
	return file_delete( $p_issue_attachment_id, 'bug' );
}
开发者ID:rombert,项目名称:mantisbt,代码行数:19,代码来源:mc_issue_attachment_api.php


示例13: index

 public function index($debug = '')
 {
     if ($debug) {
         file_delete(UPLOAD_PATH . 'install.lock');
     }
     $status = array('status' => 1, 'url' => U('Index/step1'));
     if (file_exist(UPLOAD_PATH . 'install.lock')) {
         $status = array('status' => 0, 'url' => U('/'), 'msg' => '已经成功安装了,请不要重复安装!');
     }
     $this->assign('status', $status);
     $this->display();
 }
开发者ID:easytp,项目名称:easytp,代码行数:12,代码来源:IndexController.class.php


示例14: mc_project_attachment_delete

/**
 * Delete a project attachment given its id.
 *
 * @param string $p_username  The name of the user trying to add an attachment to an issue.
 * @param string $p_password  The password of the user.
 * @param integer $p_project_attachment_id  The id of the attachment to be deleted.
 * @return true: success, false: failure
 */
function mc_project_attachment_delete($p_username, $p_password, $p_project_attachment_id)
{
    $t_user_id = mci_check_login($p_username, $p_password);
    if ($t_user_id === false) {
        return new soap_fault('Client', '', 'Access Denied');
    }
    $t_project_id = file_get_field($p_project_attachment_id, 'project_id', 'project');
    if (!access_has_project_level(config_get('upload_project_file_threshold'), $t_project_id, $t_user_id)) {
        return new soap_fault('Client', '', 'Access Denied');
    }
    return file_delete($p_project_attachment_id, 'project');
}
开发者ID:jin255ff,项目名称:company_website,代码行数:20,代码来源:mc_project_attachment_api.php


示例15: fieldsFormSubmit

 public function fieldsFormSubmit($rid = 0)
 {
     global $_GPC, $_W;
     if (!empty($_GPC['title'])) {
         $data = array('title' => $_GPC['title'], 'description' => $_GPC['description'], 'picurl' => $_GPC['thumb-old'], 'url' => create_url('mobile/module/list', array('name' => 'shopping', 'weid' => $_W['weid'])));
         if (!empty($_GPC['thumb'])) {
             $data['picurl'] = $_GPC['thumb'];
             file_delete($_GPC['thumb-old']);
         }
         $this->saveSettings($data);
     }
     return true;
 }
开发者ID:eduNeusoft,项目名称:weixin,代码行数:13,代码来源:module.php


示例16: ruleDeleted

 public function ruleDeleted($rid = 0)
 {
     global $_W;
     $replies = pdo_fetchall("SELECT id, picture  FROM " . tablename($this->tablename) . " WHERE rid = '{$rid}'");
     $deleteid = array();
     if (!empty($replies)) {
         foreach ($replies as $index => $row) {
             file_delete($row['picture']);
             $deleteid[] = $row['id'];
         }
     }
     pdo_delete($this->tablename, "id IN ('" . implode("','", $deleteid) . "')");
 }
开发者ID:alextiannus,项目名称:wormwood_wechat,代码行数:13,代码来源:module.php


示例17: fieldsFormSubmit

 public function fieldsFormSubmit($rid = 0)
 {
     global $_GPC, $_W;
     if (!empty($_GPC['title'])) {
         $data = array('title' => $_GPC['title'], 'description' => $_GPC['description'], 'picurl' => $_GPC['thumb-old'], 'url' => $this->createMoblieUrl('list', array('name' => 'eso_sale', 'uniacid' => $_W['uniacid'])));
         if (!empty($_GPC['thumb'])) {
             $data['picurl'] = $_GPC['thumb'];
             file_delete($_GPC['thumb-old']);
         }
         $this->saveSettings($data);
     }
     return true;
 }
开发者ID:aspnmy,项目名称:weizan,代码行数:13,代码来源:module.php


示例18: doWebDelete

 public function doWebDelete()
 {
     global $_GPC;
     $id = intval($_GPC['id']);
     $item = pdo_fetch("SELECT * FROM " . tablename($this->headtable) . " WHERE id = :id", array(':id' => $id));
     if (empty($item)) {
         message('抱歉,楼盘不存在或是已经删除!', '', 'error');
     }
     if (!empty($item['thumb'])) {
         file_delete($item['thumb']);
     }
     pdo_delete($this->headtable, array('id' => $item['id']));
     message('删除成功!', referer(), 'success');
 }
开发者ID:alextiannus,项目名称:wormwood_wechat,代码行数:14,代码来源:site.php


示例19: doDeleteImage

 public function doDeleteImage()
 {
     global $_GPC;
     $id = intval($_GPC['id']);
     $sql = "SELECT id, picture FROM " . tablename($this->tablename) . " WHERE `id`=:id";
     $row = pdo_fetch($sql, array(':id' => $id));
     if (empty($row)) {
         message('抱歉,回复不存在或是已经被删除!', '', 'error');
     }
     if (pdo_update($this->tablename, array('picture' => ''), array('id' => $id))) {
         file_delete($row['picture']);
     }
     message('删除图片成功!', '', 'success');
 }
开发者ID:alextiannus,项目名称:wormwood_wechat,代码行数:14,代码来源:module.php


示例20: delete

 /**
  * 删除文件
  */
 public function delete($filename)
 {
     $filename = urldecode($filename);
     $filename = ltrim($filename, '/');
     $filename = preg_replace("/\\.+/", '.', $filename);
     //屏蔽非法路径
     $filename = UPLOAD_PATH . $filename;
     if (file_exist($filename)) {
         if (file_delete($filename)) {
             $this->success('操作成功');
         }
     }
     $this->error('操作失败');
 }
开发者ID:szmas,项目名称:app,代码行数:17,代码来源:StorageController.class.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP file_delete_local函数代码示例发布时间:2022-05-15
下一篇:
PHP file_del函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap