本文整理匯總了PHP中ImageManager::instance方法的典型用法代碼示例。如果您正苦於以下問題:PHP ImageManager::instance方法的具體用法?PHP ImageManager::instance怎麽用?PHP ImageManager::instance使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類ImageManager
的用法示例。
在下文中一共展示了ImageManager::instance方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: count
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('filename' => $item['name'], 'filepath' => FileManager::path_encode(str_replace(array($item['name'], DS), array($item['name'], '/'), $src)), 'thumbnail' => FileManager::path_encode(str_replace(array($item['name'], DS), array($item['name'], '/'), $dest)));
}
count($files) == 0 ? $data = array() : ($data = array('paginator' => array('pagesTotal' => $pages, 'pageCurrent' => $_REQUEST['page']), 'files' => $files));
echo json_encode($data);
示例2: 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'])));
$info = ImageManager::instance()->info($filename);
echo json_encode($info);