作者:wayne251312 | 来源:互联网 | 2020-08-23 02:49
最近用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,想知道使用应该要看看源码。那么怎么解包呢?
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.phar
root@tongbo:/home/tb/tmpdown#
进入到Thrift-origin里面就可以看具体的php代码了。
推荐:《PHP教程》
以上就是关于php的打包 解包 Phar的详细内容,更多请关注 第一PHP社区 其它相关文章!