<?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>Sat, 18 May 2013 04:37:10 -0500</pubDate>
    <ttl>30</ttl>
    <item>
      <title><![CDATA[Michael Maclean: Why one-line installers are a bad idea]]></title>
      <guid>http://www.phpdeveloper.org/news/18505</guid>
      <link>http://www.phpdeveloper.org/news/18505</link>
      <description><![CDATA[<p>
There's a feature that's usage has been showing up more and more in software projects (both open source and not) that allows you to install their system with a single line command, usually involving curl and maybe piping it to a shell. In <a href="http://mgdm.net/weblog/why-one-line-installers-are-bad/">this recent post</a> <i>Michael Maclean</i> takes a look at this trend and some of the possible pitfalls of the approach.
</p>
<blockquote>
There has been a trend in the last while for various bits of useful software to have a one-line shell command recommended as the installation method. The usual form of this is to pipe something like curl or wget to some interpreter, be it bash, php, ruby, or some such. [...] This [type of] command takes the output of curl and pipes it straight to bash. I have several issues with this.
</blockquote>
<p>
His three main points center around the fact that you cannot inspect the code before executing it with this method, that you can't verify the source of the code and that it teaches users bad habits of trusting in "magic commands" like these.
</p>]]></description>
      <pubDate>Fri, 21 Sep 2012 11:35:29 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Zumba Engineering Blog: Creating bash completion to your console application]]></title>
      <guid>http://www.phpdeveloper.org/news/18383</guid>
      <link>http://www.phpdeveloper.org/news/18383</link>
      <description><![CDATA[<p>
On the Zumba Engineering blog there's a new post showing you how to <a href="http://engineering.zumba.com/2012/08/20/creating-bash-completion/">implement bash shell "autocomplete"</a> with a special option for a second argument.
</p>
<blockquote>
This weekend I saw the <a href="https://github.com/AD7six/cakephp-completion">bash completion for CakePHP</a> from <a href="http://ad7six.com/">Andy Dawson</a> and had an idea to do the same for our service application, because we frequently forget the exactly job class or method name and add extra steps to verify these names before execute the job. I read his code, made some research and finally get our bash completion working fine.
</blockquote>
<p>
In his case he wanted to see what things a module in the application had to offer, so he implemented a "__check__" argument that looked at the third argument and used reflection to get the methods allowed for it. Also included in the post is the bash alias you'll need to set up to get it working (and where to put it to make it cooperate).
</p>]]></description>
      <pubDate>Tue, 21 Aug 2012 09:47:52 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Andrew Johnstone's Blog: Vagrant, Automating PHP/MySQL Installation with bash/slack]]></title>
      <guid>http://www.phpdeveloper.org/news/17241</guid>
      <link>http://www.phpdeveloper.org/news/17241</link>
      <description><![CDATA[<p>
<i>Andrew Johnstone</i> has a new post to his blog with a look at <a href="http://ajohnstone.com/achives/vagrant-automating-php-installation-with-bashslack-for-continuous-deployment/">using Vagrant for continuous deployment</a> of a PHP-based application.
</p>
<blockquote>
<a href="http://vagrantup.com/">Vagrant</a> is simply a wrapper around Virtualbox headless that allows for provisioning virtual machines with support for <a href="http://projects.puppetlabs.com/projects/puppet">puppet</a>, <a href="http://wiki.opscode.com/display/chef/Chef+Solo">chef-solo</a>, <a href="http://wiki.opscode.com/display/chef/Home">chef</a>, and <a href="http://tldp.org/LDP/abs/html/">bash</a>. This allows you to automate the deployment and sandboxing of development sites. Additional base box images can be found at <a href="http://www.vagrantbox.es/">vagrantbox.es</a>.
</blockquote>
<p>
He walks you through the full process of setting up a first deployment - getting Vagrant installed, updating the config for a squeeze64.box image, configuring a virtualhost on the Apache web server and setting up a "preinstall" script to configure things like MySQL and install a long list of packages (via apt-get). 
</p>]]></description>
      <pubDate>Mon, 12 Dec 2011 08:58:08 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[Derick Rethans' Blog: Multiple PHP versions set-up]]></title>
      <guid>http://www.phpdeveloper.org/news/17092</guid>
      <link>http://www.phpdeveloper.org/news/17092</link>
      <description><![CDATA[<p>
<i>Derick Rethans</i> has a new post today looking at a method for <a href="http://derickrethans.nl/multiple-php-version-setup.html">setting up multiple PHP versions</a> on the same machine and switch between them with a little help from some simple bash scripts.
</p>
<blockquote>
For many of my projects (both <a href="http://derickrethans.nl/projects.html">hobby</a> and <a href="http://derickrethans.nl/who.html#derickrethansltd">commercial</a>) I need to support many different PHP configurations. Not only just different PHP versions, but also debug builds, ZTS builds and 32-bit builds. In order to be able to test and build extensions against all those different PHP configurations I have adopted a simple method that I'm sharing with you here.
</blockquote>
<p>
Using <a href="http://derickrethans.nl/files/php-build.sh.txt">this script</a> he can tell his system to pull the latest version of any release from SVN and try to compile it. The trick is putting each of them into a different directory under /usr/local. He uses another small shell function (with a function called "pe()") that sets up the pathing to the right release, complete with its own locations for PEAR/PECL and a php.ini.
</p>]]></description>
      <pubDate>Mon, 07 Nov 2011 09:14:00 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[Matthew Weier O'Phinney's Blog: Converting DocBook4 to DocBook5]]></title>
      <guid>http://www.phpdeveloper.org/news/16611</guid>
      <link>http://www.phpdeveloper.org/news/16611</link>
      <description><![CDATA[<p>
In <a href="http://weierophinney.net/matthew/archives/264-Converting-DocBook4-to-DocBook5.html">this new post</a> to his blog <i>Matthew Weier O'Phinney</i> looks at the steps he took to convert over the documentation for the Zend Framework 2 from the DocBook 4 formatting over to DocBook 5. Included in the post is some of the (PHP and bash) code he used to make the switch.
</p>
<blockquote>
Within the <a href="https://github.com/zendframework/zf2">Zend Framework 2 repository</a>, I recently performed a conversion from <A href="http://docbook.org/">DocBook</a> 4 to 5. [...] Interestingly, for DocBook5 being available in beta since 2005 and an official standard since 2009, there is very little material on migrating from DocBook 4 to 5.
</blockquote>
<p>
Right from the start he came across a few problems with the included conversion process that're a part of the "db4-update.xsl" definitions. 
 He has a list of eight steps he had to perform on the current DocBook 4 formatted documentation to make the conversion work smoothly including:
</p>
<ul>
<li>Identify files containing entity declarations, and skip them.
<li>Run the XML file through the db4-upgrade.xsl stylesheet and restore XML entities from the previously placed markers
<li>Fix programlisting elements (replaces entities with original text and wraps in CDATA).
</ul>
<p>
He details these steps in a few different sections talking about handling the entities, creating some helper scripts and how to put the two code parts together in a single bash script that can be run on the entire documentation set. If you're just looking for the code, you can find it <a href="https://github.com/weierophinney/docbook5-migration">on his github account</a>.
</p>]]></description>
      <pubDate>Wed, 20 Jul 2011 09:55:50 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Conor Mac Aoidh's Blog: OS X: Audio Alerts for PHP Errors]]></title>
      <guid>http://www.phpdeveloper.org/news/14689</guid>
      <link>http://www.phpdeveloper.org/news/14689</link>
      <description><![CDATA[<p>
In <a href="http://blog.macaoidh.name/2010/06/22/os-x-audio-alerts-for-php-errors/">a new post</a> to his blog today <i>Conor Mac Aoidh</i> talks about a way he's developed to get audio alerts whenever PHP errors pop up in your scripts using the <a href="http://sourceforge.net/projects/swatch/">swatch</a> tool.
</p>
<blockquote>
Kae <a href="http://verens.com/2010/06/22/audio-alerts-for-php-errors">posted</a> today about tackling this problem under Linux, but I've found that it's quite a different task under OS X. 
</blockquote>
<p>
It also uses some additional Perl modules (like Date::Calc and Date::Manip) to set up swatch. From there it's just a matter of adding a few lines to a configuration file to watch for the errors and sound the "bell". A few bash scripts will need to be added to correctly start the service too.
</p>]]></description>
      <pubDate>Wed, 23 Jun 2010 09:14:13 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Andrew Johnstone's Blog: Lock Files in PHP & Bash]]></title>
      <guid>http://www.phpdeveloper.org/news/13781</guid>
      <link>http://www.phpdeveloper.org/news/13781</link>
      <description><![CDATA[<p>
<i>Andrew Johnstone</i>, inspired by <a href="http://abhinavsingh.com/blog/2009/12/how-to-use-locks-in-php-cron-jobs-to-avoid-cron-overlaps/">a previous post</a> on file locking to avoid cron job overlaps, as posted <a href="http://ajohnstone.com/archives/lock-files-in-php-bash/">his own method</a> and give a few more examples of how it can be done.
</p>
<blockquote>
In order for a lock to work correctly it must handle, Atomicity / Race Conditions, and Signaling. I use the following bash script to create locks for crontabs and ensure single execution of scripts.
</blockquote>
<p>
His bash script looks at the processes currently running and checks to be sure there's not already one there. If not, it takes the script given and executes an instance. If the process has finished running but the lock file is still there, it removes it and moves on to the execute. He includes a few examples of how to use it and the code for a PHP class that makes it easy to check if something's running, locked or what the current signal/status of the process is.
</p>]]></description>
      <pubDate>Tue, 05 Jan 2010 12:40:39 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[SitePoint PHP Blog: Interactive CLI password prompt in PHP]]></title>
      <guid>http://www.phpdeveloper.org/news/12440</guid>
      <link>http://www.phpdeveloper.org/news/12440</link>
      <description><![CDATA[<p>
On the SitePoint PHP blog today <i>Troels Knak-Nielsen</i> has <a href="http://www.sitepoint.com/blogs/2009/05/01/interactive-cli-password-prompt-in-php/">a quick tip</a> for those looking for a way to have their command-line PHP scripts be more interactive.
</p>
<blockquote>
Just a quick tip, since I spent a good hour figuring this out recently. PHP has no native way of doing an interactive password prompt, when running as CLI. You can however use bash for the task.
</blockquote>
<p>
His <a href="http://www.sitepoint.com/blogs/2009/05/01/interactive-cli-password-prompt-in-php/">method</a> (for both Windows and Unix systems) uses <a href="http://php.net/shell_exec">shell_exec</a> command to run a VB Script/bash command that handles the password prompt for the PHP script. The result is then passed back into a variable and returned back to the calling application.
</p>]]></description>
      <pubDate>Fri, 01 May 2009 09:34:38 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[DevX: Integrating Bash with PHP]]></title>
      <guid>http://www.phpdeveloper.org/news/11947</guid>
      <link>http://www.phpdeveloper.org/news/11947</link>
      <description><![CDATA[<p>
<a href="http://www.devx.com/opensource/Article/40785">This DevX tutorial</a> shows you how to use a unix-based shell in PHP in three different environments (using three different tools) on Windows.
</p>
<blockquote>
This article discusses how to install and configure three Bash distributions for Windows: the GNU BASH shell for Windows, the Win-Bash Windows port, and the Cygwin tool. It also demonstrates how to execute Bash scripts using PHP, how to send different types of arguments to a Bash script, how to use Bash functions from PHP, and how to save results to a text file.
</blockquote>
<p>
They start with the Windows installs using the <a href="http://www.steve.org.uk/Software/bash/bash-203.zip">GNU Bash shell for Windows</a>, <a href="http://www.cygwin.com/">Cygwin</a> and <a href="http://win-bash.sourceforge.net/">Win-Bash</a> with a healthy dose of code thrown in between. Examples include both the bash scripting and PHP script sides to push the output of the commands into local text files.
</p>]]></description>
      <pubDate>Fri, 13 Feb 2009 11:14:47 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[Amir Saied's Blog: PEAR bash completion]]></title>
      <guid>http://www.phpdeveloper.org/news/10696</guid>
      <link>http://www.phpdeveloper.org/news/10696</link>
      <description><![CDATA[<p>
<i>Amir Saied</i> <a href="http://gluegadget.com/blog/index.php?/archives/27-PEAR-bash-completion.html">recently posted</a> a handy little tool for the PEAR users out there - a bash script that handles tab completion for you.
</p>
<blockquote>
Lately I've been playing alot with the PEAR CLI.  The one annoying thing I noticed the most was its lack of tab completion that I'm used to from the shell.  It turns out that this feature is very easy to add, in the bash at least.
</blockquote>
<p>
It will finish off the PEAR commands for you and expand out the PEAR package names and discovered channels when it finds a match. You can <a href="http://gluegadget.com/misc/pear">download the package here</a>.
</p>]]></description>
      <pubDate>Mon, 28 Jul 2008 12:08:29 -0500</pubDate>
    </item>
  </channel>
</rss>
