The Phar class
(PHP >= 5.3.0, PECL phar >= 1.0.0)
소개
The Phar class provides a high-level interface to accessing and creating
phar archives.
클래스 개요
public void addFile
(
string $file
[,
string $localname
] )
public void addFromString
(
string $localname
,
string $contents
)
final public static bool canCompress
([
int $type
= 0
] )
final public static bool canWrite
(
void
)
public object compress
(
int $compression
[,
string $extension
] )
public __construct
(
string $fname
[,
int $flags
[,
string $alias
]] )
public PharData convertToData
([
int $format
= 9021976
[,
int $compression
= 9021976
[,
string $extension
]]] )
public Phar convertToExecutable
([
int $format
= 9021976
[,
int $compression
= 9021976
[,
string $extension
]]] )
public bool copy
(
string $oldfile
,
string $newfile
)
public int count
(
void
)
final public static string createDefaultStub
([
string $indexfile
[,
string $webindexfile
]] )
public bool delete
(
string $entry
)
public bool extractTo
(
string $pathto
[,
string|array $files
[,
bool $overwrite
= false
]] )
final public static bool loadPhar
(
string $filename
[,
string $alias
] )
final public static bool mapPhar
([
string $alias
[,
int $dataoffset
= 0
]] )
final public static void mount
(
string $pharpath
,
string $externalpath
)
final public static void mungServer
(
array $munglist
)
public void offsetSet
(
string $offset
,
string $value
)
final public static string running
([
bool $retphar
= true
] )
public bool setStub
(
string $stub
[,
int $len
= -1
] )
final public static void webPhar
([
string $alias
[,
string $index
= "index.php"
[,
string $f404
[,
array $mimetypes
[,
callable $rewrites
]]]]] )
}
Table of Contents
cornelius dot howl at gmail dot com ¶13 years ago
Onion utility can help you compile a package into a phar file (executable script file or library file)
https://github.com/c9s/Onion
$ onion.phar compile \
--executable \
--classloader \
--bootstrap scripts/onion.embed \
--lib src \
--lib ../CLIFramework/src \
--lib ../GetOptionKit/src \
--output onion.phar
halfdan ¶16 years ago
Hey, I thought writing a small article about the upcoming functionality and appearance of Phar in php5.3 might be a nice thing. So I did this at http://geekmonkey.org/articles/PHP_Archives - hope to save others some time when working with Phar.