phar

Extracting files from .phar archive

守給你的承諾、 提交于 2019-12-20 08:47:46
问题 There is something I entirely missed as for phar files. I am installing a project that requires phpunit, pdepend and other dependencies. I fetched them as .phar files. But, I am not able ot extract the files from them using command line tool (php command). I googled the problem, and I found nothing really answering the question. Could anyone help ? 回答1: Yes, this library can do it: https://github.com/koto/phar-util phar-extract library.phar output-directory 回答2: Extending on @pozs’s answer,

Phar: re-use .htaccess-defined rewrite rules

徘徊边缘 提交于 2019-12-20 04:13:03
问题 My PHP project has a dozen URL rewriting rules listed in .htaccess. Now I want to provide the application as a .phar file and thus need to re-implement the rewrite rules the rewrite function that can be passed to Phar::webPhar() as 4th parameter. Is there a way to re-use the .htaccess rewrite rules in my php code without implementing them in PHP directly? Some library/extension/code that just "interprets" them? 回答1: Before packaging up the .phar file, I generate a PHP array of regex pattern

Error running make: missing separator (did you mean TAB instead of 8 spaces?)

纵然是瞬间 提交于 2019-12-18 13:38:40
问题 I'm trying to get PHP phar command line tool installed on my Debian VM, how here described: (1) download the php-src, I assume it's in /tmp/php/src (2) make the dir /tmp/phar (3) Save this as /tmp/php-src/ext/phar/Makefile. (4) cd /tmp/php-src/ext/phar (5) run sudo make Now after step 5 I get an error: :/tmp/php-src/ext/phar# make Makefile:11: *** missing separator (did you mean TAB instead of 8 spaces?). Stop. As I know, there can be two possible causes for this error message: Tabs in the

Installing Laravel 4.1 in Windows 7 // Make .phar file globally available to windows command line

大城市里の小女人 提交于 2019-12-17 21:57:23
问题 i have some problems installing Laravel 4.1 in Windows 7 via the first method explained in the Laravel documentation ( http://laravel.com/docs/installation#install-laravel ). So I downloaded the laravel.phar file and put it in my path ( System32 ). Which would be the equivalent of /usr/bin in linux based systems? ( I also added .PHAR in the PATHEXT system variable ). When i ran the laravel command from the command line it didn't know how to open it, so i chose to open it with php.exe. Now,

Cannot run Phar archives

 ̄綄美尐妖づ 提交于 2019-12-13 04:57:58
问题 On a RHEL server I cannot seem to run PhpUnit. Here are examples as root to illustrate the steps that I've tried to install PhpUnit and how it does not run: # wget https://phar.phpunit.de/phpunit.phar # chmod +x phpunit.phar # ./phpunit --version PHP Fatal error: require(): Failed opening required 'phar://phpunit-4.3.4.phar/phpunit/TextUI/Command.php' (include_path='.:') in /usr/local/bin/phpunit on line 592 PHP Stack trace: PHP 1. {main}() /usr/local/bin/phpunit:0 PHP 2. {closure}() /usr

Get name of current file inside Phar archive

纵饮孤独 提交于 2019-12-11 13:02:48
问题 I'm currently learning about PHP archives (Phars) and I know that in PHP __FILE__ always is the absolute filename of the currently executing file. But to which file does __FILE__ point to if the script is inside a Phar? Is it the absolute filename of the Phar itself, or the Phar-URL to the current script inside the Phar? For example: If I have a Phar located at /path/to/my.phar which contains a stub script, and a PHP script located at phar:///path/to/my.phar/inside/inner.php . What would _

How do I extract a .tar file in pure PHP on Windows?

十年热恋 提交于 2019-12-11 10:09:49
问题 I have a PHP script that I want to run on Windows. I need to extract a .tar file. How do I extract the tar file. I know of the PharData class and that works on Linux but not on Windows. My script just dies, no error output or anything. This same block of code runs on Linux. I'm using PHP 5.4.0 on Windows $phar_data = new PharData($out_filepath); $phar_data->extractTo($destination_folder); Is there an alternative pure PHP way to extract a .tar file? edit: I should say my real intent is to

Class 'PharData' not found

我的梦境 提交于 2019-12-11 05:15:37
问题 I get this error on my production server (CentOS 5.4 and php 5.3.5) : Warning: include_once(PharData.php): failed to open stream: No such file or directory in /var/www/ZendFramework/library/Zend/Loader.php on line 146 Warning: include_once(): Failed opening 'PharData.php' for inclusion (include_path='/var/www/fw:/var/www/vmms:/var/www/ZendFw/library:.:/usr/share/pear:/usr/share/php') in /var/www/ZendFw/library/Zend/Loader.php on line 146 Fatal error: Class 'PharData' not found in /var/www/vm

What are the benefits of the different PHP compression libraries?

不羁岁月 提交于 2019-12-11 01:36:00
问题 I've been looking into ways to compress PHP libraries, and I've found several libraries which might be useful, but I really don't know much about them. I've specifically been reading about bcompiler and PHAR libraries. Is there any performance benefit in either of these? Are there any "gotchas" I need to watch out for? What are the relative benefits? Do either of them add to/detract from performance? I'm also interested in learning of other libs which might be out there which are not obvious

How PHAR signature prevents tampering with files?

橙三吉。 提交于 2019-12-11 01:26:26
问题 I am wondering if it is possible to reuse a signature of a PHAR file. As it is described in the manual, each file has a manifest, which contains a lot of things which can be faked, and 4 bytes of CRC32 checksum, which is a poor choice (md5 or sha1 would be much secure), but can be faked harder than other stuff. I have doubts about the validity of checksum used by creating the signature for verifying. I mean it is slow to create a checksum by every inclusion of the phar file, but adding a