本文整理汇总了PHP中FileManager::convertToFileSystem方法的典型用法代码示例。如果您正苦于以下问题:PHP FileManager::convertToFileSystem方法的具体用法?PHP FileManager::convertToFileSystem怎么用?PHP FileManager::convertToFileSystem使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FileManager
的用法示例。
在下文中一共展示了FileManager::convertToFileSystem方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: explode
break;
case UPLOAD_ERR_OK:
if (!preg_match(',[[:cntrl:]]|[/\\:\\*\\?\\"\\<\\>\\|],', $_FILES['file']['name'])) {
$tempFile = $_FILES['file']['tmp_name'];
$targetPath = FileManager::clear_path(Manager::$conf['filesystem.files_abs_path'] . $_REQUEST['folder']);
$targetFile = $targetPath . $_FILES['file']['name'];
$s = Manager::$conf['filesystem.allowed_extensions'];
if ($s) {
$fileTypes = explode('|', strtolower(Manager::$conf['filesystem.allowed_extensions']));
} else {
$fileTypes = null;
}
$ext = FileManager::get_ext($_FILES['file']['name']);
if (!$fileTypes or in_array(strtolower($ext), $fileTypes)) {
move_uploaded_file(FileManager::convertToFileSystem($tempFile), FileManager::convertToFileSystem($targetFile));
chmod(FileManager::convertToFileSystem($targetFile), Manager::$conf['filesystem.file_chmod']);
} else {
$code = 4;
//Запрешенное расширение файла
}
} else {
$code = 5;
}
break;
}
} else {
$code = 1;
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
示例2: count
if (!is_dir($thumb_path)) {
FileManager::create_dir(FileManager::convertToGeniral($thumb_path));
}
/*
Формируем данные о по станичной навигации
*/
$start = ($_REQUEST['page'] - 1) * Manager::$conf['general.elements'];
$total = count($list);
$pages = ceil($total / Manager::$conf['general.elements']);
$list = array_slice($list, $start, Manager::$conf['general.elements']);
/*
Формируем список файлов для ответа
*/
foreach ($list as $item) {
//создаем превьюшки
$src = FileManager::clear_path(FileManager::convertToFileSystem(Manager::$conf['filesystem.files_abs_path'] . DS . $_REQUEST['path'] . DS . $item['name']));
$dest = '';
//$thumb_path.$item['name'];
//$width = Manager::$conf['thumbnail.width'];
//$height = Manager::$conf['thumbnail.hieght'];
//if (!file_exists($dest)){
//создаем превью
// if (!ImageManager::instance()->thunbnail($src, $dest, $width, $height)){
//если не удалось то выводим превью что просмотр не доступен
// $dest = 'pages/'.Manager::$conf['general.template'].'/img/error_thumbnails.gif';
// };
//}
$src = str_ireplace(Manager::$conf['filesystem.files_abs_path'], Manager::$conf['filesystem.path'], FileManager::convertToGeniral($src));
$dest = FileManager::convertToGeniral(str_ireplace(Manager::$conf['filesystem.files_abs_path'], Manager::$conf['filesystem.files_path'], $dest));
$files[] = array('fileext' => FileManager::get_ext($item['name']), 'filename' => $item['name'], 'filepath' => FileManager::path_encode(str_replace(array($item['name'], DS), array($item['name'], '/'), $src)), 'thumbnail' => '');
}
示例3: defined
* @package Cyber Image Manager
* @author Radik
* @copyright Copyright (c) 2010, Cyber Applications.
* @link http://www.cyberapp.ru/
* @since Version 1.1
* @file /includes/tasks/download_file.php
*/
/*
Защита от прямой загрузки
*/
defined('ACCESS') or die;
$file = FileManager::clear_path(Manager::$conf['filesystem.files_abs_path'] . DS . $_REQUEST['file']);
if (file_exists(FileManager::convertToFileSystem($file))) {
Manager::$conf['stream.mimes']['use_gzip'] = false;
//заружаем файл
$data = file_get_contents(FileManager::convertToFileSystem($file));
//получаем расширение файла
$ext = strtolower(FileManager::get_ext($file));
// Устанавливаем mime поумолчанию если не можем найти тип этого фала
if (!isset(Manager::$conf['stream.mimes'][$ext])) {
$mime = 'application/octet-stream';
} else {
$mime = is_array(Manager::$conf['stream.mimes'][$ext]) ? Manager::$conf['stream.mimes'][$ext][0] : Manager::$conf['stream.mimes'][$ext];
}
// Генирируем заголовки сервера
if (strstr($_SERVER['HTTP_USER_AGENT'], "MSIE")) {
header('Content-Type: "' . $mime . '"');
header('Content-Disposition: attachment; filename="' . basename($file) . '"');
header('Expires: 0');
header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
header("Content-Transfer-Encoding: binary");
示例4: defined
<?php
/**
* Cyber Image Manager
*
*
* @package Cyber Image Manager
* @author Radik
* @copyright Copyright (c) 2010, Cyber Applications.
* @link http://www.cyberapp.ru/
* @since Version 1.1
* @file /includes/tasks/del_file.php
*/
/*
Защита от прямой загрузки
*/
defined('ACCESS') or die;
echo json_encode(array('done' => FileManager::delete_file(FileManager::convertToFileSystem(FileManager::clear_path(Manager::$conf['filesystem.files_abs_path'] . DS . $_REQUEST['file'])))));
示例5: rename
public static function rename($old = '', $new = '')
{
return $old != '' && $new != '' && rename(FileManager::convertToFileSystem($old), FileManager::convertToFileSystem($new));
}
示例6: defined
<?php
/**
* Cyber Image Manager
*
*
* @package Cyber Image Manager
* @author Radik
* @copyright Copyright (c) 2010, Cyber Applications.
* @link http://www.cyberapp.ru/
* @since Version 1.1
* @file /includes/tasks/check_upload.php
*/
/*
Защита от прямой загрузки
*/
defined('ACCESS') or die;
header('Content-type: text/json; charset=' . Manager::$conf['general.char_set']);
$fileArray = array();
foreach ($_POST as $key => $value) {
if ($key != 'folder' && !empty($value)) {
$f = FileManager::clear_path(Manager::$conf['filesystem.files_abs_path'] . $_POST['folder'] . $value);
if (file_exists(FileManager::convertToFileSystem($f))) {
$fileArray[] = $key;
}
}
}
echo json_encode($fileArray);
示例7: defined
<?php
/**
* Cyber Image Manager
*
*
* @package Cyber Image Manager
* @author Radik
* @copyright Copyright (c) 2010, Cyber Applications.
* @link http://www.cyberapp.ru/
* @since Version 1.1
* @file /includes/tasks/get_info.php
*/
/*
Защита от прямой загрузки
*/
defined('ACCESS') or die;
header('Content-type: text/json; charset=' . Manager::$conf['general.char_set']);
$filename = FileManager::convertToFileSystem(urldecode(str_ireplace(Manager::$conf['filesystem.path'], Manager::$conf['filesystem.files_path'], $_POST['filename'])));
$types = Manager::$conf['stream.mimes'];
$types = htmlspecialchars($types[strtolower(FileManager::get_ext($filename))]);
$info = array('size' => filesize($filename), 'type' => $types);
echo json_encode($info);