PHP 클래스 org\bovigo\vfs\vfsStream

파일 보기 프로젝트 열기: mikey179/vfsstream 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$umask initial umask setting

공개 메소드들

메소드 설명
copyFromFileSystem ( string $path, vfsStreamDirectory $baseDir = null, integer $maxFileSize = 1048576 ) : vfsStreamDirectory copies the file system structure from given path into the base dir
create ( array $structure, vfsStreamDirectory $baseDir = null ) : vfsStreamDirectory creates vfsStream directory structure from an array and adds it to given base dir
disableDotfiles ( ) disable dotfiles in directory listings
enableDotfiles ( ) enable dotfiles in directory listings
getCurrentGroup ( ) : integer returns current group
getCurrentUser ( ) : integer returns current user
inspect ( org\bovigo\vfs\visitor\vfsStreamVisitor $visitor, org\bovigo\vfs\vfsStreamContent $content = null ) : org\bovigo\vfs\visitor\vfsStreamVisitor use visitor to inspect a content structure
newBlock ( string $name, integer $permissions = null ) : org\bovigo\vfs\vfsStreamBlock returns a new block with the given name
newDirectory ( string $name, integer $permissions = null ) : vfsStreamDirectory returns a new directory with given name
newFile ( string $name, integer $permissions = null ) : org\bovigo\vfs\vfsStreamFile returns a new file with given name
path ( string $url ) : string restores the path from the url
setQuota ( integer $bytes ) sets quota to given amount of bytes
setup ( string $rootDirName = 'root', integer $permissions = null, array $structure = [] ) : vfsStreamDirectory helper method for setting up vfsStream in unit tests
umask ( integer $umask = null ) : integer sets new umask setting and returns previous umask setting
url ( string $path ) : string prepends the scheme to the given URL
useDotfiles ( ) : boolean checks if vfsStream lists dotfiles in directory listings

보호된 메소드들

메소드 설명
addStructure ( array $structure, vfsStreamDirectory $baseDir ) : vfsStreamDirectory helper method to create subdirectories recursively

메소드 상세

addStructure() 보호된 정적인 메소드

helper method to create subdirectories recursively
protected static addStructure ( array $structure, vfsStreamDirectory $baseDir ) : vfsStreamDirectory
$structure array subdirectory structure to add
$baseDir vfsStreamDirectory directory to add the structure to
리턴 vfsStreamDirectory

copyFromFileSystem() 공개 정적인 메소드

If no baseDir is given it will try to add the structure to the existing root directory without replacing existing childs except those with equal names. File permissions are copied as well. Please note that file contents will only be copied if their file size does not exceed the given $maxFileSize which defaults to 1024 KB. In case the file is larger file content will be mocked, see https://github.com/mikey179/vfsStream/wiki/MockingLargeFiles.
또한 보기: https://github.com/mikey179/vfsStream/issues/4
부터: 0.11.0
public static copyFromFileSystem ( string $path, vfsStreamDirectory $baseDir = null, integer $maxFileSize = 1048576 ) : vfsStreamDirectory
$path string path to copy the structure from
$baseDir vfsStreamDirectory directory to add the structure to
$maxFileSize integer maximum file size of files to copy content from
리턴 vfsStreamDirectory

create() 공개 정적인 메소드

Assumed $structure contains an array like this: array('Core' = array('AbstractFactory' => array('test.php' => 'some text content', 'other.php' => 'Some more text content', 'Invalid.csv' => 'Something else', ), 'AnEmptyFolder' => array(), 'badlocation.php' => 'some bad content', ) ) the resulting directory tree will look like this:
baseDir
\- Core
 |- badlocation.php
 |- AbstractFactory
 | |- test.php
 | |- other.php
 | \- Invalid.csv
 \- AnEmptyFolder
Arrays will become directories with their key as directory name, and strings becomes files with their key as file name and their value as file content. If no baseDir is given it will try to add the structure to the existing root directory without replacing existing childs except those with equal names.
또한 보기: https://github.com/mikey179/vfsStream/issues/14
또한 보기: https://github.com/mikey179/vfsStream/issues/20
부터: 0.10.0
public static create ( array $structure, vfsStreamDirectory $baseDir = null ) : vfsStreamDirectory
$structure array directory structure to add under root directory
$baseDir vfsStreamDirectory base directory to add structure to
리턴 vfsStreamDirectory

disableDotfiles() 공개 정적인 메소드

disable dotfiles in directory listings
부터: 1.3.0
public static disableDotfiles ( )

enableDotfiles() 공개 정적인 메소드

enable dotfiles in directory listings
부터: 1.3.0
public static enableDotfiles ( )

getCurrentGroup() 공개 정적인 메소드

If the system does not support posix_getgid() the current group will be root (0).
public static getCurrentGroup ( ) : integer
리턴 integer

getCurrentUser() 공개 정적인 메소드

If the system does not support posix_getuid() the current user will be root (0).
public static getCurrentUser ( ) : integer
리턴 integer

inspect() 공개 정적인 메소드

If the given content is null it will fall back to use the current root directory of the stream wrapper. Returns given visitor for method chaining comfort.
또한 보기: https://github.com/mikey179/vfsStream/issues/10
부터: 0.10.0
public static inspect ( org\bovigo\vfs\visitor\vfsStreamVisitor $visitor, org\bovigo\vfs\vfsStreamContent $content = null ) : org\bovigo\vfs\visitor\vfsStreamVisitor
$visitor org\bovigo\vfs\visitor\vfsStreamVisitor the visitor who inspects
$content org\bovigo\vfs\vfsStreamContent directory structure to inspect
리턴 org\bovigo\vfs\visitor\vfsStreamVisitor

newBlock() 공개 정적인 메소드

returns a new block with the given name
public static newBlock ( string $name, integer $permissions = null ) : org\bovigo\vfs\vfsStreamBlock
$name string name of the block device
$permissions integer permissions of block to create
리턴 org\bovigo\vfs\vfsStreamBlock

newDirectory() 공개 정적인 메소드

If the name contains slashes, a new directory structure will be created. The returned directory will always be the parent directory of this directory structure.
public static newDirectory ( string $name, integer $permissions = null ) : vfsStreamDirectory
$name string name of directory to create
$permissions integer permissions of directory to create
리턴 vfsStreamDirectory

newFile() 공개 정적인 메소드

returns a new file with given name
public static newFile ( string $name, integer $permissions = null ) : org\bovigo\vfs\vfsStreamFile
$name string name of file to create
$permissions integer permissions of file to create
리턴 org\bovigo\vfs\vfsStreamFile

path() 공개 정적인 메소드

restores the path from the url
public static path ( string $url ) : string
$url string vfsStream url to translate into path
리턴 string

setQuota() 공개 정적인 메소드

sets quota to given amount of bytes
부터: 1.1.0
public static setQuota ( integer $bytes )
$bytes integer

setup() 공개 정적인 메소드

Instead of vfsStreamWrapper::register(); vfsStreamWrapper::setRoot(vfsStream::newDirectory('root')); you can simply do vfsStream::setup() which yields the same result. Additionally, the method returns the freshly created root directory which you can use to make further adjustments to it. Assumed $structure contains an array like this: array('Core' = array('AbstractFactory' => array('test.php' => 'some text content', 'other.php' => 'Some more text content', 'Invalid.csv' => 'Something else', ), 'AnEmptyFolder' => array(), 'badlocation.php' => 'some bad content', ) ) the resulting directory tree will look like this:
root
\- Core
 |- badlocation.php
 |- AbstractFactory
 | |- test.php
 | |- other.php
 | \- Invalid.csv
 \- AnEmptyFolder
Arrays will become directories with their key as directory name, and strings becomes files with their key as file name and their value as file content.
또한 보기: https://github.com/mikey179/vfsStream/issues/14
또한 보기: https://github.com/mikey179/vfsStream/issues/20
부터: 0.7.0
public static setup ( string $rootDirName = 'root', integer $permissions = null, array $structure = [] ) : vfsStreamDirectory
$rootDirName string name of root directory
$permissions integer file permissions of root directory
$structure array directory structure to add under root directory
리턴 vfsStreamDirectory

umask() 공개 정적인 메소드

If no value is given only the current umask setting is returned.
부터: 0.8.0
public static umask ( integer $umask = null ) : integer
$umask integer new umask setting
리턴 integer

url() 공개 정적인 메소드

prepends the scheme to the given URL
public static url ( string $path ) : string
$path string path to translate to vfsStream url
리턴 string

useDotfiles() 공개 정적인 메소드

checks if vfsStream lists dotfiles in directory listings
부터: 1.3.0
public static useDotfiles ( ) : boolean
리턴 boolean

프로퍼티 상세

$umask 보호되어 있는 정적으로 프로퍼티

initial umask setting
protected static $umask