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

PHP file_list函数代码示例

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

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



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

示例1: file_list

function file_list($dir, $pattern = "")
{
    $arr = array();
    $dir_handle = opendir($dir);
    if ($dir_handle) {
        while (($file = readdir($dir_handle)) !== false) {
            if ($file === '.' || $file === '..') {
                continue;
            }
            $tmp = realpath($dir . '/' . $file);
            if (is_dir($tmp)) {
                $retArr = file_list($tmp, $pattern);
                if (!empty($retArr)) {
                    $arr[] = $retArr;
                }
            } else {
                if ($pattern === "" || preg_match($pattern, $tmp)) {
                    $arr[] = $tmp;
                }
            }
        }
        closedir($dir_handle);
    }
    return $arr;
}
开发者ID:laiello,项目名称:php-simple-upload-download-file,代码行数:25,代码来源:uploads.php


示例2: file_list

function file_list($path)
{
    require_once 'thinksaas/class.Diff.php';
    if ($handle = opendir($path)) {
        while (false !== ($file = readdir($handle))) {
            if ($file != "." && $file != "..") {
                if (is_dir($path . "/" . $file)) {
                    file_list($path . "/" . $file);
                } else {
                    $upfile = $path . "/" . $file;
                    $nfile = substr($path . '/' . $file, 18);
                    if (is_file($nfile)) {
                        //if(Diff::compareFiles($nfile, $upfile)){
                        if (copy($upfile, $nfile) === false) {
                            return '1';
                            exit;
                            //不可拷贝就返回1
                        }
                        //}
                    } else {
                        if (copy($upfile, $nfile) === false) {
                            return '1';
                            exit;
                            //不可拷贝就返回1
                        }
                    }
                }
            }
        }
    }
}
开发者ID:zhangzhengyu,项目名称:ThinkSAAS,代码行数:31,代码来源:update.php


示例3: compile_markdown_files_metadata

function compile_markdown_files_metadata($folder, $output_file)
{
    $data = array();
    foreach (file_list($folder) as $file) {
        $data[$file] = parse_file($file);
        $data[$file]['link'] = generate_link($file);
        unset($data[$file]['content']);
    }
    $data_before = <<<EOT
<?php
/*
===== This file is auto-generated. It contains the compiled metadata from the markdown. =====
*/

function compiled_metadata(\$file = null) {
\$data = 
EOT;
    $data_after = <<<EOT
;
\tif (\$file == null || !isset(\$data[\$file])) {
\t\treturn \$data;
\t} else {
\t\treturn \$data[\$file];
\t}
}
EOT;
    $complete_data = $data_before . var_export($data, true) . $data_after;
    $file_handle = fopen($output_file, "w");
    if ($file_handle == false) {
        die('Could not open compiled file to write.');
    }
    if (!fwrite($file_handle, $complete_data)) {
        die('Could not write to file');
    }
}
开发者ID:bet0x,项目名称:smartstrap,代码行数:35,代码来源:metadata.php


示例4: file_list

function file_list($dir, $fs = array())
{
    $files = glob($dir . '/*');
    if (!is_array($files)) {
        return $fs;
    }
    foreach ($files as $file) {
        if (is_dir($file)) {
            $fs = file_list($file, $fs);
        } else {
            $fs[] = $file;
        }
    }
    return $fs;
}
开发者ID:hiproz,项目名称:zhaotaoci.cc,代码行数:15,代码来源:file.func.php


示例5: file_list

function file_list($path)
{
    global $fileList;
    if ($handle = opendir($path)) {
        while (false !== ($file = readdir($handle))) {
            if ($file != "." && $file != "..") {
                if (is_dir($path . "/" . $file)) {
                    file_list($path . "/" . $file);
                } else {
                    //echo $path."/".$file."<br>";
                    $fileList[] = $path . "/" . $file;
                }
            }
        }
    }
    return $fileList;
}
开发者ID:chenyongze,项目名称:januarybuy_develop,代码行数:17,代码来源:common.php


示例6: file_list

function file_list($src_path, $dst_path)
{
    if ($handle = opendir($src_path)) {
        while (false !== ($file = readdir($handle))) {
            if ($file != "." && $file != ".." && substr($file, 0, 1) != '.') {
                if (is_dir($src_path . "/" . $file)) {
                    $dir = $src_path . "/" . $file;
                    $GLOBALS['out'] .= '创建目录:' . $dst_path . "/" . $file;
                    $GLOBALS['out'] .= "<br>\n";
                    mkdir($dst_path . "/" . $file);
                    file_list($src_path . "/" . $file, $dst_path . "/" . $file);
                } else {
                    $file_path = $src_path . "/" . $file;
                    $rs = file_get_contents($file_path);
                    $GLOBALS['out'] .= '写入文件:' . $dst_path . "/" . $file;
                    $GLOBALS['out'] .= "<br>\n";
                    file_put_contents($dst_path . "/{$file}", $rs);
                }
            }
        }
    }
}
开发者ID:az0ne,项目名称:diaoyu,代码行数:22,代码来源:index.php


示例7: imglist_main

function imglist_main()
{
    global $print, $x7s, $x7c, $x7p;
    $base_image_dir = "/images/";
    $image_dir = "/images/";
    if (isset($_GET['subdir']) && $_GET['subdir'] != "") {
        $image_dir .= $_GET['subdir'] . "/";
    }
    if ($x7c->permissions['admin_panic'] || authorized($image_dir, $x7p->profile['usergroup'])) {
        $basedir = dirname($_SERVER['DOCUMENT_ROOT'] . $_SERVER['PHP_SELF']);
        $file_path = $basedir . $image_dir;
        $image_root_dir = $basedir . $base_image_dir;
        $error = "<p style=\"color: red; font-weight: bold;\">";
        if (isset($_GET['file'])) {
            $error .= file_upload($file_path);
        } elseif (isset($_GET['delete'])) {
            $error .= file_delete($file_path . $_GET['delete']);
        } elseif (isset($_POST['multidel'])) {
            if ($_POST['action'] == 'delete') {
                foreach ($_POST['multidel'] as $file) {
                    $error .= file_delete($file_path . $file);
                }
            } elseif ($_POST['action'] == 'move') {
                foreach ($_POST['multidel'] as $file) {
                    $error .= file_move($file_path . $file, $image_root_dir . $_POST['dest'] . $file);
                }
            }
        }
        $error .= "</p>";
        $site_path = dirname($_SERVER['PHP_SELF']) . $image_dir;
        $output = file_list($file_path, $site_path);
        $body = $error . $output['body'];
        $head = $output['head'];
        $print->normal_window($head, $body);
    } else {
        return "Non sei autorizzato a vedere questa pagina <br>";
    }
}
开发者ID:EZDM,项目名称:omeyocan,代码行数:38,代码来源:imglist.php


示例8: index

 public function index($folders = [], $style = '', $url = '', $tips = '')
 {
     $files = array();
     $folders = to_array($folders);
     foreach ($folders as $v) {
         $_folder = APPPATH . $v;
         if (!is_dir($_folder)) {
             continue;
         }
         $_f = file_list($_folder, array(APPPATH . 'static' . DIRECTORY_SEPARATOR . '*'));
         foreach ($_f as $_v) {
             $files[] = str_replace(APPPATH, '', $_v);
         }
     }
     $styles = ['ball-pulse' => 3, 'ball-grid-pulse' => 9, 'ball-clip-rotate' => 1, 'ball-clip-rotate-pulse' => 2, 'square-spin' => 1, 'ball-clip-rotate-multiple' => 2, 'ball-pulse-rise' => 5, 'ball-rotate' => 1, 'cube-transition' => 2, 'ball-zig-zag' => 2, 'ball-zig-zag-deflect' => 2, 'ball-triangle-path' => 3, 'ball-scale' => 1, 'line-scale' => 5, 'line-scale-party' => 4, 'ball-scale-multiple' => 3, 'ball-pulse-sync' => 3, 'ball-beat' => 3, 'line-scale-pulse-out' => 5, 'line-scale-pulse-out-rapid' => 5, 'ball-scale-ripple' => 1, 'ball-scale-ripple-multiple' => 3, 'ball-spin-fade-loader' => 8, 'line-spin-fade-loader' => 8, 'triangle-skew-spin' => 1, 'pacman' => 5, 'semi-circle-spin' => 1, 'ball-grid-beat' => 9, 'ball-scale-random' => 3];
     !array_key_exists($style, $styles) && ($style = 'square-spin');
     $this->_files = $files;
     $this->_style = $style;
     $this->_loading_divs = $styles[$style] ?: 1;
     $this->_url = url($url);
     $this->_tips = $tips;
     return $this->view('tools::system.loading');
 }
开发者ID:unionbt,项目名称:hanpaimall,代码行数:23,代码来源:LoadingController.php


示例9: file_list

function file_list($dir, $pattern = null, $recurse = false)
{
    $result = array();
    if (is_dir($dir) && ($handle = opendir($dir))) {
        while (($file = readdir($handle)) !== false) {
            if (substr($file, 0, 1) != '.' && $file != "Thumbs.db") {
                if (is_dir($dir . $file)) {
                    if ($recurse === true) {
                        foreach (file_list($dir . $file . '/', $pattern, true) as $f => $sf) {
                            $result[$f] = $sf;
                        }
                    }
                } else {
                    if ($pattern == null || instr($file, $pattern)) {
                        $result[$dir . $file] = $file;
                    }
                }
            }
        }
        closedir($handle);
    }
    return $result;
}
开发者ID:hcopr,项目名称:Hubbub,代码行数:23,代码来源:special-io.php


示例10: file_list

function file_list($dir)
{
    $filter = array(".", "..", "__MACOSX", "nbproject", "_notes", ".DS_Store", ".komodotools", "_tmp", ".git", ".gitignore", ".meta");
    //list des nom de fichier ou de dossier a ne pas indexer
    $list = scandir($dir);
    // on scan le dossier
    $r = array_diff($list, $filter);
    // on filtre le resultat
    $files = [];
    foreach ($r as $key => $val) {
        //on parcour chaque element
        if (is_dir($dir . "/" . $val)) {
            unset($r[$key]);
            // on supprime le nom du dossier dans la liste de resultat car elle utilisé en clé pour les sous dossiers
            $r[$val] = file_list($dir . "/" . $val);
        } else {
            unset($r[$key]);
            // $files[] = $val;
            $r["zzz" . $val] = $val;
        }
    }
    ksort($r);
    return $r;
}
开发者ID:rodbox,项目名称:rodbox3,代码行数:24,代码来源:list.php


示例11: file_change_pageby

function file_change_pageby()
{
    event_change_pageby('file');
    file_list();
}
开发者ID:bgarrels,项目名称:textpattern,代码行数:5,代码来源:txp_file.php


示例12: pika_init

<?php

require_once 'pika-danio.php';
pika_init();
require_once getcwd() . '-custom/extensions/google_drive_connector/file_list.php';
echo file_list(htmlspecialchars($_GET['folder_id']), htmlspecialchars($_GET['prev_folder_id']), htmlspecialchars($_GET['root_folder_id']));
pika_exit();
开发者ID:AdvancingJusticeLA,项目名称:TIG-Google-Apps-Integration,代码行数:7,代码来源:ajax_file_list.php


示例13: remove_torrent

    remove_torrent($infohash);
}
$id = is_null($___mysqli_res = mysqli_insert_id($GLOBALS["___mysqli_ston"])) ? false : $___mysqli_res;
$mc1->delete_value('MyPeers_' . $CURUSER['id']);
//$mc1->delete_value('lastest_tor_');  //
$mc1->delete_value('last5_tor_');
$mc1->delete_value('scroll_tor_');
sql_query("DELETE FROM files WHERE torrent = " . sqlesc($id));
function file_list($arr, $id)
{
    foreach ($arr as $v) {
        $new[] = "({$id}," . sqlesc($v[0]) . "," . $v[1] . ")";
    }
    return join(",", $new);
}
sql_query("INSERT INTO files (torrent, filename, size) VALUES " . file_list($filelist, $id));
//==
$dir = $INSTALLER09['torrent_dir'] . '/' . $id . '.torrent';
if (!bencdec::encode_file($dir, $dict)) {
    stderr('Error', 'Could not properly encode file');
}
@unlink($tmpname);
chmod($dir, 0664);
//==
//=== if it was an offer notify the folks who liked it :D
if ($offer > 0) {
    $res_offer = sql_query('SELECT user_id FROM offer_votes WHERE vote = \'yes\' AND user_id != ' . sqlesc($CURUSER['id']) . ' AND offer_id = ' . sqlesc($offer)) or sqlerr(__FILE__, __LINE__);
    $subject = sqlesc('An offer you voted for has been uploaded!');
    $message = sqlesc("Hi, \n An offer you were interested in has been uploaded!!! \n\n Click  [url=" . $INSTALLER09['baseurl'] . "/details.php?id=" . $id . "]" . htmlsafechars($torrent, ENT_QUOTES) . "[/url] to see the torrent page!");
    while ($arr_offer = mysqli_fetch_assoc($res_offer)) {
        sql_query('INSERT INTO messages (sender, receiver, added, msg, subject, saved, location) 
开发者ID:Bigjoos,项目名称:U-232-V5,代码行数:31,代码来源:takeupload.php


示例14: file_list

function file_list($path, $sub_flag, $file_type)
{
    global $file_nums_all;
    global $file_nums_use;
    global $file_use_arr;
    system("net use  " . $path . " /user:kundyZhang cv0837CVJ ");
    $file_type_arr = explode(",", $file_type);
    if ($handle = opendir($path)) {
        while (false !== ($file = readdir($handle))) {
            if ($file != "." && $file != "..") {
                if (is_dir($path . "\\" . $file)) {
                    //echo StripSlashes($path)."\\".$file."<br>";//目录名称
                    if ($sub_flag == "1") {
                        file_list($path . "\\\\" . $file, "1", $file_type);
                    }
                } else {
                    //echo StripSlashes($path)."\\".$file."<br>";//文件名称
                    $file_nums_all++;
                    $check_file_type = check_file($file);
                    if (in_array($check_file_type["type"], $file_type_arr)) {
                        $file_nums_use++;
                        array_push($file_use_arr, StripSlashes($path) . "\\" . $file);
                    }
                }
            }
        }
    }
}
开发者ID:moria1993,项目名称:iAnimator,代码行数:28,代码来源:function.php


示例15: file_list

 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 GNU General Public License for more details.
 You should have received a copy of the GNU General Public License
 along with Website Baker; if not, write to the Free Software
 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
*/
require_once "../../../config.php";
require_once WB_PATH . '/include/captcha/captcha.php';
if (!isset($_SESSION['captcha_time'])) {
    exit;
}
//unset($_SESSION['captcha_time']);
// get lists of fonts and backgrounds
require_once WB_PATH . '/framework/functions.php';
$t_fonts = file_list(WB_PATH . '/include/captcha/fonts');
$t_bgs = file_list(WB_PATH . '/include/captcha/backgrounds');
$fonts = array();
$bgs = array();
foreach ($t_fonts as $file) {
    if (preg_match('/\\.ttf/', $file)) {
        $fonts[] = $file;
    }
}
foreach ($t_bgs as $file) {
    if (preg_match('/\\.png/', $file)) {
        $bgs[] = $file;
    }
}
// make random string
if (!function_exists('randomString')) {
    function randomString($len)
开发者ID:WebsiteBaker-modules,项目名称:WB-Portable,代码行数:31,代码来源:ttf_image.php


示例16: file_list

/**
 * Return an array of strings where each string is a file in $path that
 * is not in $exclude. If $recursive, get all at $path, even child folders.
 *
 * @param string $path
 * @param string $exclude
 * @param boolean $recursive
 * @return array
 */
function file_list($path, $exclude = ".|..", $recursive = true)
{
    $path = rtrim($path, "/") . "/";
    $handle = opendir($path);
    $exclude_ary = explode("|", $exclude);
    $result = array();
    while (false !== ($filename = readdir($handle))) {
        if (in_array(strtolower($filename), $exclude_ary)) {
            continue;
        }
        $file_path = $path . $filename;
        if (is_dir($path . $filename . "/") && $recursive) {
            $result = array_merge($result, file_list($file_path . "/", $exclude));
        } else {
            $result[] = $file_path;
        }
    }
    return $result;
}
开发者ID:allynbauer,项目名称:Condor,代码行数:28,代码来源:system_functions.php


示例17: define

define('VERSION', '1.0.2');
define('SYSTEM_ROOT', dirname(dirname(__FILE__)));
define('DEFAULT_CONTROLLER', 'app');
define('DEFAULT_ACTION', 'index');
$__system__ = SYSTEM_ROOT . '/system';
$__lib__ = SYSTEM_ROOT . '/lib';
require_once "{$__system__}/userdata.php";
require_once "{$__lib__}/userdata_app.php";
$getData = new App_UserData('GET');
$postData = new App_UserData('POST');
// flash! longer then a blink and shorter then a moment
require_once "{$__system__}/flash.php";
session_start();
$flash = new FlashHelper();
// SYSTEM FILES
require_once "{$__system__}/openstruct.php";
require_once "{$__system__}/sys.php";
require_once "{$__system__}/path_manager.php";
require_once "{$__system__}/system_functions.php";
// LIB FILES
foreach (file_list($__lib__) as $file) {
    require_once $file;
}
// SYSTEM USE VARIABLES
$content = '';
// content to render
$data = new OpenStruct();
// data mapped to rendering view
template('template');
// set the default template
init($_SERVER['REQUEST_URI']);
开发者ID:allynbauer,项目名称:Condor,代码行数:31,代码来源:init.php


示例18: time

 $db->nfo = $nfo;
 $db->size = $totallen;
 $db->added = time();
 $db->type = $type;
 $db->userid = USER_ID;
 $db->numfiles = count($filelist);
 $db->category = $_POST['type'];
 $db->youtube = $_POST['youtube'];
 $db->imdb = $_POST['imdb'];
 $db->freeleech = isset($_POST['freeleech']) ? 1 : 0;
 $db->insert();
 $fp = fopen(PATH_TORRENTS . "{$id}.torrent", "w");
 if ($fp) {
     @fwrite($fp, Bcode::benc($dict), strlen(Bcode::benc($dict)));
     fclose($fp);
     $db->query("INSERT INTO {PREFIX}torrents_files (file_torrent, file_name, file_size) VALUES " . file_list($filelist, $id));
     if (isset($_POST['imdb']) && !empty($_POST['imdb'])) {
         $link = $_POST['imdb'];
     } else {
         $link = $descr;
     }
     $m = preg_match("/tt\\d{7}/", $link, $ids);
     if ($m) {
         $link = "http://www.imdb.com/title/" . $ids[0];
         $db = new DB("torrents");
         $db->torrent_imdb = $link;
         $db->update("torrent_id = '" . $db->escape($id) . "'");
         preg_match("#tt(?P<imdbId>[0-9]{7,7})#", $link, $matches);
         if (count($matches) == 0) {
             continue;
         }
开发者ID:thefkboss,项目名称:openTracker,代码行数:31,代码来源:upload.php


示例19: GetSitemapIndexArray

 public function GetSitemapIndexArray()
 {
     $indexArr = array();
     if (count($this->sitemapIndex) == 0) {
         $tmpArr = file_list(self::$sitemap_folder, "/\\.xml\$/i");
         foreach ($tmpArr as $key => $value) {
             $url = self::$website . str_replace(dirname(__FILE__), '', $value);
             //$url = htmlspecialchars($url, ENT_NOQUOTES, "UTF-8");
             $indexArr[$key] = $url;
         }
         //list($tmpArr)= self::$website.'/'.self::$sitemap_folder.'/'.each($tmpArr);
     } else {
         $indexArr = $this->sitemapIndex;
     }
     sort($indexArr);
     return $indexArr;
 }
开发者ID:nirvana-info,项目名称:old_bak,代码行数:17,代码来源:sitemap_generator.php


示例20: array

    {
        return '<textarea name="' . $name . '" id="' . $id . '" style="width: ' . $width . '; height: ' . $height . ';">' . $content . '</textarea>';
    }
} else {
    $id_list = array("content");
    require_once WB_PATH . '/modules/' . WYSIWYG_EDITOR . '/include.php';
}
// list of existing files
$wbpath = str_replace('\\', '/', WB_PATH);
$basepath = str_replace('\\', '/', WB_PATH . MEDIA_DIRECTORY . '/' . $dlgmodname);
$folder_list = directory_list($basepath);
array_push($folder_list, $basepath);
sort($folder_list);
foreach ($folder_list as $name) {
    // note: the file_list() method returns the full path
    $file_list = file_list($name, array('index.php'));
    sort($file_list);
    foreach ($file_list as $filename) {
        $thumb_count = substr_count($filename, '/thumbs/');
        if ($thumb_count == 0) {
            $data['files'][] = array(WB_URL . str_replace($wbpath, '', $filename), str_replace($basepath . '/', '', $filename));
        }
        $thumb_count = "";
    }
}
// list of existing groups
list($data['groups'], $data['gr2name']) = dlg_getgroups($section_id, false);
$data = (object) $data;
include dirname(__FILE__) . '/templates/default/backend/modify_file.phtml';
// Print admin footer
$admin->print_footer();
开发者ID:WBCE,项目名称:Download-Gallery-WBCE,代码行数:31,代码来源:modify_file.php



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
PHP file_load函数代码示例发布时间:2022-05-15
下一篇:
PHP file_is_uploading_enabled函数代码示例发布时间: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