C# 클래스 Pchp.Library.Streams.StreamWrapper

Abstract base class for PHP stream wrappers. Descendants define methods implementing fopen, stat, unlink, rename, opendir, mkdir and rmdir for different stream types.
Each script has its own copy of registeredWrappers stored in the context.

PhpStream is created by a StreamWrapper on a call to fopen(). Wrappers are stateless: they provide an instance of PhpStream on fopen() and an instance of DirectoryListing on opendir().

상속: IDisposable
파일 보기 프로젝트 열기: iolevel/peachpie 1 사용 예제들

공개 메소드들

메소드 설명
Dispose ( ) : void

Release wrapper resources

GetSystemWrapperSchemes ( ) : ICollection

Gets the list of built-in stream wrapper schemes.

GetWrapper ( Context ctx, string scheme, StreamOptions options ) : StreamWrapper

Retreive the corresponding StreamWrapper respectind the scheme portion of the given path. If no scheme is specified, an instance of FileStreamWrapper is returned.

Listing ( string path, StreamListingOptions options, StreamContext context ) : string[]
MakeDirectory ( string path, int accessMode, StreamMakeDirectoryOptions options, StreamContext context ) : bool StreamMakeDirectoryOptions for the list of additional options.
OnClose ( PhpStream stream ) : void

Wrapper may be notified of closing a stream using this method.

OnStat ( PhpStream stream ) : PhpArray

Wrapper may override the stat()ing of a stream using this method.

Open ( Context ctx, string &path, string mode, StreamOpenOptions options, StreamContext context ) : PhpStream
ParseMode ( string mode, StreamOpenOptions options, FileMode &fileMode, FileAccess &fileAccess, StreamAccessOptions &accessOptions ) : bool

Parse the mode argument passed to fopen() and make the appropriate FileMode and FileAccess combination. Integrate the relevant options from StreamOpenOptions too.

RegisterSystemWrapper ( StreamWrapper wrapper ) : bool

Register a new system wrapper

RemoveDirectory ( string path, StreamRemoveDirectoryOptions options, StreamContext context ) : bool
Rename ( string fromPath, string toPath, StreamRenameOptions options, StreamContext context ) : bool
Stat ( string path, StreamStatOptions options, StreamContext context, bool streamStat ) : StatStruct
Unlink ( string path, StreamUnlinkOptions options, StreamContext context ) : bool StreamUnlinkOptions for the list of additional options.

비공개 메소드들

메소드 설명
CheckOptions ( StreamAccessOptions accessOptions, FileAccess supportedAccess, string path ) : bool

Checks whether the supported read/write access matches the reqiured one.

GetWrapperInternal ( Context ctx, string scheme ) : StreamWrapper

Search the lists of registered StreamWrappers to find the appropriate wrapper for a given scheme. When the scheme is empty, the FileStreamWrapper is returned.

ParseMode ( string mode, StreamOpenOptions options, StreamAccessOptions &accessOptions ) : bool

Overload of ParseMode(string, StreamOpenOptions, out FileMode, out FileAccess, out StreamAccessOptions) without the out arguments.

StatUnsupported ( ) : StatStruct

Reports warning and creates invalid stat.

메소드 상세

Dispose() 공개 메소드

Release wrapper resources
public Dispose ( ) : void
리턴 void

GetSystemWrapperSchemes() 공개 정적인 메소드

Gets the list of built-in stream wrapper schemes.
public static GetSystemWrapperSchemes ( ) : ICollection
리턴 ICollection

GetWrapper() 공개 정적인 메소드

Retreive the corresponding StreamWrapper respectind the scheme portion of the given path. If no scheme is specified, an instance of FileStreamWrapper is returned.
In case when the required wrapper can not be found.
public static GetWrapper ( Context ctx, string scheme, StreamOptions options ) : StreamWrapper
ctx Pchp.Core.Context Current runtime context.
scheme string The scheme portion of an URL.
options StreamOptions Additional having effect on the wrapper retreival.
리턴 StreamWrapper

Listing() 공개 메소드

public Listing ( string path, StreamListingOptions options, StreamContext context ) : string[]
path string
options StreamListingOptions
context StreamContext
리턴 string[]

MakeDirectory() 공개 메소드

StreamMakeDirectoryOptions for the list of additional options.
public MakeDirectory ( string path, int accessMode, StreamMakeDirectoryOptions options, StreamContext context ) : bool
path string
accessMode int
options StreamMakeDirectoryOptions
context StreamContext
리턴 bool

OnClose() 공개 메소드

Wrapper may be notified of closing a stream using this method.
public OnClose ( PhpStream stream ) : void
stream PhpStream
리턴 void

OnStat() 공개 메소드

Wrapper may override the stat()ing of a stream using this method.
public OnStat ( PhpStream stream ) : PhpArray
stream PhpStream The Wrapper-opened stream to be stat()ed.
리턴 Pchp.Core.PhpArray

Open() 공개 추상적인 메소드

public abstract Open ( Context ctx, string &path, string mode, StreamOpenOptions options, StreamContext context ) : PhpStream
ctx Pchp.Core.Context
path string
mode string
options StreamOpenOptions
context StreamContext
리턴 PhpStream

ParseMode() 공개 메소드

Parse the mode argument passed to fopen() and make the appropriate FileMode and FileAccess combination. Integrate the relevant options from StreamOpenOptions too.
public ParseMode ( string mode, StreamOpenOptions options, FileMode &fileMode, FileAccess &fileAccess, StreamAccessOptions &accessOptions ) : bool
mode string Mode as passed to fopen().
options StreamOpenOptions The passed to fopen().
fileMode FileMode Resulting specifying opening mode.
fileAccess FileAccess Resulting specifying read/write access options.
accessOptions StreamAccessOptions Resulting giving /// additional information to the stream opener.
리턴 bool

RegisterSystemWrapper() 공개 정적인 메소드

Register a new system wrapper
public static RegisterSystemWrapper ( StreamWrapper wrapper ) : bool
wrapper StreamWrapper An instance of the corresponding StreamWrapper descendant.
리턴 bool

RemoveDirectory() 공개 메소드

public RemoveDirectory ( string path, StreamRemoveDirectoryOptions options, StreamContext context ) : bool
path string
options StreamRemoveDirectoryOptions
context StreamContext
리턴 bool

Rename() 공개 메소드

public Rename ( string fromPath, string toPath, StreamRenameOptions options, StreamContext context ) : bool
fromPath string
toPath string
options StreamRenameOptions
context StreamContext
리턴 bool

Stat() 공개 메소드

public Stat ( string path, StreamStatOptions options, StreamContext context, bool streamStat ) : StatStruct
path string
options StreamStatOptions
context StreamContext
streamStat bool
리턴 StatStruct

Unlink() 공개 메소드

StreamUnlinkOptions for the list of additional options.
public Unlink ( string path, StreamUnlinkOptions options, StreamContext context ) : bool
path string
options StreamUnlinkOptions
context StreamContext
리턴 bool