Sunday, February 11. 2007Introducing pecl extension pharTrackbacks
Trackback specific URI for this entry
No Trackbacks
Comments
Display comments as
(Linear | Threaded)
*sniff* its like, my baby is all grown up!
Congrats Greg, Marcus, you guys have done a great job, and brought Phar to greater places than I imagined The next task, is default for PHP 5.3/6 - Davey
Hi, I was really looking forward for using Phar. I have spent like a week trying to install it on Windows, but I haven't been able to do it! Everytime I use the pecl install command I get a message saying that the DSP phar.dsp does not exist. Apparently this is an error that's appearing when installing almost every pecl package. I don't know if someone has fixed this bug or anything, but I would really like to find a way of using Phar on Windows. If you could please help me, I would really appreciate it.
Thanks!
Hi Alex,
You can download a pre-built windows .dll for PHP 5.2.x for the phar extension from: http://pecl4win.php.net/ext.php/php_phar.dll
Hi again! I did it! I downloaded the .dll and it works great! Thanks a lot!
Now I'm trying to understand how to work with Phar. So far I have been able to create .phar archives and to extract .txt files from them. However, I'm having problems with the DirectoryIterator you explained. It's weird, cause I have SPL enabled (or at least that's what my phpinfo says). Any ideas? If you could explain me how to add and extract .php files from a .phar it would be really great. I understand that's exactly what you explained with the examples you wrote here, but I don't get it... So, if it is not much trouble, please help me. Thanks again!
Hi, it's me again!
Sorry to bother you. I just wanted to tell you that I finally did it. I know how to add and extract .php files! It was actually much easier than I thought. Phar is great, really! By the way, I was wondering if with Phar you are able to copy complete folders and files trees, I mean with subfolders and everything. And also, if once you have extracted them you keep the subfolders and folders and everything like in the original tree. In other words, I was wondering if I could save a whole directory in a Phar and then extract it. I don't know if I explained myself correctly, but if you know what I'm talking about it would be really great if you could answer me. I mean, I don't want to spend a lot of time trying to do something tha Phar can't do. Well, thanks again! I promess this was my last question!
Hi Alex,
I'm really glad to hear you figured it out. There is an example of adding a directory tree in CVS for SPL. Here's the link: http://cvs.php.net/viewvc.cgi/php-src/ext/spl/examples/phar_from_dir.php?view=markup We did not feel it was necessary to implement this directly in the Phar extension for 2 reasons: 1) it's really simple to do using SPL iterators, and by simple I mean it's about 5-10 lines of code including whitespace 2) really complex stuff (ignoring regexps and so on) is best implemented in userspace. PHP_Archive (http://pear.php.net/PHP_Archive) already supports this, and can create Phar archives that only use the Phar extension (i.e. do not include PHP_Archive) as well as archives that are compatible with both PHP_Archive and Phar (and will default to Phar if it is present).
I did it! Finally I did it! I know how to use Phar!
Playing around with this.. nice.
Bug ... I would presume Your example more or less
Oh - and I tried the next logical step - just because - and it definantly requires the opening php bracket.
Just dont like the bracket closing it. W:\>php -v PHP 5.2.2-dev (cli) (built: Mar 3 2007 00:24:04) Copyright (c) 1997-2007 The PHP Group Zend Engine v2.2.0, Copyright (c) 1998-2007 Zend Technologies W:\>php --ri phar Phar Phar: PHP Archive support => enabled Phar EXT version => 1.0.0 Phar API version => 1.0.0 CVS revision => $Revision: 1.180 $ gzip compression => enabled bzip2 compression => enabled Phar based on pear/PHP_Archive, original concept by Davey Shafik Phar fully realized by Gregory Beaver and Marcus Boerger Directive => Local Value => Master Value phar.readonly => Off => Off phar.require_hash => On => On
Hey Greg,
Nice work here, but I'm curious what the benefit of Phar is over just wrapping a zip file with a manifest, a la XPI? Obviously there's the iterators and such for accessing files, but at it's base, doesn't this just need a convenient way to load a package? Any thoughts? I may have just missed the point entirely, and feel free to tell me as much -Travis
Thanks for this awesome works. Good solutions for packaging theme and plugins.
I actually made a wordpress theme with this tho.
Hi, I am really looking forward for using Phar. I have spent three days trying to install it on Windows, but I failed ! Everytime I use the pecl install command I get a message saying that the DSP phar.dsp does not exist.
And I could not find a pre-built php_phar.dll for windows php5.30. I would really like to find a way of using Phar on Windows. If you could please help me, I would really appreciate it.
Actually, it is surprisingly easy to use phar on windows in PHP 5.3.0 - it is built into PHP. You don't need php_phar.dll at all. Just start using phar archives and the phar extension at will.
|
Calendar
CategoriesPopular EntriesSetting up your own PEAR channel with Chiara_PEAR_Server - the official way
(36) Do you develop a website? It is infinitely better to synchronize live and development sites using the PEAR Installer(25) How to put the FAIL in open source(22) doing the PEAR thing(19) Using PEAR 1.4.0 to install PEAR packages on a remote host(19) phpDocumentor and __get/__set/__call - give us your ideas (RFC)(17) PEAR now fits in a bottle: meet go-pear.phar(17) Mac OS X ships with security hole-laden PEAR - how to upgrade immediately(16) Introducing pecl extension phar(13) go-pear.phar works! In related news, PHP_Archive is now PHP 5.1.0+(12) |
|||||||||||||||||||||||||||||||||||||||||||||||||