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


PHP SaeStorage::getList方法代码示例

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


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

示例1: actionImageManager

 public function actionImageManager()
 {
     $path = "data/editor/image/" . Ibos::app()->user->uid;
     $action = EnvUtil::getRequest("action");
     if ($action == "get") {
         if (!defined("SAE_TMP_PATH")) {
             $files = $this->getfiles($path);
             if (!$files) {
                 return null;
             }
             rsort($files, SORT_STRING);
             $str = "";
             foreach ($files as $file) {
                 $str .= "../../../../../../" . $file . "ue_separate_ue";
             }
             echo $str;
         } else {
             $st = new SaeStorage();
             $num = 0;
             while ($ret = $st->getList("data", $path, 100, $num)) {
                 foreach ($ret as $file) {
                     if (preg_match("/\\.(gif|jpeg|jpg|png|bmp)\$/i", $file)) {
                         echo $st->getUrl("data", $file) . "ue_separate_ue";
                     }
                     $num++;
                 }
             }
         }
     }
 }
开发者ID:AxelPanda,项目名称:ibos,代码行数:30,代码来源:EditorController.php

示例2: printTestCases

function printTestCases($pid, $OJ_DATA)
{
    if (strstr($OJ_DATA, "saestor:")) {
        // echo "<debug>$pid</debug>";
        $store = new SaeStorage();
        $ret = $store->getList("data", "{$pid}", 100, 0);
        foreach ($ret as $file) {
            //          echo "<debug>$file</debug>";
            if (!strstr($file, "sae-dir-tag")) {
                $pinfo = pathinfo($file);
                if (isset($pinfo['extension']) && $pinfo['extension'] == "in" && $pinfo['basename'] != "sample.in") {
                    $f = basename($pinfo['basename'], "." . $pinfo['extension']);
                    $outfile = "{$pid}/" . $f . ".out";
                    $infile = "{$pid}/" . $f . ".in";
                    if ($store->fileExists("data", $infile)) {
                        echo "<test_input><![CDATA[" . $store->read("data", $infile) . "]]></test_input>\n";
                    }
                    if ($store->fileExists("data", $outfile)) {
                        echo "<test_output><![CDATA[" . $store->read("data", $outfile) . "]]></test_output>\n";
                    }
                    //			break;
                }
            }
        }
    } else {
        $ret = "";
        $pdir = opendir("{$OJ_DATA}/{$pid}/");
        while ($file = readdir($pdir)) {
            $pinfo = pathinfo($file);
            if (isset($pinfo['extension']) && $pinfo['extension'] == "in" && $pinfo['basename'] != "sample.in") {
                $ret = basename($pinfo['basename'], "." . $pinfo['extension']);
                $outfile = "{$OJ_DATA}/{$pid}/" . $ret . ".out";
                $infile = "{$OJ_DATA}/{$pid}/" . $ret . ".in";
                if (file_exists($infile)) {
                    echo "<test_input><![CDATA[" . file_get_contents($infile) . "]]></test_input>\n";
                }
                if (file_exists($outfile)) {
                    echo "<test_output><![CDATA[" . file_get_contents($outfile) . "]]></test_output>\n";
                }
                //			break;
            }
        }
        closedir($pdir);
        return $ret;
    }
}
开发者ID:siriushr,项目名称:hustoj,代码行数:46,代码来源:problem_export_xml.php

示例3: imageManager

 /**
  * @function imageManager
  */
 public function imageManager()
 {
     header("Content-Type: text/html; charset=utf-8");
     //需要遍历的目录列表,最好使用缩略图地址,否则当网速慢时可能会造成严重的延时
     $paths = array(Upload_PATH, 'upload1/');
     //  $action = htmlspecialchars($_POST["action"]);
     $action = htmlspecialchars($_REQUEST["action"]);
     if ($action == "get") {
         if (!defined('SAE_TMP_PATH')) {
             $files = array();
             foreach ($paths as $path) {
                 //$dir = new Dir();
                 //$tmp = $dir->getfiles($path);
                 $tmp = File::getFiles($path);
                 if ($tmp) {
                     $files = array_merge($files, $tmp);
                 }
             }
             if (!count($files)) {
                 return;
             }
             rsort($files, SORT_STRING);
             $str = "";
             foreach ($files as $file) {
                 $str .= __ROOT__ . '/' . $file . "ue_separate_ue";
             }
             echo $str;
         } else {
             // SAE环境下
             $st = new \SaeStorage();
             // 实例化
             /*
              *  getList:获取指定domain下的文件名列表
              *  return: 执行成功时返回文件列表数组,否则返回false
              *  参数:存储域,路径前缀,返回条数,起始条数
              */
             $num = 0;
             while ($ret = $st->getList(get_opinion('SaeStorage'), null, 100, $num)) {
                 foreach ($ret as $file) {
                     if (preg_match("/\\.(gif|jpeg|jpg|png|bmp)\$/i", $file)) {
                         echo $st->getUrl('upload', $file) . "ue_separate_ue";
                     }
                     $num++;
                 }
             }
         }
     }
 }
开发者ID:nomagame,项目名称:Charmy,代码行数:51,代码来源:UeditorController.class.php

示例4: count

     $sql = "UPDATE `problem` SET `accepted`=(SELECT count(1) FROM `solution` WHERE `problem_id`={$pid} AND `result`=4) WHERE `problem_id`={$pid}";
     //echo $sql;
     mysqli_query($mysqli, $sql);
     $sql = "UPDATE `problem` SET `submit`=(SELECT count(1) FROM `solution` WHERE `problem_id`={$pid}) WHERE `problem_id`={$pid}";
     //echo $sql;
     mysqli_query($mysqli, $sql);
 } else {
     if (isset($_POST['checklogin'])) {
         echo "1";
     } else {
         if (isset($_POST['gettestdatalist'])) {
             $pid = intval($_POST['pid']);
             if ($OJ_SAE) {
                 //echo $OJ_DATA."$pid";
                 $store = new SaeStorage();
                 $ret = $store->getList("data", "{$pid}", 100, 0);
                 foreach ($ret as $file) {
                     if (!strstr($file, "sae-dir-tag")) {
                         $file = pathinfo($file);
                         $file = $file['basename'];
                         echo $file . "\n";
                     }
                 }
             } else {
                 $dir = opendir($OJ_DATA . "/{$pid}");
                 while (($file = readdir($dir)) != "") {
                     if (!is_dir($file)) {
                         $file = pathinfo($file);
                         $file = $file['basename'];
                         echo "{$file}\n";
                     }
开发者ID:RX78NY1,项目名称:hustoj,代码行数:31,代码来源:problem_judge.php

示例5: SaeStorage

<?php

header("Content-Type:text/html;charset='utf-8'");
$storage = new SaeStorage();
$glInfo = array('domain' => 'test', 'prefix' => '', 'limit' => '100', 'offset' => 0);
$ret = $storage->getList($glInfo['domain'], $glInfo['prefix'], $glInfo['limit'], $glInfo['offset']);
$allow_ext = array('image' => array('gif', 'jpg', 'jpeg', 'png', 'bmp', 'psd'), 'flash' => array('swf', 'flv'), 'media' => array('mp3', 'wav', 'wma', 'wmv', 'mid', 'avi', 'mpg', 'asf', 'rm', 'rmvb'), 'file' => array('pdf', 'doc', 'docx', 'xls', 'xlsx', 'ppt', 'htm', 'html', 'txt', 'zip', 'rar', 'gz', 'bz2'));
//容许的文件扩展名
$fileInfo = null;
for ($i = 0; $i < count($ret); $i++) {
    if (substr($ret[$i], "-" . strlen('/.placeholder')) != '/.placeholder') {
        $file_ext = strtolower(trim(array_pop(explode(".", $ret[$i]))));
        if (in_array($file_ext, $allow_ext['image']) === true) {
            $format = 'image';
        } else {
            if (in_array($file_ext, $allow_ext['flash']) === true) {
                $format = 'flash';
            } else {
                if (in_array($file_ext, $allow_ext['media']) === true) {
                    $format = 'media';
                } else {
                    if (in_array($file_ext, $allow_ext['file']) === true) {
                        $format = 'file';
                    } else {
                        $format = 'unknown';
                    }
                }
            }
        }
        $baseInfo = $storage->getAttr($glInfo['domain'], $ret[$i]);
        $fileInfo[$i]['file_ext'] = $file_ext;
开发者ID:kerou,项目名称:SAE-Storage-SDK,代码行数:31,代码来源:getfiles-old.php

示例6: SaeStorage

<?php

include_once 'saestorage.class.php';
$stor = new SaeStorage();
$file_url = $stor->getUrl("darkblue", "100.jpg");
echo $file_url;
//http://darkblueacgstandby-darkblue.stor.sinaapp.com/images/loli/100.jpg
$pic_url = "http://darkblueacgstandby-darkblue.stor.sinaapp.com/images/loli/" . $random_id . ".jpg";
$domain = "darkblue";
$path = "darkblue/images/loli";
$pic_num = getFilesNum($domain, $path);
echo $pic_num;
// 列出 Domain 下所有路径以photo开头的文件
$stor = new SaeStorage();
$num = 0;
//string $domain, [string $prefix = NULL], [int $limit = 10], [int $offset = 0]
while ($ret = $stor->getList("darkblue", NULL, 100, $num)) {
    foreach ($ret as $file) {
        // echo "{$file}\n";
        $num++;
    }
}
// echo "\nTOTAL: {$num} files\n";
开发者ID:ysh329,项目名称:DarkBlueACG,代码行数:23,代码来源:test_storage.php

示例7: ue_mgimg

 public function ue_mgimg()
 {
     $setting = C('EDITOR_UPLOAD');
     $files = array();
     if (!defined('SAE_TMP_PATH')) {
         $imgRootPath = $setting['rootPath'];
         $paths = array('');
         $files = $this->getfiles($imgRootPath);
     } else {
         // SAE环境下
         $st = new \SaeStorage();
         // 实例化
         $driverConf = C("UPLOAD_SAE_CONFIG");
         /*
          *  getList:获取指定domain下的文件名列表
          *  return: 执行成功时返回文件列表数组,否则返回false
          *  参数:存储域,路径前缀,返回条数,起始条数
          */
         $num = 0;
         while ($ret = $st->getList($driverConf['domain'], NULL, 100, $num)) {
             foreach ($ret as $file) {
                 if (preg_match("/\\.(gif|jpeg|jpg|png|bmp)\$/i", $file)) {
                     $files[$num] = $st->getUrl($driverConf['domain'], $file);
                 }
                 $num++;
             }
         }
     }
     if (!count($files)) {
         return;
     }
     rsort($files, SORT_STRING);
     $str = implode('|', $files);
     echo $str;
 }
开发者ID:skylei,项目名称:sae_weiphp,代码行数:35,代码来源:UploadController.class.php

示例8: SaeStorage

<?php

require_once 'saestorage.class.php';
#your app accesskey
$accesskey = 'enter_your_app_accesskey';
#your app secretkey
$secretkey = 'enter_your_app_secretkey';
#your doamin name
$domain = 'enter_your_doamin_name';
$storage = new SaeStorage($accesskey, $secretkey);
$filesNum = $storage->getFilesNum($domain);
$fileList = $storage->getList($domain);
//print_r($fileList);
foreach ($fileList as $oneFile) {
    $fileName = $oneFile['fileName'];
    //var_dump($fileName);
    echo $fileName;
    $fileNameNoDir = explode("/", $fileName)[1];
    if (!file_exists($fileNameNoDir)) {
        $fileUrl = $storage->getUrl($domain, $fileName);
        $cmd = 'wget ' . $fileUrl;
        shell_exec($cmd);
    }
}
开发者ID:Wsine,项目名称:SAE_Printer,代码行数:24,代码来源:getFile2.php

示例9: SaeStorage

<?php

//遍历Domain下所有文件
$stor = new SaeStorage();
$num = 0;
while ($ret = $stor->getList("box", "*", 100, $num)) {
    foreach ($ret as $file) {
        echo "{$file}\n";
        $num++;
    }
}
echo "\nTOTAL: {$num} files\n";
?>
 
 <?php 
$domain = "box";
$filename = "SAE_SDK_Windows_1.0.5.Build1105301821.zip";
$url = $stor->getUrl($domain, $filename);
echo $url;
开发者ID:dangdang,项目名称:zhs,代码行数:19,代码来源:storage.php

示例10: getfiles

if ($action == "get") {
    if (!defined('SAE_TMP_PATH')) {
        $files = getfiles($path);
        if (!$files) {
            return;
        }
        rsort($files, SORT_STRING);
        $str = "";
        foreach ($files as $file) {
            $str .= $file . "ue_separate_ue";
        }
        echo $str;
    } else {
        $st = new SaeStorage();
        $num = 0;
        while ($ret = $st->getList("upload", NULL, 100, $num)) {
            foreach ($ret as $file) {
                if (preg_match("/\\.(gif|jpeg|jpg|png|bmp)\$/i", $file)) {
                    echo $st->getUrl('upload', $file) . "ue_separate_ue";
                }
                $num++;
            }
        }
    }
}
/**
 * 遍历获取目录下的指定类型的文件
 * @param $path
 * @param array $files
 * @return array
 */
开发者ID:Git-Host,项目名称:game-server,代码行数:31,代码来源:imageManager.php

示例11: SaeStorageList

function SaeStorageList($Prefix)
{
    $storage = new SaeStorage();
    $domain = Sae_Storage_Domain_Name;
    $result = array();
    //默认空数组
    $limit = 100;
    //列表数量
    $offset = 0;
    //偏移量
    while ($temp = $storage->getList($domain, $Prefix, $limit, $offset)) {
        foreach ($temp as $file) {
            $result[] = $file;
            $num++;
        }
    }
    return $result;
    //注意:最大只能列出10000条数据。
}
开发者ID:ribunkou,项目名称:MyPHP,代码行数:19,代码来源:SaeStorage.php

示例12: count

     $sql = "UPDATE `problem` SET `accepted`=(SELECT count(1) FROM `solution` WHERE `problem_id`={$pid} AND `result`=4) WHERE `problem_id`={$pid}";
     //echo $sql;
     mysql_query($sql);
     $sql = "UPDATE `problem` SET `submit`=(SELECT count(1) FROM `solution` WHERE `problem_id`={$pid}) WHERE `problem_id`={$pid}";
     //echo $sql;
     mysql_query($sql);
 } else {
     if (isset($_POST['checklogin'])) {
         echo "1";
     } else {
         if (isset($_POST['gettestdatalist'])) {
             $pid = intval($_POST['pid']);
             if ($OJ_SAE) {
                 //echo $OJ_DATA."$pid";
                 $store = new SaeStorage();
                 $ret = $store->getList("data", "{$pid}");
                 foreach ($ret as $file) {
                     if (!strstr($file, "sae-dir-tag")) {
                         $file = pathinfo($file);
                         $file = $file['basename'];
                         echo $file . "\n";
                     }
                 }
             } else {
                 $dir = opendir($OJ_DATA . "/{$pid}");
                 while (($file = readdir($dir)) != "") {
                     if (!is_dir($file)) {
                         $file = pathinfo($file);
                         $file = $file['basename'];
                         echo "{$file}\n";
                     }
开发者ID:RX78NY1,项目名称:hustoj,代码行数:31,代码来源:problem_judge.php

示例13: 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


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