2005 November

SimpleTest 1.0.0 on Pearified.com

Just a quick note to say that Pearified.com isn't dead in the water: I put up a release of SimpleTest 1.0.0 last night. Now that I've moved and mostly unpacked and gotten settled, I plan to be updating several of the packages I have on Pearified.com soon, as well as adding some new ones. Stay tuned!

Subversion Wrapper for Zend Studio 5

As I mentioned yesterday, one of the things about Zend Studio 5 that's been really irritating is the unnecessary use of, and escaping of, double quotes in Subversion commit messages triggered by Zend Studio 5.

The following little script fixes that behavior by dropping the opening and closing double quotes, and stripping slahses within the commit message, as they simply don't need to be there. The script is written with the Mac OS X environment in mind, so tweak as you need to if you're also experiencing this problem.

#!/usr/bin/php
/**
* zendsvn
*
* Wrapper script to strip unnecessary quotes from latest Zend Studio 5
* SVN commit message.
*
* Copyright (c) 2005 Clay Loveless (http://www.killersoft.com)
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/

/**
* Use PEAR's system command to find the svn executable
*/
require_once 'System.php';

$svnargs = '';
if (!empty(
$argv)) {
    // Is this a commit message?
    if ($argv[||!prliignore35||||!prliignore36||1||!prliignore37||||!prliignore38||] == 'commit' || $argv[||!prliignore47||||!prliignore48||1||!prliignore49||||!prliignore50||] == 'ci') {
        // Commit message is written to temporary file stored in a location passed in $argv[4]
        $lastCommitTmp = $argv[||!prliignore65||||!prliignore66||4||!prliignore67||||!prliignore68||];
        $lastCommitMsg = file_get_contents($lastCommitTmp);
        // Get rid of encapsulating quotes
        $lastCommitMsg = substr($lastCommitMsg, 1, -1);
        $lastCommitMsg = stripslashes($lastCommitMsg);

        // Write it back for use by SVN
        echo "Fixing Zendism in $lastCommitTmp ...\n";
if (
$fp = fopen($lastCommitTmp, 'w')) {
            fwrite($fp, $lastCommitMsg);
            fclose($fp);
}
}
    $argvlen = count($argv);
for (
$i = 1; $i < $argvlen; $i++) {
        $svnargs .= $argv[||!prliignore199||||!prliignore200||$i||!prliignore201||||!prliignore202||].' ';
}
}
$svn = System::which('svn', '/usr/local/bin/svn');
passthru("$svn $svnargs");
?>

To use the script, just copy it into your executable path, make it executable, then select it as your SVN command-line tool in Preferences » Source Control » Path to SVN.

The above script is released under the MIT License, so run with it as you see fit.

Switching Pains: BBEdit 8 to Zend Studio 5

I really, really want to be benefitting from Zend Studio 5. Really. Despite my gripes about the install process, similar to problems others have had, I've got it installed, and it's running well.

However, as a decade-long user of BBEdit, I continue to try to do things in the usual way (for me), and find that I can't.

Note: I mention all of this because I would appreciate any tips anyone has for workarounds. I'm not bitching just to bitch. I've submitted several of these to Zend as feature requests already.

For example:

  • No Shift Left/Shift Right
    In BBEdit, I can select a block of code and use command-] to shift the entire block one tab stop to the right, and command-[ to shift the block one tab stop to the left. Intending within the selected block remains unchanged going to the right, and it remains unchanged going to the left until you hit the left document margin, at which point tab values (an actual tab, or 4 spaces) are subtracted from the left for each command-[.In Zend Studio ... nothing like this appears to exist.
  • Double-clicking white space
    In BBEdit, a nice time-saver is the ability to double-click whitespace to select that block of whitespace. In Zend Studio, double-clicking whitespace does nothing.
  • Only one project window at a time
    Perhaps this is the cost of getting used to a true IDE for PHP work instead of using something like BBEdit. With BBEdit 8, I've gotten very used to the document drawers and file groups, which allow me to keep project files accessible through one window and allows me to flip between projects rapidly without Zend Studio's cumbersome project switching.
  • Subversion or CVS, but not both
    Anyone out there who uses Subversion able to avoid CVS entirely? Didn't think so. The day may come (or not ... sigh) but until it does, Subversion fans have to swtich Zend Studio application-wide preferences to flip between SVN and CVS. BBEdit, on the other hand, gives access to SVN, CVS and Perforce source control menus on a per-file basis.

Those are the main items bugging me. I would appreciate any tips that anyone may have on these -- the Shift Left/Shift Right functionality is what I'm missing the most.