PharFileInfo
class PharFileInfo extends SplFileInfo (View source)
The PharFileInfo class provides a high-level interface to the contents and attributes of a single file within a phar archive.
Methods
(PHP >= 5.3.0, PECL phar >= 1.0.0)
Construct a Phar entry object
Gets an SplFileInfo object for the path
Gets an SplFileObject object for the file
Sets the class name used with SplFileInfo::openFile
Sets the class used with getFileInfo and getPathInfo
No description
(PHP >= 5.3.0, PECL phar >= 1.0.0)
Sets file-specific permission bits
(PHP >= 5.3.0, PECL phar >= 2.0.0)
Compresses the current Phar entry with either zlib or bzip2 compression
(PHP >= 5.3.0, PECL phar >= 2.0.0)
Decompresses the current Phar entry within the phar
(PHP >= 5.3.0, PECL phar >= 1.2.0)
Deletes the metadata of the entry
(PHP >= 5.3.0, PECL phar >= 1.0.0)
Returns the actual size of the file (with compression) inside the Phar archive
(PHP >= 5.3.0, PECL phar >= 1.0.0)
Returns CRC32 code or throws an exception if CRC has not been verified
No description
(PHP >= 5.3.0, PECL phar >= 1.0.0)
Returns file-specific meta-data saved with a file
(PHP >= 5.3.0, PECL phar >= 1.0.0)
Returns the Phar file entry flags
(PHP >= 5.3.0, PECL phar >= 1.2.0)
Returns the metadata of the entry
(PHP >= 5.3.0, PECL phar >= 1.0.0)
Returns whether the entry is compressed
(PHP >= 5.3.0, PECL phar >= 1.0.0)
Returns whether file entry has had its CRC verified
(PHP >= 5.3.0, PECL phar >= 1.0.0)
Sets file-specific meta-data saved with a file
Details
__construct(string $filename)
(PHP >= 5.3.0, PECL phar >= 1.0.0)
Construct a Phar entry object
string
getPath()
Gets the path without filename
string
getFilename()
Gets the filename
string
getExtension()
Gets the file extension
string
getBasename(string $suffix = '')
Gets the base name of the file
string
getPathname()
Gets the path to the file
int|false
getPerms()
Gets file permissions
int|false
getInode()
Gets the inode for the file
int|false
getSize()
Gets file size
int|false
getOwner()
Gets the owner of the file
int|false
getGroup()
Gets the file group
int|false
getATime()
Gets last access time of the file
int|false
getMTime()
Gets the last modified time
int|false
getCTime()
Gets the inode change time
string|false
getType()
Gets file type
bool
isWritable()
Tells if the entry is writable
bool
isReadable()
Tells if file is readable
bool
isExecutable()
Tells if the file is executable
bool
isFile()
Tells if the object references a regular file
bool
isDir()
Tells if the file is a directory
bool
isLink()
Tells if the file is a link
string|false
getLinkTarget()
Gets the target of a link
string|false
getRealPath()
Gets absolute path to file
SplFileInfo
getFileInfo(T> $class = null)
Gets an SplFileInfo object for the file
SplFileInfo|null
getPathInfo(T> $class = null)
Gets an SplFileInfo object for the path
SplFileObject
openFile(string $mode = 'r', bool $useIncludePath = false, resource $context = null)
Gets an SplFileObject object for the file
void
setFileClass(T> $class = SplFileObject::class)
Sets the class name used with SplFileInfo::openFile
void
setInfoClass(T> $class = SplFileInfo::class)
Sets the class used with getFileInfo and getPathInfo
string
__toString()
Returns the path to the file as a string
final void
_bad_state_ex()
No description
__wakeup()
No description
array
__debugInfo()
No description
__destruct()
No description
void
chmod(int $perms)
(PHP >= 5.3.0, PECL phar >= 1.0.0)
Sets file-specific permission bits
bool
compress(int $compression)
(PHP >= 5.3.0, PECL phar >= 2.0.0)
Compresses the current Phar entry with either zlib or bzip2 compression
bool
decompress()
(PHP >= 5.3.0, PECL phar >= 2.0.0)
Decompresses the current Phar entry within the phar
bool
delMetadata()
(PHP >= 5.3.0, PECL phar >= 1.2.0)
Deletes the metadata of the entry
int
getCompressedSize()
(PHP >= 5.3.0, PECL phar >= 1.0.0)
Returns the actual size of the file (with compression) inside the Phar archive
int
getCRC32()
(PHP >= 5.3.0, PECL phar >= 1.0.0)
Returns CRC32 code or throws an exception if CRC has not been verified
string
getContent()
No description
mixed
getMetadata(array $unserializeOptions = [])
(PHP >= 5.3.0, PECL phar >= 1.0.0)
Returns file-specific meta-data saved with a file
int
getPharFlags()
(PHP >= 5.3.0, PECL phar >= 1.0.0)
Returns the Phar file entry flags
bool
hasMetadata()
(PHP >= 5.3.0, PECL phar >= 1.2.0)
Returns the metadata of the entry
bool
isCompressed(int $compression = null)
(PHP >= 5.3.0, PECL phar >= 1.0.0)
Returns whether the entry is compressed
bool
isCRCChecked()
(PHP >= 5.3.0, PECL phar >= 1.0.0)
Returns whether file entry has had its CRC verified
void
setMetadata(mixed $metadata)
(PHP >= 5.3.0, PECL phar >= 1.0.0)
Sets file-specific meta-data saved with a file