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


PHP SaeStorage::delete方法代码示例

本文整理汇总了PHP中SaeStorage::delete方法的典型用法代码示例。如果您正苦于以下问题:PHP SaeStorage::delete方法的具体用法?PHP SaeStorage::delete怎么用?PHP SaeStorage::delete使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在SaeStorage的用法示例。


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

示例1: Storage_Del

/**
 * @param $upload
 */
function Storage_Del(&$upload)
{
    global $zbp, $domainname;
    $s = new SaeStorage();
    $url = $s->delete($domainname, $upload->Metas->Storage_URL);
    $GLOBALS['Filter_Plugin_Upload_DelFile']['Storage_Del'] = PLUGIN_EXITSIGNAL_RETURN;
}
开发者ID:ijustyce,项目名称:zblogphp,代码行数:10,代码来源:include.php

示例2: SaeStorage

 function is_storage_ok()
 {
     $s = new SaeStorage();
     $status = $s->write('public', '.dilicms_install_test', '');
     $status and $s->delete('public', '.dilicms_install_test');
     return $status;
 }
开发者ID:leamiko,项目名称:DiliCMS,代码行数:7,代码来源:install_helper.php

示例3: SaeStorageDelete

function SaeStorageDelete($FilePath)
{
    $storage = new SaeStorage();
    $domain = Sae_Storage_Domain_Name;
    $result = $storage->delete($domain, $FilePath);
    return $result;
}
开发者ID:ribunkou,项目名称:MyPHP,代码行数:7,代码来源:SaeStorage.php

示例4: SaeStorage

 function s_delete($filepath)
 {
     $_s = new SaeStorage();
     //初始化Storage对象
     $_f = _s_get_path($filepath);
     return $_s->delete($_f['domain'], $_f['filename']);
 }
开发者ID:dlpc,项目名称:we_three,代码行数:7,代码来源:storage_helper.php

示例5: delete_mp3

function delete_mp3($fileName)
{
    $stor = new SaeStorage();
    $stor->delete(SAE_DOMAIN, $fileName);
    if ($errmsg == 0) {
        $result['success'] = 1;
    } else {
        $result['success'] = -1;
    }
    return $result;
}
开发者ID:surperone,项目名称:mp3dish,代码行数:11,代码来源:common_sae.php

示例6: Delete

 public function Delete($fileName)
 {
     $res = array('result' => false, 'reason' => '');
     $file_path = SAE_MODULES . '/' . $fileName;
     $s = new SaeStorage();
     if ($s->fileExists(SAE_STORAGE_DOMAIN, $file_path)) {
         if ($s->delete(SAE_STORAGE_DOMAIN, $file_path)) {
             $res['result'] = true;
             $res['reason'] = $fileName;
         } else {
             $res['reason'] = $this->messages['6'];
         }
     } else {
         $res['reason'] = $this->messages['4'];
     }
 }
开发者ID:mitv1c,项目名称:XssRat,代码行数:16,代码来源:UploadHandler.php

示例7: delete

 function delete()
 {
     if (!$this->has_privilege()) {
         $this->json->output(array('success' => false, 'm' => '您没有使用该功能的权限'));
     }
     $fileid = $this->input->get('fileid');
     if (!$this->utility->chk_id($fileid)) {
         $this->json->output(array('success' => false, 'm' => '输入的记录编号错误'));
     }
     $file = $this->Proj_model->get_upload_by_id($fileid);
     if (!empty($file)) {
         $s = new SaeStorage(SAE_ACCESSKEY, SAE_SECRETKEY);
         if ($s->delete('upload', $file[0]->filename)) {
             // remove from upload table
             $this->Proj_model->delete_upload($fileid);
             $this->json->output(array('success' => true));
         }
     }
     $this->json->output(array('success' => false));
 }
开发者ID:revlis7,项目名称:pp,代码行数:20,代码来源:upload.php

示例8: file_delete

/**
 * 文件删除
 * @param string $filename  文件名
 * @return boolean     
 */
function file_delete($filename, $type = '')
{
    switch (STORAGE_TYPE) {
        case 'Sae':
            $arr = explode('/', ltrim($filename, './'));
            $domain = array_shift($arr);
            $filePath = implode('/', $arr);
            $s = new SaeStorage();
            return $s->delete($domain, $filePath);
            break;
        default:
            return \Think\Storage::unlink($filename, $type);
    }
}
开发者ID:huangxulei,项目名称:app,代码行数:19,代码来源:function.php

示例9: SaeStorage

             echo '保存错误,请确保每项都不为空';
         } else {
             $config = "<?php\n\$key0='{$adminpass}';//管理员密码\n\n\$pagesize='15';//文件列表每页显示多少个文件,必须为整数\n\n\$Storage = 'udisk';//Storage名称\n\n\$openapi = 1;//是否开启API上传\n\n/*数据库信息*/\n\$host = '{$hosti}'; //数据库服务器\n\$port = {$porti}; //数据库端口\n\$user = '{$useri}'; //数据库用户名\n\$pwd = '{$pwdi}'; //数据库密码\n\$dbname = '{$dbi}'; //数据库名称\n\n?>";
             file_put_contents('config.php', $config);
             echo "保存成功!<br><a href='{$_SERVER['PHP_SELF']}?do=4'>下一步</a>";
         }
     }
 }
 if ($do == '4') {
     require 'config.php';
     if (defined("SAE_ACCESSKEY")) {
         require 'includes/sae.php';
         //SaeStorage 文件存储检测
         $storage = new SaeStorage();
         $storage->write($Storage, 'test.txt', 'ceshi') or die('开启SaeStorage失败,请检查SaeStorage设置状态以及config.php里的Storage参数');
         $storage->delete($Storage, 'test.txt');
     }
     if (!defined("SAE_ACCESSKEY") && (!$user || !$pwd || !$dbname)) {
         echo "请先填写好数据库并保存后再安装";
     } else {
         $sql = "CREATE TABLE udisk (\n" . " `id` int(11) NOT NULL auto_increment,\n" . " `filename` varchar(255) NOT NULL,\n" . " `size` varchar(14) NOT NULL,\n" . " `datetime` datetime NOT NULL,\n" . " `type` varchar(255) NOT NULL,\n" . " `fileurl` varchar(255) NOT NULL,\n" . " `ip` varchar(15) NOT NULL,\n" . " `hide` int(1) NOT NULL DEFAULT 0,\n" . " `pwd` varchar(255) NULL,\n" . " PRIMARY KEY (`id`)\n" . ") ENGINE=MyISAM DEFAULT CHARSET=utf8;";
         $cn = mysql_connect($host, $user, $pwd);
         if (!$cn) {
             die('err:' . mysql_error());
         }
         mysql_select_db($dbname, $cn) or die('err:' . mysql_error());
         mysql_query("set names utf8", $cn);
         if (mysql_query($sql)) {
             @file_put_contents("install.lock", 'install');
             echo '<font color="green">安装成功!</font><br/><a href="./">>>网站首页</a><br/><br/><font color="#FF0033">如果你的空间不支持本地文件读写,请自行建立 install.lock 文件!</font>';
         } else {
开发者ID:wujunze,项目名称:bigpan,代码行数:31,代码来源:install.php

示例10: SaeStorage

 /**
  * Delete all existing cache files
  *
  * @access	public
  * @return	bool
  */
 function delete_all()
 {
     //---change---//
     //delete_files($this->db->cachedir, TRUE);
     if ($this->db->cache_method == "storage") {
         $storage = new SaeStorage();
         $file_list = $storage->getList($this->db->cachedir);
         for ($i = 0; $i < count($file_list); $i++) {
             $storage->delete($this->db->cachedir, $file_list[$i]);
         }
         if (count($file_list) == 100) {
             delete_all();
         }
     } else {
         $mmc = memcache_init();
         if ($mmc) {
             $catalog_data = memcache_get($mmc, $this->db->cachedir);
             $catalog;
             if ($catalog_data == false) {
                 return false;
             } else {
                 $catalog = unserialize($catalog_data);
             }
             foreach ($catalog as $key => $value) {
                 memcache_delete($mmc, $key);
             }
             $catalog = array();
             memcache_set($mmc, $this->db->cachedir, serialize($catalog));
         }
     }
 }
开发者ID:ruoyousi,项目名称:MyFunds-sae,代码行数:37,代码来源:DB_cache.php

示例11: UploadToSae

 private function UploadToSae($func, $thumbImage)
 {
     //在新浪sae下
     $S = new \SaeStorage();
     $S->delete('lxpfigo', str_replace('http://atrs-lxpfigo.stor.sinaapp.com', '', $this->oldFile));
     ob_start();
     $func($thumbImage);
     $imageStr = ob_get_contents();
     $url = $S->write('lxpfigo', '/operate/' . date(Ymd) . '/' . time() . '.' . $this->imageType, $imageStr);
     ob_end_clean();
     if ($url) {
         $this->url = $url;
         return true;
     } else {
         $this->status = $this->error[5];
         return false;
     }
 }
开发者ID:lxpfigo,项目名称:blog,代码行数:18,代码来源:Image.class.php

示例12: define

 static function delete_topic($pics, $ext = 'jpg', $storage = 'temp')
 {
     define('TEMP', $storage);
     //缓存storage
     if (is_array($pics) == true) {
         $file_name = $pics['pic_name'][0];
         $ext = $pics['pic_name'][1];
     } else {
         $file_name = $pics;
     }
     $pic_big = $file_name . '_big.jpg';
     $pic_midde = $file_name . '_midde.jpg';
     $pic_small = $file_name . '_small.jpg';
     $pic_y = $file_name . "." . $ext;
     $s = new SaeStorage();
     $s->delete(TEMP, $pic_big);
     $s->delete(TEMP, $pic_midde);
     $s->delete(TEMP, $pic_small);
     if ($s->delete(TEMP, $pic_y) == false) {
         $s->delete(TEMP, $file_name . ".png");
         $s->delete(TEMP, $file_name . ".gif");
     }
     return 1;
 }
开发者ID:acsiiii,项目名称:leeeframework,代码行数:24,代码来源:img.php

示例13: upload

        }
        public function upload($dir, $newfile, $upload)
        {
            return file_exists($upload) && is_uploaded_file($upload) && @move_uploaded_file($upload, KC_LOCALDIR . $dir . '/' . $newfile);
        }
    }
}
if ($is_ok) {
    $cache = file_exists($cachefile) ? @json_decode(file_get_contents($cachefile), true) : array();
    if (empty($cache) && !is_array($cache)) {
        $cache = array();
    }
    $s = new SaeStorage();
    if (!empty($_REQUEST['del'])) {
        // 删除文件
        if ($s->delete($dir, $_REQUEST['del'])) {
            $msg = '删除成功';
            unset($cache[$_REQUEST['del']]);
            file_put_contents($cachefile, json_encode($cache));
        }
    }
    // 上传文件
    if (!empty($_POST['upload'])) {
        $time = time();
        $upload = !empty($_FILES['file']) ? $_FILES['file'] : array();
        $ext = !empty($upload['type']) ? file_ext($upload['type']) : '';
        $newfile = date('YmdHis', $time) . '-' . rand(1000, 9999) . '.' . $ext;
        $desc = !empty($_POST['desc']) ? $_POST['desc'] : '';
        $upload_errors = array(0 => '上传成功', 1 => '文件大小超过服务器限制', 2 => '文件大小超出浏览器限制', 3 => '文件上传不完整', 4 => '没有找到要上传的文件', 5 => '服务器临时文件夹丢失', 6 => '文件写入到临时文件夹出错', 7 => '上传目录不可写');
        if (empty($upload)) {
            $msg = "上传失败,请重新上传";
开发者ID:jesseky,项目名称:sae-one-page,代码行数:31,代码来源:upload.php

示例14: SaeStorage

 /**
  * Update/serve a cached file
  *
  * @access	public
  * @return	void
  */
 function _display_cache(&$CFG, &$URI)
 {
     $cache_domain = $CFG->item('cache_path');
     $cache_method = $CFG->item('cache_method');
     //---change---//
     //	if ( $cache_domain == ''){	return FALSE;}
     // Build the file path.  The file name is an MD5 hash of the full URI
     $uri = $CFG->item('base_url') . $CFG->item('index_page') . $URI->uri_string;
     $cache_file_name = md5($uri);
     $cache_file = null;
     if ($cache_method == "storage") {
         $storage = new SaeStorage();
         $cache_file = $storage->read($cache_domain, $cache_file_name);
     } else {
         if ($cache_method == "memcache") {
             $mmc = memcache_init();
             if ($mmc != FALSE) {
                 $cache_file = memcache_get($mmc, $cache_file_name);
                 if (!$cache_file) {
                     return FALSE;
                 }
             } else {
                 return FALSE;
             }
         } else {
             return FALSE;
         }
     }
     if ($cache_file == null) {
         return FALSE;
     }
     // Strip out the embedded timestamp
     if (!preg_match("/(\\d+TS--->)/", $cache_file, $match)) {
         return FALSE;
     }
     // Has the file expired? If so we'll delete it.
     if (time() >= trim(str_replace('TS--->', '', $match['1']))) {
         if ($cache_method == "storage") {
             $storage->delete($cache_domain, $cache_file_name);
         } else {
             if ($cache_method == "memcache") {
                 $mmc = memcache_init();
                 if ($mmc != FALSE) {
                     memcache_delete($mmc, $cache_file_name);
                 }
             }
         }
         log_message('debug', "Cache file has expired. File deleted");
         return FALSE;
     }
     $this->_display(str_replace($match['0'], '', $cache_file));
     log_message('debug', "Cache file is current. Sending it to browser.");
     return TRUE;
 }
开发者ID:ruoyousi,项目名称:MyFunds-sae,代码行数:60,代码来源:Output.php

示例15: implode

 $giftpicname = implode(".", $filename);
 $tmp_name = $_FILES['file']['tmp_name'];
 $q = new SaeStorage();
 $giftpicname = $_GET['uid'] . "_" . $_GET['taskid'] . "_" . $giftpicname;
 $result = $q->upload("bzlm", $giftpicname, $tmp_name);
 $giftpicurl = $q->getUrl("bzlm", $giftpicname);
 $newtask = "no";
 if (!$result) {
     echo "<script>alert('很抱歉,上传失败,请重新尝试!如重试多次仍无法上传,请在页面最下方联系我们。');location.href='my.php';</script>";
 }
 if ($_POST['submit'] == "上传图片") {
     $newtask = "yes";
     echo "<script>alert('恭喜您,上传成功!完成了任务" . $_GET['taskid'] . ",获得了" . $_GET['addmoney'] . "枚金币!');location.href='my.php';</script>";
 } else {
     $oldfilename = $_GET['oldname'];
     $r = $q->delete("bzlm", $oldfilename);
     $newtask = "no";
     echo "<script>alert('恭喜您,重新上传成功!完成了任务" . $_GET['taskid'] . ",由于非首次完成,故金币数无变化!');location.href='my.php';</script>";
 }
 //添加数据库图片地址
 include 'info.php';
 $con = mysql_connect($mysql_host . ':' . $mysql_port, $mysql_user, $mysql_password);
 if (!$con) {
     die('Could not connect: ' . mysql_error());
 }
 mysql_query("SET NAMES 'UTF8'");
 mysql_select_db($mysql_database, $con);
 $sql = "UPDATE  `app_bzlmxb`.`user` SET  `task" . $_GET['taskid'] . "` =  '" . $giftpicname . "' WHERE  `user`.`uid` =" . $_GET['uid'] . ";";
 $result = mysql_query($sql);
 //加金币
 if ($newtask == "yes") {
开发者ID:skytt,项目名称:lmxb,代码行数:31,代码来源:updata.php


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