C# Class Pchp.Library.Streams.FileStreamWrapper

Derived from StreamWrapper, this class provides access to the local filesystem files.
The virtual working directory is handled by the PhpPath class in the Class Library. The absolute path resolution (using the working diretory and the include_path if necessary) and open-basedir check is performed by the PhpStream.ResolvePath method. This wrapper expects the path to be an absolute local filesystem path without the file:// scheme specifier.
Inheritance: StreamWrapper
Afficher le fichier Open project: iolevel/peachpie Class Usage Examples

Méthodes publiques

Méthode Description
Listing ( string path, StreamListingOptions options, StreamContext context ) : string[]
MakeDirectory ( string path, int accessMode, StreamMakeDirectoryOptions options, StreamContext context ) : bool
Open ( Context ctx, string &path, string mode, StreamOpenOptions options, StreamContext context ) : PhpStream
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

Private Methods

Méthode Description
BuildMode ( FileSystemInfo info, FileAttributes attributes, string path ) : FileModeFlags

Creates the UNIX-like file mode depending on the file or directory attributes.

BuildStatStruct ( FileSystemInfo info, FileAttributes attributes, string path ) : StatStruct

Creates a StatStruct from the StatStruct filling the common members (for files and directories) from the given FileSystemInfo class. The size member (numeric index 7) may be filled by the caller for when info is a FileInfo.

According to these outputs (PHP Win32): fstat(somefile.txt): [dev] => 0 [ino] => 0 [mode] => 33206 [nlink] => 1 [uid] => 0 [gid] => 0 [rdev] => 0 [size] => 24 [atime] => 1091131360 [mtime] => 1091051699 [ctime] => 1091051677 [blksize] => -1 [blocks] => -1 stat(somefile.txt): [dev] => 2 [ino] => 0 [mode] => 33206 // 0100666 [nlink] => 1 [uid] => 0 [gid] => 0 [rdev] => 2 [size] => 24 [atime] => 1091129621 [mtime] => 1091051699 [ctime] => 1091051677 [blksize] => -1 [blocks] => -1 stat(somedir): [st_dev] => 2 [st_ino] => 0 [st_mode] => 16895 // 040777 [st_nlink] => 1 [st_uid] => 0 [st_gid] => 0 [st_rdev] => 2 [st_size] => 0 [st_atime] => 1091109319 [st_mtime] => 1091044521 [st_ctime] => 1091044521 [st_blksize] => -1 [st_blocks] => -1

ToStatUnixTimeStamp ( FileSystemInfo info, System.DateTime>.Func utcTimeFunc ) : long

Adjusts UTC time of a file by adding Daylight Saving Time difference. Makes file times working in the same way as in PHP and Windows Explorer.

Method Details

Listing() public méthode

public Listing ( string path, StreamListingOptions options, StreamContext context ) : string[]
path string
options StreamListingOptions
context StreamContext
Résultat string[]

MakeDirectory() public méthode

public MakeDirectory ( string path, int accessMode, StreamMakeDirectoryOptions options, StreamContext context ) : bool
path string
accessMode int
options StreamMakeDirectoryOptions
context StreamContext
Résultat bool

Open() public méthode

public Open ( Context ctx, string &path, string mode, StreamOpenOptions options, StreamContext context ) : PhpStream
ctx Pchp.Core.Context
path string
mode string
options StreamOpenOptions
context StreamContext
Résultat PhpStream

RemoveDirectory() public méthode

public RemoveDirectory ( string path, StreamRemoveDirectoryOptions options, StreamContext context ) : bool
path string
options StreamRemoveDirectoryOptions
context StreamContext
Résultat bool

Rename() public méthode

public Rename ( string fromPath, string toPath, StreamRenameOptions options, StreamContext context ) : bool
fromPath string
toPath string
options StreamRenameOptions
context StreamContext
Résultat bool

Stat() public méthode

public Stat ( string path, StreamStatOptions options, StreamContext context, bool streamStat ) : StatStruct
path string
options StreamStatOptions
context StreamContext
streamStat bool
Résultat StatStruct

Unlink() public méthode

public Unlink ( string path, StreamUnlinkOptions options, StreamContext context ) : bool
path string
options StreamUnlinkOptions
context StreamContext
Résultat bool