您的位置 首页 技术

关于php的打包 解包 Phar

最近用php连接hive,找到了php-thrift-sql(https://github.com/Automattic/php-thrift-sql),发现readme里面有一句…

最近用php连接hive,找到了php-thrift-sql(https://github.com/Automattic/php-thrift-sql),发现readme里面有一句:第一次接触是韩老大的创建swooole打包文章

php -c php.ini build.php

因为php.ini中phar.readonly默认是on的,而我们这里需要解包打包使用,所以要配置如下

[Phar]; http://php.net/phar.readonlyphar.readonly = Off; http://php.net/phar.require-hash;phar.require_hash = On;phar.cache_list =

我们看代码里有一个ThriftSQL.phar,想知道使用应该要看看源码。那么怎么解包呢?

<?php$phar =new Phar("./ThriftSQL.phar");$re=$phar->extractTo("Thrift-origin");var_dump($re);

解包正确的话会返回true,这样路径下会多一个Thrift-origin的文件,

php returned.php bool(true)root@tongbo:/home/tb/tmpdown# lsci_3.1.30  ci.zip  php-thrift-sql  returned.php  Thrift-origin  ThriftSQL.pharroot@tongbo:/home/tb/tmpdown#

进入到Thrift-origin里面就可以看具体的php代码了。

推荐:《PHP教程》

以上就是关于php的打包 解包 Phar的详细内容,更多请关注24课堂在线网其它相关文章!

本文来自网络,不代表24小时课堂在线立场,转载请注明出处:https://www.24ketang.cn/14745.html

为您推荐

返回顶部