问题描述
有什么方法可以获取 phar(对象)的内容,我的意思是一个字符串中的所有文件内容,并在将其保存到磁盘之前进行一些更改(例如混淆)?我知道 Phar::startBuffering,但要获得 ob_get_contents 那样的内容,我不知道..
$phar = new Phar('builddir/appname.phar',FilesystemIterator::CURRENT_AS_FILEINFO |
FilesystemIterator::KEY_AS_FILENAME,'builddir/appname.phar');
$phar->startBuffering();
$phar->buildFromDirectory('srcdir/');
$phar->setStub($phar->createDefaultStub('main.php'));
/*How to get the phar content in order to edit it here?*/
$phar->convertToExecutable(Phar::TAR);
$phar->compress(Phar::GZ);
$phar->stopBuffering();
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)