本文整理汇总了PHP中UTIL_File::getFileSize方法的典型用法代码示例。如果您正苦于以下问题:PHP UTIL_File::getFileSize方法的具体用法?PHP UTIL_File::getFileSize怎么用?PHP UTIL_File::getFileSize使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UTIL_File
的用法示例。
在下文中一共展示了UTIL_File::getFileSize方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: moveTemporaryFile
public function moveTemporaryFile($tmpId, $title = '')
{
$tmp = BOL_FileTemporaryDao::getInstance()->findById($tmpId);
$tmpPath = BOL_FileTemporaryService::getInstance()->getTemporaryFilePath($tmpId);
if (!$tmp) {
throw new LogicException();
}
if (!UTIL_File::validateImage($tmp->filename)) {
throw new LogicException();
}
$image = new BOL_ThemeImage();
$image->addDatetime = time();
$image->title = $title;
$dimensions = getimagesize($tmpPath);
$image->dimensions = "{$dimensions[0]}x{$dimensions[1]}";
$image->filesize = UTIL_File::getFileSize($tmpPath);
$this->themeImageDao->save($image);
$ext = UTIL_File::getExtension($tmp->filename);
$imageName = 'theme_image_' . $image->getId() . '.' . $ext;
$newTempName = $tmp->filename . '.' . $ext;
rename($tmp->filename, $newTempName);
OW::getStorage()->copyFile($tmpPath, $this->userfileImagesDir . $imageName);
if (file_exists($newTempName)) {
unlink($newTempName);
}
BOL_FileTemporaryDao::getInstance()->deleteById($tmpId);
$image->setFilename($imageName);
$this->themeImageDao->save($image);
return $image;
}
示例2: foreach
foreach ($queryList as $query) {
try {
$db->query($query);
} catch (Exception $e) {
$logger->addEntry(json_encode($e));
}
}
$themeService = BOL_ThemeService::getInstance();
$images = $themeService->findAllCssImages();
foreach ($images as $image) {
try {
$path = $themeService->getUserfileImagesDir() . $image->getFilename();
if ($storage->fileExists($path)) {
if (get_class($storage) == 'UPDATE_AmazonCloudStorage') {
$tempPath = tempnam($themeService->getUserfileImagesDir(), 'themeTmpImage');
$info = $storage->copyFileToLocalFS($path, $tempPath);
$dimensions = getimagesize($tempPath);
$filesize = UTIL_File::getFileSize($tempPath);
unlink($tempPath);
} else {
$dimensions = getimagesize($path);
$filesize = UTIL_File::getFileSize($path);
}
$image->dimensions = "{$dimensions[0]}x{$dimensions[1]}";
$image->filesize = $filesize;
BOL_ThemeImageDao::getInstance()->save($image);
}
} catch (Exception $e) {
$logger->addEntry(json_encode($e));
}
}