PHP Class App\services\UploadsManager

Afficher le fichier Open project: qloog/laravel5-backend Class Usage Examples

Protected Properties

Свойство Type Description
$disk
$mimeDetect

Méthodes publiques

Méthode Description
__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 上传图片,返回图片的相对路径

Méthodes protégées

Méthode Description
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

Method Details

__construct() public méthode

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

breadcrumbs() protected méthode

Return breadcrumbs to current folder
protected breadcrumbs ( $folder ) : array
$folder
Résultat array

cleanFolder() protected méthode

Sanitize the folder name
protected cleanFolder ( $folder ) : string
$folder
Résultat string

createDirectory() public méthode

Create a new directory
public createDirectory ( $folder ) : string
$folder
Résultat string

deleteDirectory() public méthode

Delete a directory
public deleteDirectory ( $folder ) : string
$folder
Résultat string

deleteFile() public méthode

Delete a file
public deleteFile ( $path ) : string
$path
Résultat string

fileDetails() protected méthode

Return an array of file details for a file
protected fileDetails ( $path ) : array
$path
Résultat array

fileMimeType() public méthode

Return the mime type
public fileMimeType ( $path ) : null | string
$path
Résultat null | string

fileModified() public méthode

Return the last modified time
public fileModified ( $path ) : Carbon\Carbon
$path
Résultat Carbon\Carbon

fileSize() public méthode

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

fileWebpath() public méthode

Return the full web path to a file
public fileWebpath ( $path ) : string
$path
Résultat string

folderInfo() public méthode

Return files and directories within a folder
public folderInfo ( string $folder ) : array
$folder string
Résultat 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() public méthode

Save a file
public saveFile ( $path, $content ) : string
$path
$content
Résultat string

uploadImage() public méthode

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

Property Details

$disk protected_oe property

protected $disk

$mimeDetect protected_oe property

protected $mimeDetect