 | News Feed |
 | Jobs Feed |
Sections
|
| feed this: |  |
Derick Rethans' Blog: Multiple PHP versions set-up
by Chris Cornutt November 07, 2011 @ 09:14:00
Derick Rethans has a new post today looking at a method for setting up multiple PHP versions on the same machine and switch between them with a little help from some simple bash scripts.
For many of my projects (both hobby and commercial) 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.
Using this script 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.
voice your opinion now!
multiple version setup bash script switch tutorial
Matthew Weier O'Phinney's Blog: Converting DocBook4 to DocBook5
by Chris Cornutt July 20, 2011 @ 09:55:50
In this new post to his blog Matthew Weier O'Phinney 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.
Within the Zend Framework 2 repository, I recently performed a conversion from DocBook 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.
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:
- Identify files containing entity declarations, and skip them.
- Run the XML file through the db4-upgrade.xsl stylesheet and restore XML entities from the previously placed markers
- Fix programlisting elements (replaces entities with original text and wraps in CDATA).
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 on his github account.
voice your opinion now!
convert docbook4 docbook5 xsl entities xml bash
Conor Mac Aoidh's Blog: OS X Audio Alerts for PHP Errors
by Chris Cornutt June 23, 2010 @ 09:14:13
In a new post to his blog today Conor Mac Aoidh talks about a way he's developed to get audio alerts whenever PHP errors pop up in your scripts using the swatch tool.
Kae posted today about tackling this problem under Linux, but I've found that it's quite a different task under OS X.
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.
voice your opinion now!
audio alert error swatch perl bash tutorial
Andrew Johnstone's Blog: Lock Files in PHP & Bash
by Chris Cornutt January 05, 2010 @ 12:40:39
Andrew Johnstone, inspired by a previous post on file locking to avoid cron job overlaps, as posted his own method and give a few more examples of how it can be done.
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.
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.
voice your opinion now!
lock file bash script tutorial
DevX: Integrating Bash with PHP
by Chris Cornutt February 13, 2009 @ 11:14:47
This DevX tutorial shows you how to use a unix-based shell in PHP in three different environments (using three different tools) on Windows.
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.
They start with the Windows installs using the GNU Bash shell for Windows, Cygwin and Win-Bash 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.
voice your opinion now!
integrate bash tutorial windows winbash cygwin gnubash tool
SitePoint PHP Blog: PHP Manual CLI style 2.0
by Chris Cornutt November 29, 2007 @ 09:35:00
Sometimes, you just can't get to a web browser to look up something from the PHP manual (or might not want to). Another option is the command line and in this new post to the SitePoint PHP blog, Troels Knak-Nielsen shows you a method for getting the entire manual entry right at your prompt neatly formatted.
One thing, I missed with either of the two [other solutions mentioned], was the ability to see the entire manual entry. It's quite often, that the manual actually holds useful information (Who'd known that!), so I find myself using www.php.net a lot. Or I did, until I decided to do something about it. Now, shell-scripting isn't what I spent most of my time on, so it's not with out a bit of pride, that I present to you phpm two-oh.
Most of the rest of the post is his bash script ready top cut and paste as well as some simple instructions on getting it working. (An emacs bonus is also included - a method for binding the script to a key to act on the current word.)
voice your opinion now!
command line manual bash script command line manual bash script
Ilia Alshanetsky's Blog: MS vs PHP
by Chris Cornutt February 20, 2006 @ 06:57:53
From Ilia Alshanetsky's blog today, there's a mention of a cartoon found on Microsoft's site mentioning PHP.
You know you're moving up in the world when Microsoft feels that it's necessary to make cartoon disparaging your products, in favor of their own wares. Pierre, one of the PHP developers, has found this gem on the French segment of the Microsoft site. I guess it means that PHP is making enough in-roads into the Enterprise market, that big fish like MS feel it necessary to spread some FUD as a stop-gap measure.
Check out this version for an english translation...
voice your opinion now!
microsoft comic bash spread FUD microsoft comic bash spread FUD
|
Community Events
Don't see your event here? Let us know!
|