<?xml version="1.0"?>
<rss version="2.0">
  <channel>
    <title>PHPDeveloper.org</title>
    <link>http://www.phpdeveloper.org</link>
    <description>Up-to-the Minute PHP News, views and community</description>
    <language>en-us</language>
    <pubDate>Sun, 12 Feb 2012 18:06:49 -0600</pubDate>
    <ttl>30</ttl>
    <item>
      <title><![CDATA[Till Klampaeckel's Blog: PHAR and FreeBSD]]></title>
      <guid>http://www.phpdeveloper.org/news/17101</guid>
      <link>http://www.phpdeveloper.org/news/17101</link>
      <description><![CDATA[<p>
<i>Till Klampaeckel</i> has a new post about <a href="http://till.klampaeckel.de/blog/archives/172-PHAR-and-FreeBSD.html">replacing the now-missing phar port</a> on FreeBSD installations with a custom compile work-around.
</p>
<blockquote>
I noticed that archivers/pecl-phar vanished from the ports tree on one of my FreeBSD servers.
Problem? Reasons to remove the port were: the port is unmaintained, the port was based on the outdated phar extension from pec and that phar (in pecl) contains open security issues. The simple solution is to create a new port which of course will use the phar which is bundled in PHP's core.
</blockquote>
<p>
He includes the simple five or six step process you'll need to follow to compile your own phar extension for your installation - grabbing the latest source, compiling (configure/make) and putting the resulting shared object (.so) in the right place for PHP to find it. All that's left then is to enable it in the php.ini. <a href="http://php.net/phar">Phar</a> is an archive creation tool that (normally) comes bundled with versions of PHP and can be used to both read and write to compressed packages.
</p>]]></description>
      <pubDate>Tue, 08 Nov 2011 11:51:58 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[ZendCasts.com: PHAR Out Autoloading]]></title>
      <guid>http://www.phpdeveloper.org/news/16982</guid>
      <link>http://www.phpdeveloper.org/news/16982</link>
      <description><![CDATA[<p>
On the ZendCasts.com site there's a new screencast posted looking at <a href="http://www.zendcasts.com/phar-out-autoloading-hd/2011/10/">autoloading in phar</a>, the <a href="http://php.net/phar">packaging tool</a> built into PHP.  This is a continuation of the series started <a href="http://www.zendcasts.com/fun-with-phar/2011/10/">here</a>.
</p>
<p>
Building on the foundation from the <a href="http://www.zendcasts.com/fun-with-phar/2011/10/">previous screencast</a>, he shows how to enhance it and allow it to autoload based on an autoloader defined in a "stub.php" file.
</p>
<p>
You can grab the complete source for this screencast <a href="https://gist.github.com/1276774">over on github</a>.
</p>]]></description>
      <pubDate>Wed, 12 Oct 2011 09:13:35 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Christian Schaefer's Blog: Using PHP Web Scraper Goutte in a Console Task in a Silex project]]></title>
      <guid>http://www.phpdeveloper.org/news/16969</guid>
      <link>http://www.phpdeveloper.org/news/16969</link>
      <description><![CDATA[<p>
In a recent post to his blog <i>Christian Schaefer</I> shows how to use the <a href="https://github.com/fabpot/Goutte">Goutte</a> tool (a web scraper) to pull information from one site and use it in another <a href="http://silex.sensiolabs.org/">Silex</a>-powered one. <a href="http://test.ical.ly/2011/09/30/using-php-web-scraper-goutte-in-a-console-task-in-a-silex-project/">His tutorial</a> uses a custom service provider for the integration.
</p>
<blockquote>
Since I discovered the <a href="http://test.ical.ly/2011/09/29/deploy-your-silex-and-twig-powered-facebook-app-using-git-onto-free-heroku-cloud-hosting/">free Facebook App hosting by heroku</a> I keep wanting to make something useful out of it. So I thought about a small service app. Without going into details yet about its nature there was one immediate problem to be solved. How to get hold of the data? So I thought to scrape it off some website. I know this isn't very nice but unfortunately there is no feed I can use.. And how to best scrape a website? Use Goutte!
</blockquote>
<p>
All you'll need is two things - the <a href="https://raw.github.com/fabpot/Goutte/master/goutte.phar">goutte.phar</a> and <a href="http://silex.sensiolabs.org/get/silex.phar">Silex</a> phar files. The code for the service provider is a simple registration of namespaces. With that integrated, it's as simple as making a client object and calling it with a URL.
</p>]]></description>
      <pubDate>Mon, 10 Oct 2011 08:26:24 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[ZendCasts.com: Fun with Phar]]></title>
      <guid>http://www.phpdeveloper.org/news/16944</guid>
      <link>http://www.phpdeveloper.org/news/16944</link>
      <description><![CDATA[<p>
New today on ZendCasts.com there's a screencast tutorial about <a href="http://www.zendcasts.com/fun-with-phar/2011/10/">using phar archives</a> in your applications. 
</p>
<blockquote>
Phar is a new thing that's developed on the horizon over the last few years that's essentially a PHP archive or library.
</blockquote>
<p>
He shows how to set up a basic application (non-Zend Framework) that does a "hello world" sort of output showing a date "next week". Also included are the commands to bundle it up into a phar archive using the <a href="http://php.net/phar">features already built into PHP</a>. The build stub uses the <a href="http://php.net/buildFromDirectory">buildFromDirectory</a> and compression/buffering. He also points out a common problem with the default settings on many PHP installed - an INI setting that disables phar creation. Thankfully, it's easy to change via a <a href="http://php.net/ini_set">ini_set</a> call updating the "phar.readonly" setting.
</p>]]></description>
      <pubDate>Tue, 04 Oct 2011 08:14:16 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Josh Adell's Blog: Phar Flung Phing]]></title>
      <guid>http://www.phpdeveloper.org/news/16906</guid>
      <link>http://www.phpdeveloper.org/news/16906</link>
      <description><![CDATA[<p>
<i>Josh Adell</i> has posted about a bit of automation he set up with <a href="http://phing.info">Phing</a> and PHP's <a href="http://php.net/phar">phar</a> packaging to create an archive as a part of his build system. It's a <a href="http://blog.everymansoftware.com/2011/09/phar-flung-phing.html">simple five step process</a> mad even easier by the fact that Phing already has a PharPackage task.
</p>
<blockquote>
One of the cooler features of PHP 5.3 is the ability to package up a set of PHP class files and scripts into a single archive, known as a PHAR ("PHp ARchive"). [...]  I decided to see how easy it would be to wrap up <a href="http://github.com/jadell/Neo4jPHP">Neo4jPHP</a> in a PHAR for distribution. [...] Since I also started playing with Phing recently, I decided to see if I could incorporate packaging a project as a PHAR into my build system. It turns out, it's pretty easy, given that Phing has a built-in PharPackage task.
</blockquote>
<p>
He points you towards Phing's PEAR channel to get the tool installed and includes a command-line call to update your php.ini to allow PHP to generate phar files. Code is included to create the phar-generation stub as well as the XML for the Phing build file. You can find his <a href="http://github.com/downloads/jadell/Neo4jPHP/neo4jphp.phar">end result here</a>.
</p>]]></description>
      <pubDate>Mon, 26 Sep 2011 10:05:37 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[DZone.com: Phar: PHP libraries included with a single file]]></title>
      <guid>http://www.phpdeveloper.org/news/16900</guid>
      <link>http://www.phpdeveloper.org/news/16900</link>
      <description><![CDATA[<p>
On DZone.com today <i>Giorgio Sironi</i> has a new post looking at an interesting, if seldom used, feature of recent PHP releases - <a href="http://css.dzone.com/articles/phar-php-libraries-single-file">packaging applications with phar archives</a>.
</p>
<blockquote>
<a href="http://php.net/phar">Phar</a> is a php extensions that provides the means for distributing code as a single archive, that does not have to be extracted to a folder before usage. The concept is similar to JVM Jars: each archive becomes a virtual directory where files can be accessed. However, the virtual folder is not limited to class loading, but you can open and read internal files as if it were decompresse into a directory.
</blockquote>
<p>
He includes a brief "hello world" example of packaging up a script into a phar archive and executing it via PHP. He also shows how easy it is to create an archive from current code, making an archive containing the latest Doctrine 2 release for simple inclusion. Phars also allow compression and hashing but has issues with resource management and access external files.
</p>]]></description>
      <pubDate>Fri, 23 Sep 2011 11:30:40 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Christian Weiske's Blog: Working with .phar files]]></title>
      <guid>http://www.phpdeveloper.org/news/16777</guid>
      <link>http://www.phpdeveloper.org/news/16777</link>
      <description><![CDATA[<p>
<i>Christian Weiske</i> has a new post to his blog looking at a feature of PHP that's very useful yet doesn't seem to be widely used - <a href="http://php.net/phar">phar archives</a>. His post <a href="http://cweiske.de/tagebuch/php-phar-files.htm">introduces you to phar</a> and includes the good and the bad about their use.
</p>
<blockquote>
It is possible to pack an entire PHP web application up in one single file and run it without unpacking it. This files usually have a .phar extension, which is an acronym for PHp ARchive, loosely based on jar (Java ARchive). [...] With PHP 5.3.0, the <a href="http://php.net/phar">Phar extension</a> is an official part of PHP. Shipping your applications as Phar thus is safe since 5.2 has reached its EOL already.
</blockquote>
<p>
He mentions some of the pros (like one file, no unpacking needed) and cons (like no method for incremental updates, changing individual files inside the package is hard) of using them. He also talks about some of the tools you can use to create your own packages including PHP's own support, <a href="http://github.com/koto/phar-util">phar-util</a> and <a href="http://phing.info">Phing's phar task</a>. He includes a few "things to consider" when making your packages and gives examples from the <a href="http://semanticscuttle.sourceforge.net/">SemanticShuttle</a> package to illustrate. Thrown in at the end are some benchmarks that show the difference between static file serving (with and without PHP) and the same sort of statistics with Phar packages included in the mix.
</p>]]></description>
      <pubDate>Fri, 26 Aug 2011 09:07:41 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Maarten Balliauw's Blog: A client side Glimpse to your PHP application]]></title>
      <guid>http://www.phpdeveloper.org/news/16669</guid>
      <link>http://www.phpdeveloper.org/news/16669</link>
      <description><![CDATA[<p>
<i>Maarten Balliauw</i> has <a href="http://blog.maartenballiauw.be/post/2011/08/02/A-client-side-Glimpse-to-your-PHP-application.aspx">announced the release</a> of a PHP port of a powerful tool for server-side introspection of your applications - <a href="https://github.com/Glimpse/Glimpse.PHP">Glimpse for PHP</a>.
</p>
<blockquote>
A few months ago, the .NET world was surprised with a magnificent tool called "<a href="http://getglimpse.com/">Glimpse</a>". Today I'm pleased to release a <a href="https://github.com/Glimpse/Glimpse.PHP">first draft of a PHP version for Glimpse</a>! Now what is this Glimpse thing… Well: "what Firebug is for the client, Glimpse does for the server... in other words, a client side Glimpse into whats going on in your server."
</blockquote>
<p>
He includes a of how the introspection works and some <a href="http://blog.maartenballiauw.be/post/2011/08/02/A-client-side-Glimpse-to-your-PHP-application.aspx">sample code</a> using a phar to add it to your PHP application. You can see it in action in <a href="http://www.screenr.com/27ds">this screencast</a> based on the PHP Azure Contest website. He also shows one very cool feature that allows for cross-device tracking of requests. You can find this PHP port of Glimpse <a href="https://github.com/Glimpse/Glimpse.PHP">on github</a>.
</p>]]></description>
      <pubDate>Wed, 03 Aug 2011 11:28:54 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Script-Tutorials.com: Phar - PHP archiving practice]]></title>
      <guid>http://www.phpdeveloper.org/news/16343</guid>
      <link>http://www.phpdeveloper.org/news/16343</link>
      <description><![CDATA[<p>
On Script-Tutorials.com today there's a new tutorial showing you how to use one of the more under-used and powerful features of recent PHP releases - the <a href="http://www.script-tutorials.com/phar-php-archiving-practice/">phar packaging for creating self-contained archives</a>.
</p>
<blockquote>
I guess you noticed that due your project become larger - the more and more files it contain. Sometimes it comes to the thousands of files. And then - Phar can help you. This utility allows us to pack a variety of files in the single library file. Thus, we can significantly reduce the number of include files in the project, and work with the entire library as with single file. It is also possible to have a packed (gzip/bzip2) version of the library.
</blockquote>
<p>
They show you how to create simple phar archive (<a href="http://www.script-tutorials.com/demos/75/source.zip">sample code here</a>) that contains a few classes linked by an index.php file. 
</p>]]></description>
      <pubDate>Tue, 17 May 2011 08:28:50 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Tom Van Herreweghe's Blog: Running Zend Framework modules from a Phar file]]></title>
      <guid>http://www.phpdeveloper.org/news/15878</guid>
      <link>http://www.phpdeveloper.org/news/15878</link>
      <description><![CDATA[<p>
In a recent post to his blog <i>Tom Van Herreweghe</i> shares his method for running <a href="http://blog.theanalogguy.be/2011/02/07/running-zend-framework-modules-from-a-phar-file/">Zend Framework modules from a phar file</a>, a simple archiving method native to PHP that makes it simpler to group and package related files.
</p>
<blockquote>
Using <a href="http://blog.theanalogguy.be/framework.zend.com">Zend Framework</a> as an MVC application is probably the most common usage examples for Zend Framework. When you create such an MVC application, you will probably have heard about modules: reusable components of your application. [...]  In my case, I usually just copy and paste the module from one base project into a new project. That's easy. But it would be cooler to package your module as a <a href="http://php.net/manual/en/book.phar.php">Phar file</a>, and run that file instead.
</blockquote>
<p>
He includes the code that can be dropped into your Zend Framework installation - MyLib_Application_Resource_Modules - that handles the bootstrapping of the phar files and executes the Boostrap.php file that it finds inside. He also points to <a href="http://blog.calevans.com/2009/07/26/packaging-zend-framework-as-a-phar-revisited/">this other article</a> from <i>Cal Evans</i> about working with phar files in the Zend Framework.
</p>]]></description>
      <pubDate>Wed, 09 Feb 2011 10:42:18 -0600</pubDate>
    </item>
  </channel>
</rss>

