コード例 #1
0
ファイル: ezpackage.php プロジェクト: jordanmanning/ezpublish
 function appendSimpleFile($key, $filepath)
 {
     if (!isset($this->Parameters['simple-file-list'])) {
         $this->Parameters['simple-file-list'] = array();
     }
     $suffix = eZFile::suffix($filepath);
     //$sourcePath = $fileInfo['original-path'];
     $packagePath = eZPackage::simpleFilesDirectory() . '/' . substr(md5(mt_rand()), 0, 8) . '.' . $suffix;
     $destinationPath = $this->path() . '/' . $packagePath;
     eZDir::mkdir(eZDir::dirpath($destinationPath), false, true);
     //SP DBfile
     $fileHandler = eZClusterFileHandler::instance();
     $fileHandler->fileFetch($filepath);
     eZFileHandler::copy($filepath, $destinationPath);
     $this->Parameters['simple-file-list'][$key] = array('original-path' => $filepath, 'package-path' => $packagePath);
 }