PHP Класс Habari\Media

Показать файл Открыть проект

Открытые свойства

Свойство Тип Описание
$silos

Открытые методы

Метод Описание
copy ( string $pathfrom, string $pathto ) : boolean Copy the asset using the specified from and to paths
delete ( string $path ) : boolean Delete the asset at the specified virtual path
dir ( string $path = '' ) : array Retrieve an array of media assets stored at a virtual path
get ( string $path, array $qualities = null ) : MediaAsset Get the MediaAsset stored at a virtual path
get_silo ( mixed &$silo, boolean $parse_path = false ) : habari\MediaSilo Return the instance of a silo
highlights ( mixed $path = null ) : array Return an array of highlighted (featured) assets from all silos
init_silos ( ) Initialize the internal list of silo instances
move ( string $pathfrom, string $pathto ) : boolean Move the asset using the specified from and to paths A shortcut for Media::copy() then Media::delete()
permissions ( mixed $path ) : array Return the permissions available to the current user on the specified path
prepare ( string $path ) : MediaAsset Fetch an empty MediaAsset with the available metadata keys pre-allocated $asset = Media::prepare('silotype/foo/bar'); foreach($asset->get_info() as $key => $value) echo "$key : $value";
put ( MediaAsset $filedata, string $path = null ) : boolean Store the asset at the specified virtual path

Описание методов

copy() публичный статический Метод

Copy the asset using the specified from and to paths
public static copy ( string $pathfrom, string $pathto ) : boolean
$pathfrom string The virtual path source
$pathto string The virtual path destination
Результат boolean true on success

delete() публичный статический Метод

Delete the asset at the specified virtual path
public static delete ( string $path ) : boolean
$path string The virtual path of the asset to delete
Результат boolean true on success

dir() публичный статический Метод

Retrieve an array of media assets stored at a virtual path
public static dir ( string $path = '' ) : array
$path string The virtual path of the directory to retrieve
Результат array A list of files and directories in that path

get() публичный статический Метод

Get the MediaAsset stored at a virtual path
public static get ( string $path, array $qualities = null ) : MediaAsset
$path string The virtual path of the file to retrieve
$qualities array Qualities of the image to return (such as 'thumbnail' or 'size')
Результат MediaAsset The requested asset

get_silo() публичный статический Метод

Return the instance of a silo
public static get_silo ( mixed &$silo, boolean $parse_path = false ) : habari\MediaSilo
$silo mixed A silo instance or the name of a silo
$parse_path boolean If true, parse the siloname from the path and return the remainder path by reference
Результат habari\MediaSilo The requested silo

highlights() публичный статический Метод

Return an array of highlighted (featured) assets from all silos
public static highlights ( mixed $path = null ) : array
$path mixed The name of a silo or a silo instance. If empty, all silos are returned.
Результат array An array of MediaAsset highlight assets

init_silos() публичный статический Метод

Initialize the internal list of silo instances
public static init_silos ( )

move() публичный статический Метод

Move the asset using the specified from and to paths A shortcut for Media::copy() then Media::delete()
public static move ( string $pathfrom, string $pathto ) : boolean
$pathfrom string The virtual path source
$pathto string The virtual path destination
Результат boolean true on success

permissions() публичный статический Метод

Return the permissions available to the current user on the specified path
public static permissions ( mixed $path ) : array
$path mixed The name of a silo or a silo instance.
Результат array An array of permission constants (read, write, etc.)

prepare() публичный статический Метод

Fetch an empty MediaAsset with the available metadata keys pre-allocated $asset = Media::prepare('silotype/foo/bar'); foreach($asset->get_info() as $key => $value) echo "$key : $value";
public static prepare ( string $path ) : MediaAsset
$path string The virtual path at which the asset will be stored
Результат MediaAsset An empty, intialized asset instance

put() публичный статический Метод

Store the asset at the specified virtual path
public static put ( MediaAsset $filedata, string $path = null ) : boolean
$filedata MediaAsset The asset to store
$path string The virtual path where the asset will be stored
Результат boolean true on success

Описание свойств

$silos статическое публичное свойство

static public $silos