本文整理汇总了PHP中filesystem::cppath方法的典型用法代码示例。如果您正苦于以下问题:PHP filesystem::cppath方法的具体用法?PHP filesystem::cppath怎么用?PHP filesystem::cppath使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类filesystem
的用法示例。
在下文中一共展示了filesystem::cppath方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: header
<?php
require "config.php";
if (!isset($_GET['path'])) {
header("Location: ./404.php");
exit;
} elseif (!file_exists($path = trim($_GET['path']))) {
header("Location: ./404.php");
exit;
}
xhtml_head("创建复件");
echo "[<a href=\"./dlym.php?path=" . urlencode(dirname($path)) . "\">返回目录</a>]\n";
if (isset($_GET['yes'])) {
$to = dirname($path) . "/" . ___basename($path) . "-copy";
if (file_exists($to)) {
echo "目标复件已经存在!";
} else {
$fs = new filesystem($path);
if ($fs->cppath($to)) {
echo "成功为您创建复件!";
} else {
echo "无法为您创建复件!";
}
}
} else {
echo "需要复件,<a href=\"?yes&path=" . urlencode($path) . "\">确认创建</a>?";
}
xhtml_footer();
示例2: urlencode
if (!isset($_GET['getcwd'])) {
$getcwd = OPEN;
} else {
$getcwd = ___realpath(trim($_GET['getcwd']));
}
xhtml_head("批量复制");
if (!is_dir($gopath = trim($_GET['gopath']))) {
echo "<div class=\"error\">\n";
echo "[<a href=\"./multiple.php?type=copy&getcwd=" . urlencode($getcwd) . "\">返回</a>]抱歉,目标目录非法!\n";
echo "</div>\n";
} elseif (count($_SESSION['flist']) < 1) {
echo "<div class=\"error\">\n";
echo "[<a href=\"./dlym.php?path=" . urlencode($getcwd) . "\">返回</a>]抱歉,文件清单为空!\n";
echo "</div>\n";
} else {
$i = 0;
$fs = new filesystem();
echo "<div class=\"like\">\n";
echo "<a href=\"./dlym.php?path=" . urlencode($getcwd) . "\">文件列表</a>(操作结果)\n";
echo "</div>";
while ($i < count($_SESSION['flist'])) {
$fs->chpath($_SESSION['flist'][$i]);
if ($fs->cppath($tmp = $gopath . "/" . ___basename($_SESSION['flist'][$i]))) {
echo "<div class=\"love\">[{$i}][√] - {$tmp}</div>\n";
} else {
echo "<div class=\"error\">[{$i}][×] - {$tmp}</div>\n";
}
$i++;
}
}
xhtml_footer();