PHP 클래스 App\services\UploadsManager

파일 보기 프로젝트 열기: qloog/laravel5-backend 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$disk
$mimeDetect

공개 메소드들

메소드 설명
__construct ( Dflydev\ApacheMimeTypes\PhpRepository $mimeDetect )
createDirectory ( $folder ) : string Create a new directory
deleteDirectory ( $folder ) : string Delete a directory
deleteFile ( $path ) : string Delete a file
fileMimeType ( $path ) : null | string Return the mime type
fileModified ( $path ) : Carbon\Carbon Return the last modified time
fileSize ( $path ) Return the file size
fileWebpath ( $path ) : string Return the full web path to a file
folderInfo ( string $folder ) : array Return files and directories within a folder
saveFile ( $path, $content ) : string Save a file
uploadImage ( File $file, integer $width = 1440, null $height = null ) : string 上传图片,返回图片的相对路径

보호된 메소드들

메소드 설명
breadcrumbs ( $folder ) : array Return breadcrumbs to current folder
cleanFolder ( $folder ) : string Sanitize the folder name
fileDetails ( $path ) : array Return an array of file details for a file

메소드 상세

__construct() 공개 메소드

public __construct ( Dflydev\ApacheMimeTypes\PhpRepository $mimeDetect )
$mimeDetect Dflydev\ApacheMimeTypes\PhpRepository

breadcrumbs() 보호된 메소드

Return breadcrumbs to current folder
protected breadcrumbs ( $folder ) : array
$folder
리턴 array

cleanFolder() 보호된 메소드

Sanitize the folder name
protected cleanFolder ( $folder ) : string
$folder
리턴 string

createDirectory() 공개 메소드

Create a new directory
public createDirectory ( $folder ) : string
$folder
리턴 string

deleteDirectory() 공개 메소드

Delete a directory
public deleteDirectory ( $folder ) : string
$folder
리턴 string

deleteFile() 공개 메소드

Delete a file
public deleteFile ( $path ) : string
$path
리턴 string

fileDetails() 보호된 메소드

Return an array of file details for a file
protected fileDetails ( $path ) : array
$path
리턴 array

fileMimeType() 공개 메소드

Return the mime type
public fileMimeType ( $path ) : null | string
$path
리턴 null | string

fileModified() 공개 메소드

Return the last modified time
public fileModified ( $path ) : Carbon\Carbon
$path
리턴 Carbon\Carbon

fileSize() 공개 메소드

Return the file size
public fileSize ( $path )
$path

fileWebpath() 공개 메소드

Return the full web path to a file
public fileWebpath ( $path ) : string
$path
리턴 string

folderInfo() 공개 메소드

Return files and directories within a folder
public folderInfo ( string $folder ) : array
$folder string
리턴 array of [ 'folder' => 'path to current folder', 'folderName' => 'name of just current folder', 'breadCrumbs' => breadcrumb array of [ $path => $foldername ] 'folders' => array of [ $path => $foldername] of each subfolder 'files' => array of file details on each file in folder ]

saveFile() 공개 메소드

Save a file
public saveFile ( $path, $content ) : string
$path
$content
리턴 string

uploadImage() 공개 메소드

上传图片,返回图片的相对路径
public uploadImage ( File $file, integer $width = 1440, null $height = null ) : string
$file Symfony\Component\HttpFoundation\File\File
$width integer
$height null
리턴 string

프로퍼티 상세

$disk 보호되어 있는 프로퍼티

protected $disk

$mimeDetect 보호되어 있는 프로퍼티

protected $mimeDetect