本文整理汇总了PHP中Illuminate\Filesystem\Filesystem::size方法的典型用法代码示例。如果您正苦于以下问题:PHP Filesystem::size方法的具体用法?PHP Filesystem::size怎么用?PHP Filesystem::size使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Illuminate\Filesystem\Filesystem
的用法示例。
在下文中一共展示了Filesystem::size方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: alreadyExists
/**
* Determine if routes already exists.
*
* @return boolean
*/
protected function alreadyExists()
{
$path = $this->getPath();
if (!$this->is52or51() && $this->files->exists($path)) {
return $this->files->size($path) !== 504;
}
return $this->files->exists($path);
}
示例2: attach
/**
* Attach files to be uploaded.
*
* @param array $files
*
* @return \Dingo\Api\Dispatcher
*/
public function attach(array $files)
{
foreach ($files as $key => $file) {
if (is_array($file)) {
$file = new UploadedFile($file['path'], basename($file['path']), $file['mime'], $file['size']);
} elseif (is_string($file)) {
$finfo = finfo_open(FILEINFO_MIME_TYPE);
$file = new UploadedFile($file, basename($file), finfo_file($finfo, $file), $this->files->size($file));
} elseif (!$file instanceof UploadedFile) {
continue;
}
$this->uploads[$key] = $file;
}
return $this;
}
示例3: size
/**
* Get the file size of a given file.
*
* @param string $path
* @return int
* @static
*/
public static function size($path)
{
return \Illuminate\Filesystem\Filesystem::size($path);
}
示例4: size
/**
* @param $path
* @return int
*/
public function size($path)
{
return $this->storage->size($this->storagePath($path));
}
示例5: sendImage
private function sendImage($path)
{
$image = $this->files->get($path);
return response()->make($image, 200, ['Content-Type' => 'image/png', 'Cache-Control' => 'public, max-age=157788000', 'Content-Length' => $this->files->size($path), 'Last-Modified' => 'Tue, 11 Jan 2000 00:57:26 GMT', 'Expires' => date(DATE_RFC822, strtotime("720 day")), 'Vary' => 'Accept-Encoding']);
}
示例6: getFileSize
/**
* Get the size of the file located at the given path.
*
* @param string $path
*
* @return mixed
*/
protected function getFileSize($path)
{
return $this->filesystem->size($path);
}