Exporting SVN Change Log in Phing

Posted: Jul 17, 2010
Last night I was working on add a phpDocumentor task to a Phing build script I have been working on.  While Phing offers integration with phpDocumentor as well as some SVN task such as commuting, updating, and exporting, it doesn't have a native way to export the change log which I would like to include in the documentation.  However, one great feature of Phing is how easy it is to expand.  I wrote this little ad-hoc task to export the SVN history to a file which I then include in the documentation.

Here is the code if you'd like to add it to your build scripts:

<adhoc-task name="svnlog">
<!--[
CDATA[
class 
svnLog extends Task 
    private 
$file;
    private 
$svnpath;
    private 
$repositoryurl;
    
    function 
setFile($file) { 
        
$this->file $file
    }
    
    function 
setSvnPath($svnpath) { 
        
$this->svnpath $svnpath
    }
    
    function 
setRepositoryUrl($repositoryurl) { 
        
$this->repositoryurl $repositoryurl
    }
    
    private function 
writeSvnLog($svnpath="/usr/bin/svn"$repositoryurl$file){
        
$cmd $svnpath " log " $repositoryurl " > " $file;
        echo 
$cmd "\n";
        
system($cmd);
        return 
true;
    } 
    
    function 
main() { 
        
$this->writeSvnLog($svnpath $this->svnpath$repositoryurl $this->repositoryurl$file $this->file);
    } 
}
]]-->
</
adhoc-task>


Here is how you call it:
<svnlog svnpath="/usr/bin/svn" repositoryurl="http://rex/svn/${package}/" file="${workingDir}/CHANGELOG"></svnlog>

Do you Care?

Posted: Jul 12, 2010
I was flipping through some news the other day and read a story about how a BestBuy employee was expecting to be fired after releasing a video which in didn't mention BestBuy, didn't he was an employee of BestBuy, and didn't even mention his name.  For this, I figured I should at least watch the video since he gave up his job for it.

This classic tale tells the story of an typical Apple customer asking for an iPhone and can't tell you why or listen to any evidence that the iPhone isn't the greatest thing ever.  Well worth the three minutes to watch it.

On a related note, if you don't watch Futurama, you should.  The last episode, "Attack of the Killer App" was awesome.  They really got the essence of the nonsensical hype that is apple.

This isn't the best part, but I love the observations that since it is Twitter and not Tweeter, a message isn't a tweet, it is a twit, right?

FuturamaThursdays 10pm / 9c
The Twit Worm
www.comedycentral.com
Futurama New EpisodesFuturama New EpisodesIt's Always Sunny in Philadelphia

Deploying PHP with PHING

Posted: Jul 06, 2010
A couple of months ago I came across PHING, a deployment system for PHP.  It seems pretty straight forward to use and really tuned for PHP.  It has tons of extensions to use all the tools a PHP developer would want.  I finally have something that will run on Windows or Linux and will mange deployments on my local box, a prototype server, or my productions servers and all I have to do is put together a little XML config file.

I alike that it is so easily customizable as well.  For instance, my production server runs PHP in cgi mode so I can't change PHP settings in the .htaccess fiel so I have to have a php.ini file in every directory that has PHP to change these settings (on a side note, I'm looking forword to getting php5.3 installed which introduces the .user.ini setting which works like a .htaccess just for PHP).  I really didn't want to maintain serveral copies of the same php.ini file so I wrote a little adhoc-task which expands PHING to copy a single file to every directory in the tree.  A couple of lines of PHP in my PHING build.xml and I'm up and running.

    <adhoc-task name="copyrecurse">
    <![CDATA[
    class copyRecurse extends Task 
        private $file;
        private $todir;
        private $file_name;
        
        
function setFile($file) { 
            $this->file $file
        }
        
        
function setToDir($todir) {
            $this->todir $todir
        }
       
        
private function getDirectoryTree($BASE_DIR,$LEVEL=1){
            $THIS_DIR array_diffscandir($BASE_DIR), array_merge(array( ".""..",".svn")) );
            foreach( $THIS_DIR as $DIR ) {
                if(is_dir($BASE_DIR."/".$DIR)){
                    copy($this->file$BASE_DIR."/".$DIR "/" $this->file_name);
                    $this->getDirectoryTree($BASE_DIR."/".$DIR);
                }
            }
            return true;
        
        <br>        function main() { 
            $this->file_name basename($this->file);
            $this->getDirectoryTree($BASE_DIR $this->todir);
        
    }
    ]]>
    </adhoc-task>
    <copyrecurse file="${workingDir}php.ini" todir="${workingDir}" />



I'm looking forward to using PHING in the future and integrating some of the tools it gives me access to.  Hopefully more of us will start using it to help ensure it is maintained going forward.
If I ever doubted how much my wife loves (which I don't after she moved to Pittsburgh with me), it is gone.  Last night she had the idea that we go see the A-Team.  Not because she wanted to see it (I actually believe the opposite to be true) but because she knew I would like it.  After watching G.I. Joe last fall, I was a little scared about seeing a movie based on a show from my childhood. 

I came in with very low expectations, and with that said, it was a really good movie.  Not the best movie ever made but a good couple of hours.  I wasn't optimistic about seeing Liam Neeson as Hannibal, but he did ok.  I was however really impressed with the casting for Face and Murdoch.  Bradley Cooper did a great job of playing Face bringing a great conman-esqe presense to teh character.  The part I like the most was Murdoch played by Sharlto Copely.  I didn't recognize Copely at first, but then it came back to me when I saw he was in District 9.  I don't really know his back story about how he got into acting as IMDB only lists him in a 2005 movie I have never head of and then District 9 and the A-Team.  I'm looking forward to seeing his next project (and hopefully in an A-Team sequel.

If you liked the TV show, I recommend seeing the movie either in the theater or at least on DVD.  If you haven't see the TV show, it may not be the same as someone how knows the characters.  Lucky for you, all six seasons are streaming on Netflix (I'm rewatching them now).
Tonight Jenny and went to go see Rob Schneider at the D.C. Improv.  So far everyone I told about we were going seemed rather unimpressed.  The comment I liked the most was that Rob Schneider was only good at making other people look funny.  While true he is good at that, he was great live.  He did a long set which was nice since he was who I was paying to see.  It took him a few minutes to warm up, but once he got going, he was really funny.  Totally worth the $25 for the ticket.

Beyond the comedy, the thing I remember is that he was really doing what people wanted.  Unlike some other comedians, he got up on stage and gave us the "You Can Doooo It" voice a few times along with several other of his more famous lines.  He has gt to be sick of those, but he gave us what we wanted.  He also told a great story about "You Can Do It" which you'll have to see him to hear, but in any case, he does a great Adam Sandler impression.

Another expected bonus was that after the show, he came out to the front of the house and signed autographs.   Although he was selling shirts that he would sign, I believe he was signing other things and talking to people for no charge.  For a guy who has been a celebrity for so long, it is nice to see that he remember who pays him.  BTW, he is really short.

iPad Printing

Posted: Apr 17, 2010
iPad Printer
In case you got home with your new iPad and then realized that you can't really do much with it, there is some hope.  Although Apple doesn't think you need to be able to print anything anymore (they are very forward thinking remember), HP has created a new all in one printer/scanner/copier that is compatible with the iPad.  While not officially supported by Apple, it is your best option for printing from your iPad.


Enjoy your iPad!!!
Lots of blue boxesThe iPad has now been released now and as "neat" as it is, I'm not sure why people are putting down $500 to $1000 for a new device that doesn't replace anything and just sets you up to spend more in the future.  Lee Brimelow, a Platform Evangelist at Adobe put together a great graphic demonstrating the "entire" web that Apple delivers.  One point that he hit in his rant against Apple is this, "APPLE DOES NOT WANT THE FLASH PLAYER TO PERFORM WELL. They don’t want you to go to Hulu or play Flash games because they worry that you won’t buy their apps."

I'm really not sure why people think Apple is so great, they are all about restricting choice, limiting functionality, and above all crushing their competition by any means possible (except of course by letting consumers decide).

For those of you who are planning on buying a new iPad, here is what you have to look forward to...



If you have a few minutes, I recommend reading Lee's article.
Previous
Next