PHP 클래스 Webiny\Component\Storage\Directory\Directory

상속: implements Webiny\Component\Storage\Directory\DirectoryInterface, implements IteratorAggregate, use trait Webiny\Component\StdLib\StdLibTrait, use trait Webiny\Component\EventManager\EventManagerTrait
파일 보기 프로젝트 열기: Webiny/Framework

보호된 프로퍼티들

프로퍼티 타입 설명
$items
$key
$recursive
$regex
$storage

공개 메소드들

메소드 설명
__construct ( string $key, Storage $storage, boolean $recursive = false, null | string $filter = null ) Constructor
count ( ) : integer Count number of items in a directory
delete ( $fireStorageEvents = true )
filter ( string $condition ) : Directory Filter items in a directory using given regex or extension.
getAbsolutePath ( ) : string Get absolute folder path
getIterator ( ) : Traversable (PHP 5 >= 5.0.0)
Retrieve an external iterator
getKey ( ) : string Get directory key
getSize ( ) Get directory size
getStorage ( ) : Storage Get Storage used by the DirectoryInterface instance
isDirectory ( ) : boolean Checks if file is a directory.

보호된 메소드들

메소드 설명
loadItems ( )
parseFilter ( $filter )

메소드 상세

__construct() 공개 메소드

Constructor
public __construct ( string $key, Storage $storage, boolean $recursive = false, null | string $filter = null )
$key string File key
$storage Webiny\Component\Storage\Storage Storage to use
$recursive boolean (Optional) By default, Directory will only read the first level if items. If set to true, Directory will read all children items and list them as one-dimensional array.
$filter null | string (Optional) Filter to use when reading directory items

count() 공개 메소드

Count number of items in a directory
public count ( ) : integer
리턴 integer

delete() 공개 메소드

public delete ( $fireStorageEvents = true )

filter() 공개 메소드

Example 1: '*.pdf' ($condition starting with * means: anything that ends with) Example 2: 'file*' ($condition ending with * means: anything that starts with) Example 3: Any file that ends with file.zip: '/(\S+)?file.zip/'
public filter ( string $condition ) : Directory
$condition string
리턴 Directory

getAbsolutePath() 공개 메소드

Get absolute folder path
public getAbsolutePath ( ) : string
리턴 string

getIterator() 공개 메소드

(PHP 5 >= 5.0.0)
Retrieve an external iterator
public getIterator ( ) : Traversable
리턴 Traversable An instance of an object implementing Iterator or Traversable

getKey() 공개 메소드

Get directory key
public getKey ( ) : string
리턴 string Directory key

getSize() 공개 메소드

WARNING! This is a very intensive operation especially on deep directory structures! It is performed by recursively walking through directory structure and getting each file's size.
public getSize ( )

getStorage() 공개 메소드

Get Storage used by the DirectoryInterface instance
public getStorage ( ) : Storage
리턴 Webiny\Component\Storage\Storage

isDirectory() 공개 정적인 메소드

Checks if file is a directory.
public static isDirectory ( ) : boolean
리턴 boolean

loadItems() 보호된 메소드

protected loadItems ( )

parseFilter() 보호된 메소드

protected parseFilter ( $filter )

프로퍼티 상세

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

protected $items

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

protected $key

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

protected $recursive

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

protected $regex

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

protected $storage