PHP Class Spatie\MediaLibrary\Filesystem

Afficher le fichier Open project: spatie/laravel-medialibrary Class Usage Examples

Protected Properties

Свойство Type Description
$config Illuminate\Contracts\Config\Repository
$filesystem Illuminate\Contracts\Filesystem\Factory

Méthodes publiques

Méthode Description
__construct ( Illuminate\Contracts\Filesystem\Factory $filesystems, Illuminate\Contracts\Config\Repository $config )
add ( string $file, Media $media, string $targetFileName = '' ) * Add a file to the mediaLibrary for the given media.
copyFromMediaLibrary ( Media $media, string $targetFile ) * Copy a file from the medialibrary to the given targetFile.
copyToMediaLibrary ( string $file, Media $media, boolean $conversions = false, string $targetFileName = '' ) * Copy a file to the medialibrary for the given $media.
getConversionDirectory ( Media $media ) : string * Return the directory where all conversions of the given media are stored.
getMediaDirectory ( Media $media, boolean $conversion = false ) : string * Return the directory where all files of the given media are stored.
getRemoteHeadersForFile ( string $file ) : array * Get the headers to be used when copying the given file to a remote filesytem.
removeFiles ( Media $media ) * Remove all files for the given media.
renameFile ( Media $media, string $oldName ) * Rename a file for the given media.

Method Details

__construct() public méthode

public __construct ( Illuminate\Contracts\Filesystem\Factory $filesystems, Illuminate\Contracts\Config\Repository $config )
$filesystems Illuminate\Contracts\Filesystem\Factory
$config Illuminate\Contracts\Config\Repository

add() public méthode

* Add a file to the mediaLibrary for the given media.
public add ( string $file, Media $media, string $targetFileName = '' )
$file string
$media Media
$targetFileName string

copyFromMediaLibrary() public méthode

* Copy a file from the medialibrary to the given targetFile.
public copyFromMediaLibrary ( Media $media, string $targetFile )
$media Media
$targetFile string

copyToMediaLibrary() public méthode

* Copy a file to the medialibrary for the given $media.
public copyToMediaLibrary ( string $file, Media $media, boolean $conversions = false, string $targetFileName = '' )
$file string
$media Media
$conversions boolean
$targetFileName string

getConversionDirectory() public méthode

* Return the directory where all conversions of the given media are stored.
public getConversionDirectory ( Media $media ) : string
$media Media
Résultat string

getMediaDirectory() public méthode

* Return the directory where all files of the given media are stored.
public getMediaDirectory ( Media $media, boolean $conversion = false ) : string
$media Media
$conversion boolean
Résultat string

getRemoteHeadersForFile() public méthode

* Get the headers to be used when copying the given file to a remote filesytem.
public getRemoteHeadersForFile ( string $file ) : array
$file string
Résultat array

removeFiles() public méthode

* Remove all files for the given media.
public removeFiles ( Media $media )
$media Media

renameFile() public méthode

* Rename a file for the given media.
public renameFile ( Media $media, string $oldName )
$media Media
$oldName string

Property Details

$config protected_oe property

protected Repository,Illuminate\Contracts\Config $config
Résultat Illuminate\Contracts\Config\Repository

$filesystem protected_oe property

protected Factory,Illuminate\Contracts\Filesystem $filesystem
Résultat Illuminate\Contracts\Filesystem\Factory