您好,欢迎来到三六零分类信息网!老站,搜索引擎当天收录,欢迎发信息

关于php的打包 解包 Phar

2024/12/2 2:04:12发布30次查看
最近用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的详细内容。
该用户其它信息

VIP推荐

免费发布信息,免费发布B2B信息网站平台 - 三六零分类信息网 沪ICP备09012988号-2
企业名录 Product