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

PHP listdir函数代码示例

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

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



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

示例1: listdir

    public static function listdir($dir, $dirs_stat)
    {
        $list = \OC\Files\Filesystem::getdirectorycontent($dir);
        if (sizeof($list) > 0) {
            $ret = '';
            //$d=explode('/',$dir);
            foreach ($list as $i) {
                if ($i['type'] == 'dir' && $i['name'] != '.') {
                    if (!isset($i['directory'])) {
                        $i['directory'] = '';
                    }
                    $ret .= '<li class="ui-droppable">
					 	<a href="./?app=files&dir=' . $i['directory'] . '/' . $i['name'] . '" data-pathname="' . $i['directory'] . '/' . $i['name'] . '">' . $i['name'] . '</a>' . listdir($dir . '/' . $i['name'], $dirs_stat) . '
						</li>
					';
                }
            }
            if ($ret != '') {
                $class = 'class="collapsed"';
                if ($dir == '' || isset($dirs_stat[$dir]) && $dirs_stat[$dir] == 'expanded') {
                    $class = 'class="expanded"';
                }
                $ret = '<ul ' . $class . ' data-path="' . $dir . '"><li></li>' . $ret . '</ul>';
            }
            return $ret;
        }
    }
开发者ID:ukitiyan,项目名称:files_tree,代码行数:27,代码来源:tree.php


示例2: print_files

 function print_files()
 {
     $data = array();
     //should declare array to be used to hold valid input files
     echo '<b>Ingesting the data files that are in the data directory!</b>';
     echo '<br>*******************************************************<br>';
     $dirfiles = listdir(ES__PLUGIN_DIR . "data");
     if ($dirfiles) {
         foreach ($dirfiles as $key => $filename) {
             if (substr($filename, -4) == '.txt' && !is_dir($filename)) {
                 $data[$filename] = php_strip_whitespace($filename);
                 $theData = make_post($filename);
                 insert_post($theData);
                 echo "<br>";
                 echo "<br>Finished.";
                 echo "<br>";
             } else {
                 $other[$filename] = !is_dir($filename) ? file_get_contents($filename) : '';
             }
         }
         $myFile = ES__PLUGIN_DIR . "/data/test.txt";
         $fh = fopen($myFile, 'r');
         $theData = fread($fh, filesize($myFile));
         fclose($fh);
     }
     insert_post($theData);
     echo "<br>";
     echo "<br>Finished.";
     echo "<br>";
 }
开发者ID:smehan,项目名称:wp-ingest,代码行数:30,代码来源:class.earthshare-ingest-admin.php


示例3: listdir

function listdir($start_dir = '.')
{
    global $foundPath;
    $files = array();
    if (is_dir($start_dir)) {
        $fh = opendir($start_dir);
        while (($file = readdir($fh)) !== false) {
            # loop through the files, skipping . and .., and recursing if necessary
            if (strcmp($file, '.') == 0 || strcmp($file, '..') == 0) {
                continue;
            }
            $filepath = $start_dir . '/' . $file;
            if (is_dir($filepath)) {
                $files = array_merge($files, listdir($filepath));
            } else {
                if (strpos($filepath, DIR_WS_LANGUAGES . $_SESSION['language'] . '/' . FILENAME_ORDERS . ".php")) {
                    $foundPath = $filepath;
                }
                array_push($files, $filepath);
            }
        }
        closedir($fh);
    } else {
        # false if the function was called with an invalid non-directory argument
        $files = false;
    }
    return $files;
}
开发者ID:paynl,项目名称:zencart-plugin,代码行数:28,代码来源:return.php


示例4: hae_skannattu_lasku

function hae_skannattu_lasku($kasittele_seuraava = "")
{
    global $kukarow, $yhtiorow;
    $dir = $yhtiorow['skannatut_laskut_polku'];
    if (!is_dir($dir) or !is_writable($dir)) {
        return false;
    }
    // käydään läpi ensin käsiteltävät kuvat
    $files = listdir($dir);
    $files_count = count($files);
    // Jos ei ole yhtään tiedostoa, palautetaan false
    if ($files_count == 0) {
        return false;
    }
    // Tehdään palautusta varten array, palautetaan aina laskujen lukumäärä
    $palautus = array("lukumaara" => $files_count);
    // Katsotaan onko laskuja, jota käyttäjä voisi käsitellä
    $query = "SELECT kesken\n            FROM kuka\n            WHERE yhtio  = '{$kukarow["yhtio"]}'\n            AND extranet = ''";
    $kesken_chk_res = pupe_query($query);
    foreach ($files as $file) {
        $path_parts = pathinfo($file);
        mysql_data_seek($kesken_chk_res, 0);
        while ($kesken_chk_row = mysql_fetch_assoc($kesken_chk_res)) {
            // Jos tiedosto on tällä käyttäjällä kesken
            if (is_numeric($path_parts['filename']) and $path_parts['filename'] == $kukarow['kesken']) {
                // Palautetaan kesken -key, jos tämä on meillä kesken
                $palautus["kesken"] = $path_parts["basename"];
                $palautus["seuraava"] = $path_parts["basename"];
                return $palautus;
            } elseif ($path_parts['filename'] == $kesken_chk_row['kesken']) {
                continue 2;
            }
        }
        // Jos halutaan ottaa seuraava lasku käsittelyyn, päivitetään kuka -tiedot
        if ($kasittele_seuraava != "") {
            // Tämän tiedoston voi käsitellä seuraavaksi, laitetaan se käyttäjälle keskeneräiseksi
            list($micro, $timestamp) = explode(" ", microtime());
            $file_basename = substr($timestamp . substr($micro * 10, 0, 1), 2);
            $kukarow['kesken'] = $file_basename;
            $file_new = $dir . "/" . $file_basename . "." . $path_parts['extension'];
            $query = "UPDATE kuka SET kesken = '{$kukarow["kesken"]}'\n                WHERE yhtio = '{$kukarow["yhtio"]}'\n                AND kuka    = '{$kukarow["kuka"]}'";
            $kesken_upd_res = pupe_query($query);
            if (!rename($file, $file_new)) {
                echo t("Ei pystytä nimeämään tiedostoa") . "<br>";
                return false;
            }
            // Otetaan path parts uudesta tiedostonimestä
            $path_parts = pathinfo($file_new);
        }
        // Tämän laskun voi käsitellä
        $palautus["seuraava"] = $path_parts["basename"];
        return $palautus;
    }
    // Ei löytynyt yhtään sopivaa laskua
    return false;
}
开发者ID:Hermut,项目名称:pupesoft,代码行数:56,代码来源:ulask.php


示例5: plugin_check_main

function plugin_check_main()
{
    global $themechecks, $data, $themename;
    $files = listdir(WP_PLUGIN_DIR);
    if ($files) {
        $css = array();
        $php = array();
        $other = array();
        foreach ($files as $key => $filename) {
            if (substr($filename, -4) == '.php') {
                if (strpos($filename, 'plugins/theme-check') == false && strpos($filename, 'plugins/akismet') == false && strpos($filename, 'plugins/plugin-check') == false) {
                    $php[$filename] = php_strip_whitespace($filename);
                }
            } else {
                if (substr($filename, -4) == '.css') {
                    if (strpos($filename, 'plugins/theme-check') == false && strpos($filename, 'plugins/akismet') == false && strpos($filename, 'plugins/plugin-check') == false) {
                        $css[$filename] = file_get_contents($filename);
                    }
                } else {
                    if (strpos($filename, 'plugins/theme-check') == false && strpos($filename, 'plugins/akismet') == false && strpos($filename, 'plugins/plugin-check') == false) {
                        $other[$filename] = file_get_contents($filename);
                    }
                }
            }
        }
        // run the checks
        $failed = !run_themechecks($php, $css, $other);
        global $checkcount;
        // second loop, to display the errors
        $plugins = get_plugins('/theme-check');
        $version = explode('.', $plugins['theme-check.php']['Version']);
        echo '<p>Running <strong>' . $checkcount . '</strong> tests against <strong>All Plugins</strong> using Theme-check Guidelines Version: <strong>' . $version[0] . '</strong> Plugin revision: <strong>' . $version[1] . '</strong></p>';
        $results = display_themechecks();
        $success = true;
        if (strpos($results, 'WARNING') !== false) {
            $success = false;
        }
        if (strpos($results, 'REQUIRED') !== false) {
            $success = false;
        }
        if ($success === false) {
            echo '<h2>' . __('One or more errors were found</h2>', 'themecheck');
        } else {
            echo '<h2>' . __('Your plugins have passed all the tests!', 'themecheck') . '</h2>';
            tc_success();
        }
        echo '<div class="tc-box">';
        echo '<ul class="tc-result">';
        echo $results;
        echo '</ul></div>';
    }
}
开发者ID:ryanurban,项目名称:Orbit,代码行数:52,代码来源:main.php


示例6: listdir

function listdir($dirname, $level=0){
	$ds = opendir($dirname);
	while($file = readdir($ds)){
		$path = $dirname.'/'.$file;
		if($file !='.' && $file != '..'){
			if(is_dir($path)){
				echo str_repeat('&nbsp;&nbsp', $level).'|--'.$file.'<br />';
				$level++;
				listdir($path);
			}else{
				echo str_repeat('&nbsp;&nbsp;', $level),'|--'.$file.'<br />';
			}
		}
	}
}
开发者ID:xiaoxiaoJun,项目名称:phpper,代码行数:15,代码来源:文件目录list01.php


示例7: listdir

function listdir($start_dir = '.')
{
    $files = array();
    if (is_dir($start_dir)) {
        $fh = opendir($start_dir);
        while (($file = readdir($fh)) !== false) {
            if (strcmp($file, '.') == 0 || strcmp($file, '..') == 0) {
                continue;
            }
            $filepath = $start_dir . '/' . $file;
            if (is_dir($filepath)) {
                $files = array_merge($files, listdir($filepath));
            } else {
                array_push($files, $filepath);
            }
        }
        closedir($fh);
    } else {
        $files = false;
    }
    return $files;
}
开发者ID:qqq232575,项目名称:extends,代码行数:22,代码来源:dabao.php


示例8: listdir

function listdir($dir, $dirs_stat)
{
    $dir = stripslashes($dir);
    $list = \OC\Files\Filesystem::getdirectorycontent($dir);
    if (sizeof($list) > 0) {
        $ret = '';
        foreach ($list as $i) {
            if ($i['type'] == 'dir' && $i['name'] != '.') {
                $ret .= '<li data-dir="' . $dir . '/' . $i['name'] . '" class="tree-' . $i['id'] . '"><a data-pathname="' . $dir . '/' . $i['name'] . '" class="ft_sesam"></a>';
                $ret .= '<a href="./?app=files&dir=' . $dir . '/' . $i['name'] . '" data-pathname="' . $dir . '/' . $i['name'] . '" class="ft_link">';
                $ret .= $i['name'] . '</a>';
                if (in_array($dir . '/' . $i['name'], $dirs_stat)) {
                    $ret .= listdir($dir . '/' . $i['name'], $dirs_stat);
                }
                $ret .= '</li>';
            }
        }
        if ($ret != '') {
            $ret = '<ul data-path="' . $dir . '">' . $ret . '</ul>';
        }
        return stripslashes($ret);
    }
}
开发者ID:ukitiyan,项目名称:files_tree,代码行数:23,代码来源:explore.php


示例9: listdir

function listdir($start_dir = '.')
{
    $files = array();
    if (isDir($start_dir)) {
        $fh = opendir($start_dir);
        while (($file = readdir($fh)) !== false) {
            # loop through the files, skipping . and .., and recursing if necessary
            if (strcmp($file, '.') == 0 || strcmp($file, '..') == 0) {
                continue;
            }
            $filepath = $start_dir . '/' . $file;
            if (isDir($filepath)) {
                $files = array_merge($files, listdir($filepath));
            } else {
                array_push($files, $filepath);
            }
        }
        closedir($fh);
    } else {
        # false if the function was called with an invalid non-directory argument
        $files = false;
    }
    return $files;
}
开发者ID:pc37utn,项目名称:misc_scripts,代码行数:24,代码来源:mkitemdir.php


示例10: listdir

function listdir($start_dir = '.', $root_dir = null)
{
    if ($root_dir === null) {
        $root_dir = $start_dir;
    }
    $files = array();
    if (is_dir($start_dir)) {
        $fh = opendir($start_dir);
        while (($file = readdir($fh)) !== false) {
            if ($file === '.' || $file === '..') {
                continue;
            }
            $filepath = $start_dir . '/' . $file;
            array_push($files, substr($filepath, strlen($root_dir) + 1));
            if (is_dir($filepath)) {
                $files = array_merge($files, listdir($filepath, $root_dir));
            }
        }
        closedir($fh);
    } else {
        $files = false;
    }
    return $files;
}
开发者ID:george-hopkins,项目名称:wzp_tools,代码行数:24,代码来源:wzp_pack.php


示例11: dirname

    echo "Voidaan ajaa vain komentoriviltä!!!\n";
    die;
}
if (!`which recode`) {
    echo "Tarvitaan recode -ohjelma!\n";
    die;
}
$vain_recode = FALSE;
if (isset($argv[1]) and $argv[1] != '') {
    $vain_recode = TRUE;
}
// Pupeasennuksen root
$pupe_root_polku = dirname(__FILE__);
require_once "inc/functions.inc";
// Konvertoidaan kaikki filet:
$files = listdir($pupe_root_polku);
$finfo1 = finfo_open(FILEINFO_MIME_TYPE);
$finfo2 = finfo_open(FILEINFO_MIME_ENCODING);
foreach ($files as $file) {
    if (strpos($file, "UTF8_konversio.php") !== FALSE) {
        continue;
    }
    $mime = finfo_file($finfo1, $file);
    $encd = finfo_file($finfo2, $file);
    if (substr($mime, 0, 4) == "text" and $encd != "utf-8" and $encd != "us-ascii") {
        $mitenmeni = system("recode ISO_8859-1..UTF8 {$file}");
        echo "{$file}, {$encd}\n";
    }
    if ($vain_recode) {
        continue;
    }
开发者ID:Hermut,项目名称:pupesoft,代码行数:31,代码来源:UTF8_konversio.php


示例12: render

    public function render()
    {
        ?>
		<div style="text-align:center;">
			<button type="button" id="import-btn" class="btn">
				<?php 
        echo "Import new zip files";
        ?>
			</button>
			<button type="button" id="update-btn" class="btn">
				<?php 
        echo "Update DB files";
        ?>
			</button>
		</div>
		<?php 
        $files = listdir($this->importpath);
        $fileszip = array();
        // read themelist files
        $themelist = array();
        foreach ($files as $f) {
            if (strpos($f, "themelist.csv") !== false) {
                if (($handle = fopen($f, "r")) !== FALSE) {
                    while (($data = fgetcsv($handle, 1000, ",")) !== FALSE) {
                        if (count($data) == 2) {
                            $zipfilename = $data[0];
                            $date = $data[1];
                            $themelist[$zipfilename] = $date;
                        }
                    }
                    fclose($handle);
                }
            }
        }
        $history = new History();
        $countNew = 0;
        $countTotal = 0;
        foreach ($files as $f) {
            $path_parts = pathinfo($f);
            if (isset($path_parts['extension']) && $path_parts['extension'] == "zip") {
                $zipfilename = $path_parts['basename'];
                if (isset($themelist[$zipfilename])) {
                    $timestamp = strtotime($themelist[$zipfilename]);
                    if ($timestamp > 946681200) {
                        $id = $history->getIdFromZipName($zipfilename);
                        if ($id === false) {
                            $fileszip[$f] = $timestamp;
                            $countNew++;
                        }
                        $countTotal++;
                    }
                }
            }
        }
        asort($fileszip);
        echo "<br/>Not imported yet : {$countNew} / {$countTotal}<hr>";
        foreach ($fileszip as $file => $timestamp) {
            echo date("Y-m-d", $timestamp) . ' : ' . $file . '<br>';
        }
        /*	$count = 0;
        		foreach ($fileszip as $f)
        		{
        			if ($count > 5) break;
        			if(USE_DB)
        			{
        				$hash_md5 = md5_file($f); 
        				$hash_alpha = base_convert($hash_md5, 16, 36); // shorten hash to shorten urls (better looking, less bandwidth)
        				while(strlen($hash_alpha) < 25) $hash_alpha = '0'.$hash_alpha;
        				$history = new History();
        				$themeInfo = $history->loadThemeFromHash($hash_alpha);
        				if (!empty($themeInfo)) continue;
        			}
        			
        			$path_parts = pathinfo($f);
        			$path_item = $path_parts['dirname'];
        			$filename = $path_parts['filename'].'.'.$path_parts['extension'];
        		
        			$themeInfo = FileValidator::prepareThemeInfo($path_item.'/'.$filename, $filename, 'application/zip', false);
        
        			if (!empty($themeInfo))
        			{
        				$this->fileValidator = new FileValidator($themeInfo);
        				$this->fileValidator->validate();	
        				$this->fileValidator->serialize();
        				
        				$this->validationResults = $this->fileValidator->getValidationResults(I18N::getCurLang());
        				$themeInfo = $this->fileValidator->themeInfo;
        				echo '<p>'.htmlspecialchars($themeInfo->name).' : '.intval($themeInfo->score).'%</p>';
        				$count++;
        			}
        		}*/
        ?>
		<script>
		var zips = new Array();
		var zip_index = 0;
		var theme_id_sart = 145;
		var theme_id = theme_id_sart;
		<?php 
        $a = array_keys($fileszip);
        for ($i = 0; $i < count($a); $i++) {
//.........这里部分代码省略.........
开发者ID:Vultur,项目名称:themecheck,代码行数:101,代码来源:controller_massimport.php


示例13: listdir

function listdir($dir, $level_count = 0)
{
    if (!@($thisdir = opendir($dir))) {
        return;
    }
    while ($item = readdir($thisdir)) {
        if (is_dir("{$dir}/{$item}") && substr("{$item}", 0, 1) != '.') {
            listdir("{$dir}/{$item}", $level_count + 1);
        }
    }
    if ($level_count > 0) {
        $dir = preg_replace("/\\/\\//", "/", $dir);
        $selected = isset($_GET['folder']) && $_GET['folder'] == $dir . '/' ? "selected='selected'" : "";
        $perm = substr(sprintf('%o', fileperms($dir)), -3);
        echo "<option value=\"" . $dir . "/\" {$selected}>[{$perm}] " . $dir . "/</option>\n";
    }
    return;
}
开发者ID:vzool,项目名称:php_srrFileManager,代码行数:18,代码来源:index.php


示例14: build_path

 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * 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 OpenMediaVault. If not, see <http://www.gnu.org/licenses/>.
 */
try {
    require_once "openmediavault/autoloader.inc";
    require_once "openmediavault/globals.inc";
    require_once "openmediavault/env.inc";
    require_once "openmediavault/functions.inc";
    // Load and initialize the RPC services that are not handled by the
    // engine daemon.
    $directory = build_path(DIRECTORY_SEPARATOR, $GLOBALS['OMV_DOCUMENTROOT_DIR'], "rpc");
    foreach (listdir($directory, "inc") as $path) {
        require_once $path;
    }
    $rpcServiceMngr =& \OMV\Rpc\ServiceManager::getInstance();
    $rpcServiceMngr->initializeServices();
    // Initialize the data models.
    $modelMngr = \OMV\DataModel\Manager::getInstance();
    $modelMngr->load();
    $session =& \OMV\Session::getInstance();
    $session->start();
    $server = new \OMV\Rpc\Proxy\Json();
    $server->handle();
    $server->cleanup();
} catch (\Exception $e) {
    if (isset($server)) {
        $server->cleanup();
开发者ID:svn2github,项目名称:omv2,代码行数:31,代码来源:rpc.php


示例15: listdiraux

        } else {
            if (is_dir($filepath)) {
                listdiraux($filepath, $files);
            }
        }
    }
    closedir($handle);
}
/*
* Clean up the documentation directory from prior use
*/
if (is_dir('documentation')) {
    deltree('documentation');
}
mkdir('documentation');
$files = listdir('documentation-base');
sort($files, SORT_LOCALE_STRING);
/*
* Loop through files in documentation-base directory, creating a mirror
* structure in documentation, and applying the post-process rules defined
* below
*/
foreach ($files as $f) {
    $r = str_replace('documentation-base', 'documentation', $f);
    $dList = explode('/', $r);
    $titleList = $dList;
    /*
     * Get rid of the initial directory
     */
    array_shift($titleList);
    $depth = count($dList) - 2;
开发者ID:gohanman,项目名称:ADOdb,代码行数:31,代码来源:fix-static-docs.php


示例16: listdir

function listdir($dir)
{
    $current_dir = opendir($dir);
    while ($entryname = readdir($current_dir)) {
        if (is_dir("{$dir}/{$entryname}") and ($entryname != "." and $entryname != "..")) {
            listdir("{$dir}/{$entryname}");
        } elseif ($entryname != "." and $entryname != "..") {
            unlink("{$dir}/{$entryname}");
        }
    }
    @closedir($current_dir);
    rmdir(${dir});
}
开发者ID:Hadryan,项目名称:L2LWEB,代码行数:13,代码来源:functions.inc.php


示例17: define

<?php

// libの読み込み spl_autoload_registerでは0番目のディレクトリを読まない
define('__PHP_LIBS__', __DIR__ . "/../private_html/src/App");
define('__JS_BASES__', __DIR__ . '/../private_html/templates/Elements');
$libs = [__DIR__ . "/../private_html/smarty/libs", __PHP_LIBS__];
// phpパスへの追加
ini_set('include_path', implode(PATH_SEPARATOR, array_merge([ini_get('include_path')], $libs)));
// classの自動読み込み,以後useだけでおk
require_once __PHP_LIBS__ . '/Functions/listdir.php';
spl_autoload_register(function () {
    foreach (listdir(__PHP_LIBS__, ['', 'php']) as $fileName) {
        require_once $fileName;
    }
});
// エラー表示設定
error_reporting(E_ALL ^ E_NOTICE);
// E_NOTICEは非表示
use src\App\DataBase\DataBase;
use src\App\Smarty\SmartyBase;
class Dispatcher extends SmartyBase
{
    private $controllerRoot = './../private_html/src/Controller';
    private $controllerFile;
    private $viewFile;
    private $readDir;
    /**
     * view と controller の読込先ディレクトリの設定
     */
    private function setReadDir($newReadDir)
    {
开发者ID:bass-clef,项目名称:negasei,代码行数:31,代码来源:start.php


示例18: bulk_submit

function bulk_submit($bulk_action, $d)
{
    global $_POST, $sqlpref, $d, $tbcolor1, $userdir, $tbcolor2;
    if (!$bulk_action) {
        $error .= "Please select an action.<br>\n";
    }
    if (!$_POST[filesel] && !$_POST[foldersel]) {
        $error .= "Please select at least one file to perform an action on.<br>\n";
    }
    if ($_POST[filesel] && $_POST[foldersel]) {
        $delvar = "files/folders and all of their content";
    } elseif ($_POST[filesel] && count($_POST[filesel]) > 1) {
        $delvar = "files";
    } elseif ($_POST[foldersel] && count($_POST[foldersel]) > 1) {
        $delvar = "folders and all of their content";
    } elseif ($_POST[filesel]) {
        $delvar = "file";
    } elseif ($_POST[foldersel]) {
        $delvar = "folder and all of its contents";
    }
    if (!$error && $bulk_action == "delete") {
        page_header("Delete");
        opentitle("Delete");
        opentable("100%");
        echo "<table border=\"0\" cellpadding=\"2\" cellspacing=\"0\" width=100%>\n" . "<form name=bulk_action action=\"?p=bulk_action\" method=post>\n" . "<tr><td><font class=error>Are you sure you want to delete the following {$delvar}?</font><br>\n" . "<tr><td bgcolor={$tbcolor1}>\n";
        $a = 0;
        $b = 0;
        if (is_array($_POST[filesel])) {
            foreach ($_POST[filesel] as $file) {
                echo "{$file} <input type=hidden name=filesel[{$a}] value={$file}><br>\n";
                $a++;
            }
        }
        if (is_array($_POST[foldersel])) {
            foreach ($_POST[foldersel] as $file) {
                echo "{$file}<input type=hidden name=foldersel[{$b}] value={$file}><br>\n";
                $b++;
            }
        }
        echo "<tr><td align=center><br><a href=\"javascript:document.bulk_action.submit();\">Yes</a> | \n" . "<a href=\"?p=home\"> No </a>\n" . "<input type=hidden name=bulk_action value=\"{$bulk_action}\">\n" . "<input type=hidden name=d value=\"{$d}\">\n" . "</td></tr></form></table>\n";
        closetable();
        page_footer();
    } elseif (!$error && $bulk_action == "move") {
        page_header("Move");
        opentitle("Move");
        opentable("100%");
        echo "<table border=\"0\" cellpadding=\"2\" cellspacing=\"0\" width=100%>\n" . "<form name=bulk_action action=\"?p=bulk_action\" method=post>\n" . "<tr><td>Move {$delvar}:\n" . "<tr><td bgcolor={$tbcolor1}>\n";
        $a = 0;
        $b = 0;
        if (is_array($_POST[filesel])) {
            foreach ($_POST[filesel] as $file) {
                echo "{$file} <input type=hidden name=filesel[{$a}] value={$file}><br>\n";
                $a++;
            }
        }
        if (is_array($_POST[foldersel])) {
            foreach ($_POST[foldersel] as $file) {
                echo "{$file}<input type=hidden name=foldersel[{$b}] value={$file}><br>\n";
                $b++;
            }
        }
        echo "<tr><td><select name=ndir size=1>\n" . "<option value=\"" . substr($item, strlen($userdir . $d)) . "/\">" . substr($item, strlen($userdir . $d)) . "/</option>";
        $content = listdir($userdir);
        asort($content);
        foreach ($content as $item) {
            echo "<option value=\"" . substr($item, strlen($userdir)) . "/\">" . substr($item, strlen($userdir)) . "/</option>\n";
        }
        echo "</select> " . "<input type=\"Submit\" value=\"Move\" class=\"button\">\n" . "<input type=hidden name=bulk_action value=\"{$bulk_action}\">\n" . "<input type=hidden name=d value=\"{$d}\">\n" . "</td></tr></form></table>\n";
        closetable();
        page_footer();
    } elseif (!$error && $bulk_action == "chmod") {
        page_header("Change Permissions");
        opentitle("Change Permissions");
        opentable("100%");
        echo "<table border=\"0\" cellpadding=\"2\" cellspacing=\"0\" width=100%>\n" . "<form name=bulk_action action=\"?p=bulk_action\" method=post>\n" . "<tr><td>Change Permissions of {$delvar}:\n" . "<tr><td bgcolor={$tbcolor1}>\n";
        $a = 0;
        $b = 0;
        if (is_array($_POST[filesel])) {
            foreach ($_POST[filesel] as $file) {
                echo "{$file} <input type=hidden name=filesel[{$a}] value={$file}><br>\n";
                $a++;
            }
        }
        if (is_array($_POST[foldersel])) {
            foreach ($_POST[foldersel] as $file) {
                echo "{$file}<input type=hidden name=foldersel[{$b}] value={$file}><br>\n";
                $b++;
            }
        }
        if (is_array($_POST[filesel])) {
            $keys = array_keys($_POST[filesel]);
            $chval = substr(sprintf('%o', @fileperms($userdir . $d . $_POST[filesel][$keys[0]])), -4);
        } else {
            $keys = array_keys($_POST[foldersel]);
            $chval = substr(sprintf('%o', @fileperms($userdir . $d . $_POST[foldersel][$keys[0]])), -4);
        }
        echo "<tr><td><br><table cellpadding=0 cellspacing=0>\n" . "<tr><td><input type=text width=20 size=20 name=ndir value=\"{$chval}\">\n" . "<br><br><input type=\"Submit\" value=\"Change\" class=\"button\">\n" . "<input type=hidden name=bulk_action value=\"{$bulk_action}\">\n" . "<input type=hidden name=d value=\"{$d}\">\n" . "</td></tr></form></table></table>\n";
        closetable();
        page_footer();
    } else {
//.........这里部分代码省略.........
开发者ID:hasanarbsq,项目名称:osfilemanager,代码行数:101,代码来源:index.php


示例19: listdiraux

}
function listdiraux($dir, &$files)
{
    $handle = opendir($dir);
    while (($file = readdir($handle)) !== false) {
        if ($file == '.' || $file == '..') {
            continue;
        }
        $filepath = $dir == '.' ? $file : $dir . '/' . $file;
        if (is_link($filepath)) {
            continue;
        }
        if (is_file($filepath)) {
            $files[] = $filepath;
        } else {
            if (is_dir($filepath)) {
                listdiraux($filepath, $files);
            }
        }
    }
    closedir($handle);
}
$files = listdir('.');
sort($files, SORT_LOCALE_STRING);
foreach ($files as $f) {
    if (strstr($f, '.yml')) {
        //if (!$entry['handle'] = fopen($path,'r')) $entry['handle'] = "FAIL";
        echo $f, "\n";
    }
    //    echo  $f, "\n";
}
开发者ID:niieani,项目名称:napkin,代码行数:31,代码来源:dirlist.php


示例20: url_encode

    exit;
    /* --// some extra images */
    /* yellow folder */
    // $img = 'R0lGODlhEgAQAOfRAAAAAAAAAAAAAAAAAP//AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMzMzAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAJmZmQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP///wAAAAAAAAAAAAAAAAAAAP///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////yH5BAEKAP8ALAAAAAASABAAAAhhAP8JHEiwYMEqCBEaNFhFBQGHKqosHNjwocWICRVSjMaxo0eOVaxtvEjSYciNEEs+PCmwSjSVKVn+c5my5kqRLV/ajIlzZrSdF2W6hGlRaMajGXv+s8a0qVOnE6NKnfovIAA7';
    /* binary image */
    // $img = 'R0lGODlhEAAQAOMAAISGhMbHxgAAAP///wAAhAD//wAA////AP///////////////////////////////yH5BAEKAAgALAAAAAAQABAAAARcEMkJqq0zg8B7AEKGAENpfqBIEiyLhtpAFEb9SlhF1HYVkgMggGe4kTY+z0cAGFkCgqg06huVBATmBRnaGbACk6nqJUBBh6ixtNFWOClrEDqVUtgwwCE+mUr8GREAOw==';
    /* blank document */
    // $img = 'R0lGODlhEgAQAMIDAMbDxoSChAAAAP///////////////////yH5BAEKAAQALAAAAAASABAAAAM6SLHc9PCFQSsFIcJpKxiZxnWDYAoiaQFoNKpsql7tNtPyHLv3sNu3n6QnVBBrwyBSAWg6n8WTdIpMAAA7';
    /* //-- */
}
function url_encode($url)
{
    return eregi_replace('[+]', '%20', urlencode($url));
}
switch ($_GET['p']) {
    case "source":
        showsource($_GET['file']);
        break;
    case "thumb":
        makethumb(base64_decode($_GET['file']), $GLOBALS['CONFIG']['THUMB_HEIGHT'], $GLOBALS['CONFIG']['THUMB_WIDTH']);
        break;
    case "mime":
        getmimefile($_GET['type']);
        break;
    case "logo":
        getmimefile('logo');
        break;
    default:
        listdir($dir);
        break;
}
开发者ID:artemeliy,项目名称:inf4715,代码行数:31,代码来源:index.php



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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