La clase PharData

(PHP 5 >= 5.3.0, PHP 7, PHP 8, PECL phar >= 2.0.0)

Introducción

La clase PharData proporciona una interfaz de alto nivel para el acceso y la creación de archivos tar y zip no ejecutables. Debido a que estos archivos no contienen una rutina de interoperabilidad y no pueden ser ejecutados por la extensión phar, es posible crear y manipular ficheros zip y tar normales con la clase PharData incluso si la opción del php.ini phar.readonly está establecida a 1.

Sinopsis de la Clase

class PharData extends Phar {
/* Métodos */
addEmptyDir(string $dirname): bool
public Phar::addFile(string $file, string $localname = ?): void
addFromString(string $localname, string $contents): bool
public Phar::buildFromDirectory(string $base_dir, string $regex = ?): array
buildFromIterator(Iterator $iter, string $base_directory = ?): array
compress(int $compression, string $extension = ?): object
compressFiles(int $compression): bool
__construct(
    string $fname,
    int $flags = ?,
    string $alias = ?,
    int $format = Phar::TAR
)
convertToData(int $format = ?, int $compression = ?, string $extension = ?): PharData
convertToExecutable(int $format = ?, int $compression = ?, string $extension = ?): Phar
copy(string $oldfile, string $newfile): bool
decompress(string $extension = ?): object
delete(string $entry): bool
extractTo(string $pathto, string|array $files = ?, bool $overwrite = false): bool
offsetSet(string $offset, string $value): void
setDefaultStub(string $index = ?, string $webindex = ?): bool
public Phar::setMetadata(mixed $metadata): void
setStub(string $stub, int $len = -1): bool
/* Métodos heredados */
public Phar::addEmptyDir(string $dirname): void
public Phar::addFile(string $file, string $localname = ?): void
public Phar::addFromString(string $localname, string $contents): void
final public static Phar::apiVersion(): string
public Phar::buildFromDirectory(string $base_dir, string $regex = ?): array
public Phar::buildFromIterator(Iterator $iter, string $base_directory = ?): array
final public static Phar::canCompress(int $type = 0): bool
final public static Phar::canWrite(): bool
public Phar::compress(int $compression, string $extension = ?): object
public Phar::compressFiles(int $compression): void
public Phar::__construct(string $fname, int $flags = ?, string $alias = ?)
public Phar::convertToData(int $format = 9021976, int $compression = 9021976, string $extension = ?): PharData
public Phar::convertToExecutable(int $format = 9021976, int $compression = 9021976, string $extension = ?): Phar
public Phar::copy(string $oldfile, string $newfile): bool
public Phar::count(): int
final public static Phar::createDefaultStub(string $indexfile = ?, string $webindexfile = ?): string
public Phar::decompress(string $extension = ?): object
public Phar::delete(string $entry): bool
public Phar::extractTo(string $pathto, string|array $files = ?, bool $overwrite = false): bool
final public static Phar::getSupportedCompression(): array
final public static Phar::getSupportedSignatures(): array
final public static Phar::interceptFileFuncs(): void
public Phar::isFileFormat(int $format): bool
final public static Phar::isValidPharFilename(string $filename, bool $executable = true): bool
final public static Phar::loadPhar(string $filename, string $alias = ?): bool
final public static Phar::mapPhar(string $alias = ?, int $dataoffset = 0): bool
final public static Phar::mount(string $pharpath, string $externalpath): void
final public static Phar::mungServer(array $munglist): void
public Phar::offsetExists(string $offset): bool
public Phar::offsetGet(string $offset): int
public Phar::offsetSet(string $offset, string $value): void
public Phar::offsetUnset(string $offset): bool
final public static Phar::running(bool $retphar = true): string
public Phar::setAlias(string $alias): bool
public Phar::setDefaultStub(string $index = ?, string $webindex = ?): bool
public Phar::setMetadata(mixed $metadata): void
public Phar::setSignatureAlgorithm(int $sigtype, string $privatekey = ?): void
public Phar::setStub(string $stub, int $len = -1): bool
final public static Phar::unlinkArchive(string $archive): bool
final public static Phar::webPhar(
    string $alias = ?,
    string $index = "index.php",
    string $f404 = ?,
    array $mimetypes = ?,
    callable $rewrites = ?
): void
}

Tabla de contenidos

add a note add a note

User Contributed Notes

There are no user contributed notes for this page.
To Top