<?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>Mon, 21 May 2012 10:48:24 -0500</pubDate>
    <ttl>30</ttl>
    <item>
      <title><![CDATA[Odafe Ojenikoh's Blog: Interactive PHP CLI Applications using Zend Form]]></title>
      <guid>http://www.phpdeveloper.org/news/17552</guid>
      <link>http://www.phpdeveloper.org/news/17552</link>
      <description><![CDATA[<p>
<i>Odafe Ojenikoh</i> has submitted a post he's written up showing how to <a href="http://blog.ojenikoh.com/2012/02/14/interactive-php-cli-applications-using-zend-form/">create a command line PHP application</a> with the help of the Zend Framework and it's Zend_Form elements.
</p>
<blockquote>
Over the weekend, I was toying with the idea of interactive cli applications using readline() and Zend Form for validating input. My motivation for using Zend Form or rather Zend Form elements was to exploit the power of features such as labels, validators, filters and the prospect of reusing forms within web application code.
</blockquote>
<p>
His example code defines a Filter for the form errors (returning them as a string) and a "Cli" class that handles the interaction with the command line. Next up is a class defining the form elements - a prompt for a color name and either of the words "thank" and "you". The Cli class transforms the form elements into prompts on the command line and lets you define validators to check their input.
</p>]]></description>
      <pubDate>Thu, 16 Feb 2012 11:09:57 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[Chance Garcia's Blog: MAMP PRO, PECL, SSH2, and OSX CLI (AKA acronym madness)]]></title>
      <guid>http://www.phpdeveloper.org/news/17107</guid>
      <link>http://www.phpdeveloper.org/news/17107</link>
      <description><![CDATA[<p>
<i>Chance Garcia</i> has a recent post to his blog showing how he <a href="http://phpprotip.com/2011/11/mamp-pro-pecl-ssh2-and-osx-cli-aka-acronym-madness/">fixed an issue with his MAMP install</a> involving development of a <a href="https://github.com/chancegarcia/CG/blob/github/Ssh.php">SSH wrapper</a> he developed and some testing out of PHPStorm and PHPUnit.
</p>
<blockquote>
One thing I can say is that, even though I use a convenient app like MAMP PRO to set up my local development environment, I'm glad my sysadmin-fu is up to snuff enough to fly without the conveniences because after this ordeal, I feel like I might as well have made my MAMP stack from scratch with all the hoops I jumped tonight.
</blockquote>
<p>
He shares a few of the things he discovered along the way like: the location of MAMP's "pecl" command, an error caused by a bad pear.conf file, doing custom compiles of PHP and libssh as a fallback and getting the extension to work in the CLI PHP version too.
</p>]]></description>
      <pubDate>Wed, 09 Nov 2011 11:37:34 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[Gonzalo Ayuso's Blog: Building a small microframework with PHP (Part 2). Command line interface]]></title>
      <guid>http://www.phpdeveloper.org/news/16786</guid>
      <link>http://www.phpdeveloper.org/news/16786</link>
      <description><![CDATA[<p>
Continuing on with his <a href="http://phpdeveloper.org/news/16756">previous investigations</a> into microframworks and what it takes to create them, <i>Gonzalo Ayuso</i> has <a href="http://gonzalo123.wordpress.com/2011/08/29/building-a-small-microframework-with-php-part-2-command-line-interface/">posted his second part</a> of the series - a look at working on the command line.
</p>
<blockquote>
In my last post we spoke about building a small microframework with PHP. The main goal of this kind of framework was to be able to map urls to plain PHP classes and become those classes easily testeable with PHPUnit. Now we're going to take a step forward. [...] It's pretty straightforward to create a command line interface (CLI) for our microframework. 
</blockquote>
<p>
He shows how to use the <a href="http://php.net/getopt">getopt</a> function and the $GLOBALS superglobal to pull in arguments given to the command line script. He hooks this into the framework and makes it possible to define the controller and action to execute (with a few examples to show it in action). You can find this updated code on <a href="https://github.com/gonzalo123/microFramework">his github account</a>.
</p>]]></description>
      <pubDate>Mon, 29 Aug 2011 13:19:11 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Stuart Herbert's Blog: Introducing phix]]></title>
      <guid>http://www.phpdeveloper.org/news/16071</guid>
      <link>http://www.phpdeveloper.org/news/16071</link>
      <description><![CDATA[<p>
In a new post to his blog <i>Stuart Herbert</i> has <a href="http://blog.stuartherbert.com/php/2011/03/21/introducing-phix/">introduced phix</a>, a packaging tools that can be used to manage and install different components in a framework-agnostic sort of way.
</p>
<blockquote>
<a href="http://github.com/Gradwell/phix">phix</a> is a small command-line tool for PHP applications. I created it to fix (pun intended) the problem of how to easily automate the tasks involved in creating and (especially) maintaining components. These tasks aren't built into phix; they are commands that ship with the phix distribution. You can create your own commands to run inside phix too, and it's easy to do so
</blockquote>
<p>
The <a href="http://github.com/Gradwell/phix">phix</a> tool (easily installed from PEAR) lets you either use built-in commands or custom ones to manage libraries with a few different kinds of commands - current status, initialize a library, upgrade a library and manage the full web application. As of the time of this post, the current version is <a href="http://github.com/Gradwell/phix">phix-0.10.4</a>.
</p>]]></description>
      <pubDate>Mon, 21 Mar 2011 08:24:05 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Simas Toleikis' Blog: Writing a PHP daemon application]]></title>
      <guid>http://www.phpdeveloper.org/news/15768</guid>
      <link>http://www.phpdeveloper.org/news/15768</link>
      <description><![CDATA[<p>
<i>Simas Toleikis</i> has a new post today looking at a method he's found for creating <a href="http://simas.posterous.com/writing-a-php-daemon-application">a simple daemon application</a> in PHP. He gives you the basic outline of how it works (with a bit of code included) but not a specific example.
</p>
<blockquote>
There is a special group of applications that require a different PHP script execution model. [...] All of [these special] applications need to be run in the background as daemons - something that PHP was never designed/supposed to be good at. The plain C language is a weapon of choice when it comes to writing a daemon implementation, but then again, if the application in question does not depend on high performance and concurrency - PHP can do the job quite well.
</blockquote>
<p>
He talks about using the command line interface to run the scripts, creating the while loop to keep execution going and creating the non-blocking socket so that the script can accept new client connections.  He also mentions using <a href="http://upstart.ubuntu.com/">upstart</a> to run the script in the background and the <a href="http://pecl.php.net/package/proctitle/">proctitle</a> PECL extension to give the process a custom name in the process list. He also touches on log files and forking/parallel processing.
</p>]]></description>
      <pubDate>Wed, 19 Jan 2011 11:51:34 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[PHPBuilder.com: Running PHP and Zend Framework Scripts from the Command Line]]></title>
      <guid>http://www.phpdeveloper.org/news/15684</guid>
      <link>http://www.phpdeveloper.org/news/15684</link>
      <description><![CDATA[<p>
New on PHPBuilder.com today there's <a href="http://www.phpbuilder.com/columns/command-line-script/Jason_Gilmore01042011.php3">a tutorial from Jason Gilmore</a> about running Zend Framework-based applications from the command line in a more hard-coded way than using Zend_Tool.
</p>
<blockquote>
I regularly use an alternative application of PHP and I'm quite surprised that this capability remains relatively unknown. I'm referring to the ability to run PHP scripts from the command line using its command line interpreter (CLI). Even though it's been possible since the PHP 4.3.0 release, you may be completely unaware of this CLI usage unless you employ great tools such as PHPDoc, Phing, or PHPUnit. Running PHP scripts with CLI allows you to leverage your PHP language skills whenever you need to run scripts from the shell.
</blockquote>
<p>
He talks about what the CLI functionality of PHP is and what it has to offer the developer. He then creates a few sample scripts so you can get a feel for how to write and run simple PHP CLI applications. Building on these examples, he <a href="http://www.phpbuilder.com/columns/command-line-script/Jason_Gilmore01042011.php3?page=2">creates a Zend Framework-based script</a> that loads in the bootstrap, grabs configuration values and makes a connection to the Amazon Web Services.
</p>]]></description>
      <pubDate>Wed, 05 Jan 2011 09:29:39 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[Brian Moon's Blog: PHP command line progress bar]]></title>
      <guid>http://www.phpdeveloper.org/news/14168</guid>
      <link>http://www.phpdeveloper.org/news/14168</link>
      <description><![CDATA[<p>
<i>Brian Moon</i> has a quick post that links to a but of code that gives you a <a href="http://brian.moonspot.net/php-progress-bar">progress bar for the command line</a> that's flexible enough to be used in an number of situations.
</p>
<blockquote>
Was just looking through some code and came across this function I wrote some time ago. If you do a lot of your processing scripts in PHP like we do, you probably need to know what is going on sometimes. So, I made a progress bar for use on the cli. I thought I would share it.
</blockquote>
<p>
You can see a demo of it <a href="http://www.screencast.com/users/brianlmoon/folders/Jing/media/822d9970-a6a3-4071-bdc6-1303cce9800a">here</a> (screencast) or just <a href="http://brian.moonspot.net/status_bar.php.txt">download the code</a>. Comments on the post also point out the <a href="http://pear.php.net/package/Console_Progressbar">PEAR Console_Progressbar</a> package and the <a href="http://ezcomponents.org/docs/api/latest/introduction_ConsoleTools.html#progress-indication">ez Components class</a> for creating a more advanced progress bar.
</p>]]></description>
      <pubDate>Thu, 11 Mar 2010 10:23:41 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[Davey Shafik's Blog: Debugging on the Command Line with xdebug]]></title>
      <guid>http://www.phpdeveloper.org/news/13769</guid>
      <link>http://www.phpdeveloper.org/news/13769</link>
      <description><![CDATA[<p>
<i>Davey Shafik</i> has <a href="http://daveyshafik.com/archives/734-debugging-on-the-command-line-with-xdebug.html">a quick tip</a> for anyone trying to use Xdebug from the command line and finding themselves having issues.
</p>
<blockquote>
Thanks to some help from <a href="http://derickrethans.nl/">Derick</a> and my co-worker <a href="http://twitter.com/magical_trevor">Trevor</a>, I now have a simple bash script that will let me and my team easily debug CLI scripts on our development server.
</blockquote>
<p>
The script is two lines (really just one) that uses a combination of environment variables, PHP's command line binary and a few other standard unix commands to parse the output of the request. The script can be made executable and dropped into a place in your path to make it as simple as running "xdebug file.php" on the file.
</p>]]></description>
      <pubDate>Mon, 04 Jan 2010 09:33:12 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[Padraic Brady's Blog: The Mysteries Of Asynchronous Processing With PHP - Part 2 (CLI applications)]]></title>
      <guid>http://www.phpdeveloper.org/news/13306</guid>
      <link>http://www.phpdeveloper.org/news/13306</link>
      <description><![CDATA[<p>
In the <a href="http://blog.astrumfutura.com/archives/418-The-Mysteries-Of-Asynchronous-Processing-With-PHP-Part-2-Making-Zend-Framework-Applications-CLI-Accessible.html">second part</a> of his series looking at asynchronous processing in PHP applications, <i>Padraic Brady</i> lays the ground work for the third part and shows how to work with command line Zend Framework applications.
</p>
<blockquote>
Part 2 is a tangential detour into how to make a Zend Framework based application accessible from the command line before we delve into examples using this in future parts of the series. If you are not a Zend Framework user, I'm sure you can find relevant material online for your own preferred framework though the ZF pieces may still have some usefulness in understanding the approach from an MVC perspective.
</blockquote>
<p>
In his examples he skips over the basics of using a command line application and jumps right to things like argument handling, creating a custom router and making a custom "calling script" to handle the configuration of the CLI application.
</p>]]></description>
      <pubDate>Wed, 30 Sep 2009 08:32:01 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Paul Jones' Blog: Quick Hits: New Solar Blog Entries]]></title>
      <guid>http://www.phpdeveloper.org/news/12141</guid>
      <link>http://www.phpdeveloper.org/news/12141</link>
      <description><![CDATA[<p>
<i>Paul Jones</i> has a <a href="http://paul-m-jones.com/?p=432">quick hit</a> reminder of some of the recent blog entries around the web about using the Solar framework:
</p>
<ul>
<li><a href="http://solarphp.com/blog/read/29-solar-cli-make-model">Solar CLI: Make-model</a> - a look at the auto-generation feature of the Solar command-line tool to create model classes based on your database tables.
<li>A more in-depth look at <a href="http://elofson.ca/?p=22">the solar configuration file</a>
<li>And, for those new to the framework, a <a href="http://elofson.ca/?p=10">Getting Started</a> guide.
</ul>
<p>
You can find out more about the Solar framework on <a href="http://solarphp.com">the project's website</a> including documentation, a current bugs list and a link to the community wiki.
</p>]]></description>
      <pubDate>Mon, 16 Mar 2009 11:16:37 -0500</pubDate>
    </item>
  </channel>
</rss>

