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


PHP filesystem::getpath方法代码示例

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


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

示例1: urlencode

    echo "服务器真实地址如下:<br />\n";
    echo "当前文件路径:&nbsp;&nbsp;========>  " . __FILE__ . "<br />\n";
    echo "当前目录路径:&nbsp;&nbsp;========>  " . $path . "<br />\n";
    echo '<br>';
    echo "浏览路径:&nbsp;&nbsp;[<a href=\"" . $_SERVER['PHP_SELF'] . "{$multiple}\" target=_blank>打开浏览</a>]&nbsp;&nbsp;=====> " . $_SERVER['PHP_SELF'] . "<br />\n";
    echo '<br>';
}
echo "浏览路径:&nbsp;&nbsp;[<a href=\"?path=" . urlencode(___realpath($path . "/..")) . "{$multiple}\">上级目录</a>]&nbsp;&nbsp;" . ___shortpath(___realpath($path));
if ($multiple != null) {
    echo "&nbsp;&nbsp;[<a href=\"./multiple.php?type={$_GET['multiple']}&gopath=" . urlencode($path) . "\">选定</a>|<a href=\"./dlym.php?path=" . urlencode($path) . "\">关闭</a>]";
}
echo "&nbsp;&nbsp;[<a href=\"{$_SERVER['PHP_SELF']}?{$_SERVER['QUERY_STRING']}&logout\">注销</a>]\n";
echo '<br>';
echo '<br>';
echo "\n</div>\n";
if (($data = $filesystem->getpath()) === false) {
    echo "<div class=\"error\">抱歉,系统无法获取对应目录内容!</div>\n";
} elseif ($data === null) {
    echo "<div class=\"error\">抱歉,这是一个无内容的空目录哦!</div>\n";
    echo "<div class=\"love\">\n";
    echo "<form action=\"multiple.php?getcwd=" . urlencode($path) . "\" method=\"POST\">";
    echo "<select name=\"type\">\n";
    echo "<option value=\"list\">文件清单(管理)</option>\n";
    echo "<option value=\"move\">移动文件(多选)</option>\n";
    echo "<option value=\"copy\">复制文件(多选)</option>\n";
    echo "<option value=\"pkzip\">压缩文件(多选)</option>\n";
    echo "<option value=\"chmod\">权限修改(多选)</option>\n";
    echo "<option value=\"delete\">删除文件(多选)</option>\n";
    echo "<option value=\"create\">建立数据(目录)</option>\n";
    echo "<option value=\"upload\">本地远程(上传)</option>\n";
    echo "<option value=\"addlist\">文件清单(加入)</option>\n";
开发者ID:liuguogen,项目名称:weixin,代码行数:31,代码来源:dlym.php

示例2: header

<?php

require "config.php";
if (!isset($_GET['path'])) {
    header("Location: ./404.php");
    exit;
} elseif (($path = trim($_GET['path'])) == "") {
    header("Location: ./404.php");
    exit;
} elseif (!is_file($path) || !is_readable($path)) {
    header("Location: ./404.php");
    exit;
} else {
    $myfs = new filesystem($path);
    $info = $myfs->getpath();
    header("Content-Type: application/force-download");
    header("Content-Disposition: attachment; filename=" . ___basename($path));
    header("Accept-Ranges: bytes");
    header("Content-Length: " . $info['size']);
    $fp = fopen($path, "rb");
    while (!feof($fp)) {
        echo fread($fp, 4096);
    }
    fclose($fp);
}
开发者ID:simplesky,项目名称:course,代码行数:25,代码来源:dget.php

示例3: header

<?php

require "config.php";
if (!isset($_GET['path'])) {
    header("Location: ./404.php");
    exit;
} elseif (is_dir($path = ___realpath(trim($_GET['path'])))) {
    header("Location: ./404.php");
    exit;
}
$fs = new filesystem($path);
xhtml_head(___shortpath($path));
if (!($data = $fs->getpath($path))) {
    echo "<div class=\"error\">\n";
    echo "[<a href=\"./index.php?path=" . urlencode($getcwd) . "\">返回目录</a>]\n";
    echo "</div>\n";
} else {
    echo "<div class=\"love\">\n";
    echo "<a href=\"./index.php?path=" . urlencode(dirname($path)) . "\">[返回]</a>\n<br/>";
    echo "文件名称:" . ___basename($path) . "<br />\n";
    echo "文件大小:" . ___filesize($data['size']) . "<br />\n";
    echo "所有者ID:{$data['uid']}<br />\n";
    echo "所有组ID:{$data['gid']}<br />\n";
    echo "上次访问:" . gmdate("Y-m-d H:i:s", $data['atime'] + TIME) . "<br />\n";
    echo "上次修改:" . gmdate("Y-m-d H:i:s", $data['mtime'] + TIME) . "<br />\n";
    echo "上次改变:" . gmdate("Y-m-d H:i:s", $data['ctime'] + TIME) . "<br />\n";
    echo "</div>\n";
    echo "<div class=\"like\">\n";
    echo "爱特解压<a href=\"./index.php?new&path=" . urlencode(dirname($path)) . "&multiple=unpackdir&getcwd=" . urlencode($path) . "\">目标目录</a>\n";
    echo "</div>\n";
    echo "<div class=\"love\">\n";
开发者ID:simplesky,项目名称:course,代码行数:31,代码来源:file.php


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