<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>João Prado Maia's Weblog &#187; PHP</title>
	<atom:link href="http://pessoal.org/blog/category/php/feed/" rel="self" type="application/rss+xml" />
	<link>http://pessoal.org/blog</link>
	<description></description>
	<lastBuildDate>Tue, 11 Aug 2009 00:42:33 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=abc</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Setting up phpUnderControl (and CruiseControl) under debian etch</title>
		<link>http://pessoal.org/blog/2009/08/10/setting-up-phpundercontrol-and-cruisecontrol-under-debian-etch/</link>
		<comments>http://pessoal.org/blog/2009/08/10/setting-up-phpundercontrol-and-cruisecontrol-under-debian-etch/#comments</comments>
		<pubDate>Tue, 11 Aug 2009 00:42:33 +0000</pubDate>
		<dc:creator>jpm</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[cruisecontrol]]></category>
		<category><![CDATA[debian]]></category>
		<category><![CDATA[phpundercontrol]]></category>

		<guid isPermaLink="false">http://pessoal.org/blog/?p=212</guid>
		<description><![CDATA[This might not be as useful since we finally have debian lenny available, but then again, maybe it will be useful for some people out there.
I had to setup phpUnderControl (and CruiseControl) at my job to manage our day to day work, and it took quite a bit of time to figure out how to [...]]]></description>
			<content:encoded><![CDATA[<p>This might not be as useful since we finally have debian lenny available, but then again, maybe it will be useful for some people out there.</p>
<p>I had to setup phpUnderControl (and CruiseControl) at my job to manage our day to day work, and it took quite a bit of time to figure out how to setup everything properly from the ground up. This post is derived from my notes that we keep in our internal wiki.</p>
<ol>
<li>Edit /etc/apt/sources.list and make sure the unstable repo is listed in there
<pre>
deb http://ftp.debian.org/debian/ unstable non-free
deb-src http://ftp.debian.org/debian/ unstable non-free
</pre>
</li>
<li>apt-get update</li>
<li>apt-get -t unstable install sun-java6-jre sun-java6-jdk</li>
<li>Run &#8220;java -version&#8221; to verify the installation
<pre>
root@etch-64-dev-ui:~# java -version
java version "1.6.0_10"
Java(TM) SE Runtime Environment (build 1.6.0_10-b33)
Java HotSpot(TM) 64-Bit Server VM (build 11.0-b15, mixed mode)
</pre>
</li>
<li>Add JAVA_HOME to /etc/environment:
<pre>
JAVA_HOME="/usr/lib/jvm/java-6-sun"
</pre>
</li>
<li>source /etc/environment</li>
<li>Download binary distribution of CruiseControl (available here:  http://cruisecontrol.sourceforge.net/download.html)</li>
<li>Install CruiseControl:
<pre>
$ unzip cruisecontrol-bin-2.7.3.zip -d /opt
$ ln -s /opt/cruisecontrol-bin-2.7.3 /opt/cruisecontrol
</pre>
</li>
<li>Install PEAR (if it&#8217;s not already there):
<pre>
$ apt-get install php-pear
</pre>
</li>
<li>Upgrade PEAR to latest release:
<pre>
$ pear upgrade-all
</pre>
</li>
<li>Install PHPUnit and phpUnderControl:
<pre>
$ pear channel-discover pear.phpunit.de
$ pear install phpunit/PHPUnit
$ pear install --force --alldeps phpunit/phpUnderControl
$ phpuc install /opt/cruisecontrol
</pre>
</li>
<li>Install Xdebug (needed for code coverage analysis):
<pre>
$ pear install pecl/xdebug
</pre>
</li>
<li>Add Xdebug zend extension to php.ini (on our case /etc/php5/cli/php.ini):
<pre>
zend_extension="/full/path/to/xdebug.so"
</pre>
</li>
<li>Create a CruiseControl project for your existing PHP project&#8217;s unit tests:
<pre>
$ phpuc project --version-control svn --username "cruisecontrol" --password "password_here" --version-control-url svn://svn.domain.com/repository/project-name/trunk --test-case MyProjectTestSuite --test-dir "/opt/cruisecontrol/projects/my-project/source/unit_tests" --test-file "MyProjectTestSuite.php" --project-name MyProject /opt/cruisecontrol
</pre>
</li>
<li>Edit projects/MyProject/build.xml so it contains the following content:
<pre>
&lt;?xml version="1.0" encoding="UTF-8"?>
&lt;project name="MyProject" default="build" basedir=".">
  &lt;target name="build" depends="php-documentor,php-codesniffer,phpunit"/>
  &lt;target name="php-documentor">
    &lt;exec executable="phpdoc" dir="${basedir}/source" logerror="on">
      &lt;arg line="--title '${ant.project.name}' -i *pear/*,*Smarty/*,*fpdf/*,*jpgraph/* -ue on -t ${basedir}/build/api -d ${basedir}/source/lib -tb '/usr/share/php/data/phpUnderControl/data/phpdoc' -o HTML:Phpuc:phpuc"/>
    &lt;/exec>
  &lt;/target>
  &lt;target name="php-codesniffer">
    &lt;exec executable="phpcs" dir="${basedir}/source" output="${basedir}/build/logs/checkstyle.xml" error="/tmp/checkstyle.error.log">
      &lt;arg line="--ignore=*/PEAR/*,*/Smarty/*,*/fpdf/*,*/jpgraph/*,*/misc/* --report=checkstyle --standard=PEAR ${basedir}/source"/>
    &lt;/exec>
  &lt;/target>
  &lt;target name="phpunit">
    &lt;exec executable="phpunit" dir="${basedir}/source/unit_tests" failonerror="on">
      &lt;arg line=" --log-xml ${basedir}/build/logs/phpunit.xml --log-pmd ${basedir}/build/logs/phpunit.pmd.xml --coverage-xml ${basedir}/build/logs/phpunit.coverage.xml --coverage-html ${basedir}/build/coverage MyProjectTestSuite /opt/cruisecontrol/projects/MyProject/source/unit_tests/MyProjectTestSuite.php"/>
    &lt;/exec>
  &lt;/target>
&lt;/project>
</pre>
</li>
</ol>
<p>You will need to tweak a few things, like the &#8220;MyProject&#8221; name and probably some of the &#8220;ignore rules&#8221; for phpCodeSniffer, but it should be a great starting point for most projects.</p>
]]></content:encoded>
			<wfw:commentRss>http://pessoal.org/blog/2009/08/10/setting-up-phpundercontrol-and-cruisecontrol-under-debian-etch/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Follow-up on HttpWatch integration with Selenium</title>
		<link>http://pessoal.org/blog/2008/07/03/follow-up-on-httpwatch-integration-with-selenium/</link>
		<comments>http://pessoal.org/blog/2008/07/03/follow-up-on-httpwatch-integration-with-selenium/#comments</comments>
		<pubDate>Thu, 03 Jul 2008 19:23:51 +0000</pubDate>
		<dc:creator>jpm</dc:creator>
				<category><![CDATA[HttpWatch]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Performance Tuning]]></category>
		<category><![CDATA[Selenium]]></category>
		<category><![CDATA[YSlow]]></category>

		<guid isPermaLink="false">http://pessoal.org/blog/?p=107</guid>
		<description><![CDATA[Simon Perkins of Simtec Ltd (makers of the HttpWatch plugin for Internet Explorer that I mentioned before) was kind enough to get in touch with me via email about my wishlist for YSlow / HttpWatch / AOL Pagetest.
He wasn&#8217;t familiar with Selenium, but said that it might be possible to hook up HttpWatch to retrieve [...]]]></description>
			<content:encoded><![CDATA[<p>Simon Perkins of Simtec Ltd (makers of the <a href="http://httpwatch.com">HttpWatch</a> plugin for Internet Explorer that I mentioned before) was kind enough to get in touch with me via email about my wishlist for YSlow / HttpWatch / AOL Pagetest.</p>
<p>He wasn&#8217;t familiar with Selenium, but said that it might be possible to hook up HttpWatch to retrieve performance data dynamically. He pointed to a <a href="http://www.marekj.com/2008/04/using-httpwatch-with-watir/">blog post</a> describing how to do so with <a href="http://wtr.rubyforge.org/">Watir</a>, an automated web testing tool written in Ruby. Simtec even has a <a href="http://httpwatch.com/rubywatir/">tutorial about this</a> on their own web site.</p>
<p>While that does sound interesting, it looks like Watir interfaces with HttpWatch with a COM object on Windows, and that&#8217;s how it gets the performance information.</p>
<p>The way to do this integration with <a href="http://selenium.openqa.org/">Selenium</a> would be to expose a set of JavaScript APIs (maybe the same set of objects available through the COM layer?), so one could write JavaScript code to export the HttpWatch information. That&#8217;s really what I would love to see.</p>
<p>If that was available, I could write a simple <a href="http://selenium-rc.openqa.org/">Selenium RC</a> test suite in PHP, remote control a set of browsers from my Linux box, and get access to this performance data from HttpWatch by simply running some JavaScript function.</p>
]]></content:encoded>
			<wfw:commentRss>http://pessoal.org/blog/2008/07/03/follow-up-on-httpwatch-integration-with-selenium/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Using Selenium RC with multiple users</title>
		<link>http://pessoal.org/blog/2008/06/26/using-selenium-rc-with-multiple-users/</link>
		<comments>http://pessoal.org/blog/2008/06/26/using-selenium-rc-with-multiple-users/#comments</comments>
		<pubDate>Thu, 26 Jun 2008 19:17:47 +0000</pubDate>
		<dc:creator>jpm</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Selenium]]></category>
		<category><![CDATA[Work]]></category>

		<guid isPermaLink="false">http://pessoal.org/blog/?p=102</guid>
		<description><![CDATA[Zachary Fox (from Alert Logic too) wrote a very good tutorial on how to run Selenium RC to execute unit tests in a team environment.
If you have multiple users running unit tests concurrently against the same Selenium RC server, some nasty things may happen. Zach explains how to properly setup multiple Selenium RC servers, so [...]]]></description>
			<content:encoded><![CDATA[<p>Zachary Fox (from <a href="http://alertlogic.net">Alert Logic</a> too) wrote a very good <a href="http://www.zacharyfox.com/blog/testing/selenium-rc-multiple-users">tutorial on how to run Selenium RC</a> to execute unit tests in a team environment.</p>
<p>If you have multiple users running unit tests concurrently against the same Selenium RC server, some nasty things may happen. Zach explains how to properly setup multiple Selenium RC servers, so everyone can work on their own server.</p>
]]></content:encoded>
			<wfw:commentRss>http://pessoal.org/blog/2008/06/26/using-selenium-rc-with-multiple-users/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>FirePHP &#8211; Debugging PHP applications with Firebug</title>
		<link>http://pessoal.org/blog/2008/05/14/firephp-debugging-php-applications-with-firebug/</link>
		<comments>http://pessoal.org/blog/2008/05/14/firephp-debugging-php-applications-with-firebug/#comments</comments>
		<pubDate>Wed, 14 May 2008 15:25:18 +0000</pubDate>
		<dc:creator>jpm</dc:creator>
				<category><![CDATA[Firebug]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://pessoal.org/blog/?p=99</guid>
		<description><![CDATA[
FirePHP seems like a very cool project, allowing PHP developers to debug applications without having to disrupt the normal process of a script. It works by sending the debug content to the browser in special HTTP headers, and the Firefox extension add-on to Firebug will parse those and display them in a special panel within [...]]]></description>
			<content:encoded><![CDATA[<p><a href='http://pessoal.org/blog/wp-content/uploads/2008/05/firephp.png'><img src="http://pessoal.org/blog/wp-content/uploads/2008/05/firephp.png" alt="FirePHP Screenshot" title="FirePHP Screenshot" width="422" height="457" /></a></p>
<p><a href="http://www.firephp.org/">FirePHP</a> seems like a very cool project, allowing PHP developers to debug applications without having to disrupt the normal process of a script. It works by sending the debug content to the browser in special HTTP headers, and the Firefox extension add-on to Firebug will parse those and display them in a special panel within Firebug.</p>
<p>It&#8217;s so useful I&#8217;m going to install this right now. I can&#8217;t believe nobody else thought about doing this before!</p>
]]></content:encoded>
			<wfw:commentRss>http://pessoal.org/blog/2008/05/14/firephp-debugging-php-applications-with-firebug/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Generating Graphs with PHP and Google Charts API</title>
		<link>http://pessoal.org/blog/2008/04/30/generating-graphs-with-php-and-google-charts-api/</link>
		<comments>http://pessoal.org/blog/2008/04/30/generating-graphs-with-php-and-google-charts-api/#comments</comments>
		<pubDate>Wed, 30 Apr 2008 20:53:03 +0000</pubDate>
		<dc:creator>jpm</dc:creator>
				<category><![CDATA[Google]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://pessoal.org/blog/?p=90</guid>
		<description><![CDATA[
Ludwig Pettersson has a really good overview of the Google Charts API, and how you can integrate your PHP scripts with it. He created a PHP library that wraps around the API, and makes it really easy to generate graphs that way.
I&#8217;m not sure if I would move away from JpGraph to this new library, [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://pessoal.org/blog/wp-content/uploads/2008/04/chart.png" alt="" title="Example of graph created through this library" width="300" height="200" class="alignleft size-full wp-image-95" /></p>
<p>Ludwig Pettersson has a <a href="http://luddep.se/notebook/2008/04/charts_with_php_and_google_charts_api">really good overview of the Google Charts API</a>, and how you can integrate your PHP scripts with it. He created a PHP library that wraps around the API, and makes it really easy to generate graphs that way.</p>
<p>I&#8217;m not sure if I would move away from <a href="http://www.aditus.nu">JpGraph</a> to this new library, but it seems really cool no matter what. I guess it could be an option if you wanted to avoid doing all of the manual work associated with different types of graphs, and offload some graph generation to Google.</p>
]]></content:encoded>
			<wfw:commentRss>http://pessoal.org/blog/2008/04/30/generating-graphs-with-php-and-google-charts-api/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
