0
在线手册:中文 英文
<?php 
$phar 
= new Phar('go-pear.phar');
$phar->convertToExecutable(Phar::ZIP);

// 将解压.phar文件, 目录为文件名.


<?php 
if(is_file('go-pear.phar.gz'))
    
unlink('go-pear.phar.gz');

$phar = new Phar('D:\xampps\php\go-pear.phar',0,'go-pear.phar');
$phar->buildFromDirectory(dirname(__FILE__) . '/go-pear');
$phar->setStub($phar->createDefaultStub('index.php'));
$phar->compress(Phar::GZ);

// 将目录中的文件打包成phar文件.
0
在线手册:中文 英文