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


PHP Files::makeFile方法代码示例

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


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

示例1: _delFile

 /**
  * Delete the relative file, and any thumbnails.
  * @param string $relative the relative file.
  * @return boolean true if deleted, false otherwise.
  */
 function _delFile($relative)
 {
     $fullpath = Files::makeFile($this->getImagesDir(), $relative);
     //check that the file is an image
     if ($this->config['validate_images'] == true) {
         if (!is_array($this->getImageInfo($fullpath))) {
             return false;
         }
         //hmmm not an Image!!???
     }
     $thumbnail = $this->getThumbName($fullpath);
     if (Files::delFile($fullpath)) {
         return Files::delFile($thumbnail);
     } else {
         return false;
     }
 }
开发者ID:BackupTheBerlios,项目名称:rheinaufcms-svn,代码行数:22,代码来源:ImageManager.php

示例2: ImageManager

 * relative to the base_dir given in config.inc.php
 * @author $Author$
 * @version $Id$
 * @package ImageManager
 */
require_once 'config.inc.php';
require_once 'Classes/ImageManager.php';
require_once 'Classes/Thumbnail.php';
//check for img parameter in the url
if (!isset($_GET['img'])) {
    exit;
}
$manager = new ImageManager($IMConfig);
//get the image and the full path to the image
$image = rawurldecode($_GET['img']);
$fullpath = Files::makeFile($manager->getBaseDir(), $image);
//not a file, so exit
if (!is_file($fullpath)) {
    exit;
}
$imgInfo = @getImageSize($fullpath);
//Not an image, send default thumbnail
if (!is_array($imgInfo)) {
    //show the default image, otherwise we quit!
    $default = $manager->getDefaultThumb();
    if ($default) {
        header('Location: ' . $default);
        exit;
    }
}
//if the image is less than the thumbnail dimensions
开发者ID:ryderonil,项目名称:pegawai,代码行数:31,代码来源:thumbs.php

示例3: js_fail

$image = $_GET['img'];
$fullpath = Files::makeFile($manager->getImagesDir(), $image);
//not a file, so exit
if (!is_file($fullpath)) {
    js_fail("File {$fullpath} does not exist.");
}
$imgInfo = @getImageSize($fullpath);
//Not an image, bail out.
if (!is_array($imgInfo)) {
    js_fail("File {$fullpath} is not an image.");
}
if (!isset($_GET['to'])) {
    $resized = $manager->getResizedName($fullpath, $_GET['width'], $_GET['height']);
    $_GET['to'] = $manager->getResizedName($image, $_GET['width'], $_GET['height'], FALSE);
} else {
    $resized = Files::makeFile($manager->getImagesDir(), $_GET['to']);
}
// Check to see if it already exists
if (is_file($resized)) {
    // And is newer
    if (filemtime($resized) >= filemtime($fullpath)) {
        js_success($_GET['to']);
    }
}
// resize (thumbnailer will do this for us just fine)
$thumbnailer = new Thumbnail($_GET['width'], $_GET['height']);
$thumbnailer->proportional = FALSE;
$thumbnailer->createThumbnail($fullpath, $resized);
// did it work?
if (is_file($resized)) {
    js_success($_GET['to']);
开发者ID:jwlynch,项目名称:openacs.core,代码行数:31,代码来源:resizer.php

示例4: getFullPath

 /**
  * Get the fullpath to a relative file.
  * @param string $relative the relative file.
  * @return string the full path, .ie. the base_dir + relative.
  */
 function getFullPath($relative)
 {
     return Files::makeFile($this->getBaseDir(), $relative);
 }
开发者ID:sourcefabric,项目名称:newscoop,代码行数:9,代码来源:AttachmentManager.php

示例5: processPaste

 function processPaste()
 {
     switch ($_GET['paste']) {
         case 'copyFile':
             $src = Files::makeFile($this->getImagesDir(), $_GET['srcdir'] . $_GET['file']);
             $file = $_GET['file'];
             $dest = Files::makeFile($this->getImagesDir(), $_GET['dir']);
             return Files::copyFile($src, $dest, $file);
             break;
         case 'copyDir':
             $basePath = $this->getImagesDir();
             $src = $_GET['srcdir'] . $_GET['file'];
             $dest = $_GET['dir'] . $_GET['file'];
             return Files::copyDir($basePath, $src, $dest);
             break;
         case 'moveFile':
             $src = Files::makePath($this->getImagesDir(), $_GET['srcdir'] . $_GET['file']);
             $dest = Files::makePath($this->getImagesDir(), $_GET['dir'] . $_GET['file']);
             return Files::rename($src, $dest);
             break;
         case 'moveDir':
             $src = Files::makeFile($this->getImagesDir(), $_GET['srcdir'] . $_GET['file']);
             $dest = Files::makeFile($this->getImagesDir(), $_GET['dir'] . $_GET['file']);
             return Files::rename($src, $dest);
             break;
     }
 }
开发者ID:vnotebaert,项目名称:qcmphp,代码行数:27,代码来源:ExtendedFileManager.php

示例6: ExtendedFileManager

    $insertMode = $_REQUEST['mode'];
}
if (!isset($insertMode)) {
    $insertMode = "image";
}
require_once 'config.inc.php';
require_once 'Classes/ExtendedFileManager.php';
require_once '../ImageManager/Classes/Thumbnail.php';
//check for img parameter in the url
if (!isset($_GET['img'])) {
    exit;
}
$manager = new ExtendedFileManager($IMConfig, $insertMode);
//get the image and the full path to the image
$image = rawurldecode($_GET['img']);
$fullpath = Files::makeFile($manager->getImagesDir(), $image);
//not a file, so exit
if (!is_file($fullpath)) {
    exit;
}
$imgInfo = @getImageSize($fullpath);
//Not an image, send default thumbnail
if (!is_array($imgInfo)) {
    //show the default image, otherwise we quit!
    $default = $manager->getDefaultThumb();
    if ($default) {
        header('Location: ' . $default);
        exit;
    }
}
//if the image is less than the thumbnail dimensions
开发者ID:grlf,项目名称:eyedock,代码行数:31,代码来源:thumbs.php

示例7: _delFile

 /**
  * Delete the relative file, and any thumbnails.
  * @param string $relative the relative file.
  * @return boolean true if deleted, false otherwise.
  */
 function _delFile($relative)
 {
     $fullpath = Files::makeFile($this->getBaseDir(), $relative);
     //check that the file is an image
     if ($this->config['validate_images']) {
         if (!is_array($this->getImageInfo($fullpath))) {
             return false;
         }
         //hmmm not an Image!!???
     }
     $thumbnail = $this->getThumbName($fullpath);
     if (Files::delFile($fullpath)) {
         //deleting from the DB
         global $_course;
         if (isset($_course) && !empty($_course) && isset($_course['code'])) {
             $document_path = substr($fullpath, strpos($fullpath, '/document/') + 9, strlen($fullpath));
             //   /shared_folder/4/name
             DocumentManager::delete_document($_course, $document_path, $fullpath);
         }
         return Files::delFile($thumbnail);
     } else {
         return false;
     }
 }
开发者ID:annickvdp,项目名称:Chamilo1.9.10,代码行数:29,代码来源:ImageManager.php

示例8: processRenames

 /**
  * Renames files if certain GET variables are set
  * @return bool
  */
 function processRenames()
 {
     if (!empty($_GET['rename']) && !empty($_GET['renameTo'])) {
         // new file name (without path and extension)
         $newName = Files::escape(rawurldecode($_GET['renameTo']));
         $newName = str_replace('.', '', $newName);
         // path to file (from base images directory)
         $oldName = rawurldecode($_GET['rename']);
         // strip parent dir ("..") to avoid escaping from base directiory
         $oldName = preg_replace('#\\.\\.#', '', $oldName);
         // path to old file
         $oldPath = Files::makeFile($this->getImagesDir(), $oldName);
         $ret = Files::renameFile($oldPath, $newName);
         if ($ret === true) {
             // delete old thumbnail
             Files::delFile($this->getThumbname($oldPath));
         }
         return $ret;
     }
     return null;
 }
开发者ID:BackupTheBerlios,项目名称:rheinaufcms-svn,代码行数:25,代码来源:ExtendedFileManager.php


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