PHP 클래스 Habari\Media

파일 보기 프로젝트 열기: habari/system

공개 프로퍼티들

프로퍼티 타입 설명
$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