本文整理汇总了PHP中filesystem::move方法的典型用法代码示例。如果您正苦于以下问题:PHP filesystem::move方法的具体用法?PHP filesystem::move怎么用?PHP filesystem::move使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类filesystem
的用法示例。
在下文中一共展示了filesystem::move方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: array
$_SESSION['cut_folders'] = array();
$_SESSION['cut_files'] = array();
break;
case 'paste':
while ($file = smartstrip(array_shift($_SESSION['cut_files']))) {
if ($file != $path . '/' . basename($file)) {
if (!$fs->has_write_permission($GO_SECURITY->user_id, $file)) {
$popup_feedback .= access_denied_box($file);
break;
} elseif (!$fs->has_write_permission($GO_SECURITY->user_id, $path)) {
$popup_feedback .= access_denied_box($path);
break;
} elseif ($fs->chroot_file_exists($path . '/' . basename($file))) {
if ($overwrite_destination_path == $path . '/' . basename($file) || $overwrite_all == 'true') {
if ($overwrite == "true") {
$fs->move($file, $path . '/' . basename($file));
}
} else {
array_unshift($_SESSION['cut_files'], $file);
$overwrite_source_path = $file;
$overwrite_destination_path = $path . '/' . basename($file);
$task = 'overwrite';
break;
}
} else {
$fs->move($file, $path . '/' . basename($file));
}
}
}
while ($file = smartstrip(array_shift($_SESSION['copy_files']))) {
if ($file != $path . '/' . basename($file)) {
示例2: basename
}
if ($filename == '') {
$filename = basename($_SESSION['email_tmp_file']);
} else {
$filename = smartstrip($filename);
}
if (isset($task) && $task == 'GO_HANDLER') {
require $GO_CONFIG->class_path . 'filesystem.class.inc';
$fs = new filesystem();
if (file_exists(smartstrip($_REQUEST['path']) . '/' . $filename)) {
$feedback = '<p class="Error">' . $fbNameExists . '</p>';
} elseif (!$fs->has_write_permission($GO_SECURITY->user_id, smartstrip($_REQUEST['path']))) {
$feedback = '<p class="Error">' . $strAccessDenied . ': ' . smartstrip($_REQUEST['path']) . '</p>';
} else {
$new_path = smartstrip($_REQUEST['path']) . '/' . $filename;
if ($fs->move($_SESSION['email_tmp_file'], $new_path)) {
$old_umask = umask(00);
chmod($new_path, $GO_CONFIG->create_mode);
umask($old_umask);
unset($_SESSION['tmp_account_id']);
unset($_SESSION['email_tmp_file']);
echo "<script type=\"text/javascript\" language=\"javascript\">\n";
echo "window.close()\n";
echo "</script>\n";
} else {
$feedback = '<p class="Error">' . $strSaveError . '</p>';
}
}
}
if (isset($_REQUEST['account_id'])) {
$_SESSION['tmp_account_id'] = $_REQUEST['account_id'];
示例3: rename
/**
* @en Rename a file or directory
* @ru Переименовывает файл или директорию
*
* $result = filesystem::move('file.txt', 'file-new.txt'); # bool(true) on success and bool(false) otherwise
*
* @param string $path_from
* @param string $path_to
*
* @return bool
*/
public static function rename($path_from, $path_to)
{
return filesystem::move($path_from, $path_to);
}