Monday, April 14. 2008Yeah, I got itSunday, March 30. 2008phpUnderControl 0.4.0 releasedA few minutes ago I have released the latest phpUnderControl 0.4.0 version. In addition to many minor fixes and improvements this version comes with three utility commands, that should simplify some common tasks. 1) Project deleteThe project delete command provides a simple way to delete a complete project with all its contents, including logs, artifacts and sources, from your CruiseControl installation. [mapi@arwen~]$ phpuc delete --project-name connectfour /opt/cruisecontrol 2) Project cleanI do not really like this feature, because I really dislike the idea to delete old builds and artifacts, but I must admit that I have mounted a 100 GB partition as artifacts directory. Due to the fact that this feature was requested by many phpUnderControl users, it is implemented in phpUnderControl 0.4.0. This command allows you to delete old logs and artifacts except a configurable number of the latests builds. The following command will remove all build results for the php-under-control except the last 20 builds. [mapi@arwen~]$ phpuc clean --project-name php-under-control \
--keep-builds 20 /opt/cruisecontrol
3) Project createThe project create command provides a cli wizard to set up a new CruiseControl project. The following command will create a new project for the PHPUnit BankAccount sample, checkout the latest svn version, create the required directories and finally prepare the ant build.xml and the CruiseControl config.xml. If you don't like XML or you have multiple projects, that share a common source/project layout, this command could be useful for you. [mapi@arwen~]$ phpuc project --version-control svn \
--version-control-url svn://svn.phpunit.de/.. \
--project-name BankAccount2 \
--source-dir . \
--test-case BankAccountTest \
--test-dir . \
--test-file BankAccountTest.php \
--schedule-interval 20 \
/opt/cruisecontrol
But I would always recommend to use the example build.xml and config.xml to set up a new project. Both files are completely documented and contain links to the original CruiseControl configuration reference. I will do my best to complete the missing documentation for the CruiseControl config.xml file and the new cli commands. Any help is welcome.
Posted by Manuel Pichler
in php, phpugdo, phpundercontrol, planet-php, projects
at
14:37
| Comments (12)
| Trackbacks (0)
Tuesday, March 18. 2008Integrate php lint syntax checks in your build processHere is a small code snippet that can be used to integrate php's internal lint syntax check into your build process. The ant task apply behaves like the exec task, but it accepts a nested fileset element. This allows to process a set of input files thru a single command. <?xml version="1.0" encoding="UTF-8"?> <project name="phpUnderControl" basedir="." default="build"> ... <target name="checkphp"> <apply executable="php" failonerror="true"> <arg value="-l" /> <fileset dir="source/src"> <include name="**/*.php" /> </fileset> </apply> </target> <target name="build" depends="checkphp,php-codesniffer,phpdoc,phpunit" /> ... </project> This can also be used as an addition in your phpunit target or any other command which executes code during the build-process, when the command would quit due to a syntax error.
Posted by Manuel Pichler
in php, phpugdo, phpundercontrol, projects
at
21:05
| Comments (4)
| Trackbacks (0)
Friday, March 14. 2008PHP Unconference 2008Sadly, I could not attend last year's PHP Unconference. As I have heard from all attendees, it was a really great event. But this year I will participate and I am looking forward to the upcoming PHP Unconference in Hamburg where I will meet many geeks the first time. Together with Sebastian, I have proposed a talk about the state of the art of quality assurance in PHP. Due to the nature of an unconference nothing is fixed until the unconference is running, but I assume we have a good chances with our talk, because quality assurance seems to be one of the hottest topics at the moment.
It seems that this year a larger/complete delegation of usergroupies from Dortmund will attend. As tobias said earlier, Stay tuned for the Ruhrpott invasion, Hamburg!
Posted by Manuel Pichler
in php, phpugdo, phpundercontrol, planet-php
at
20:51
| Comments (0)
| Trackback (1)
Saturday, February 16. 2008Howto customize phpUnderControl!Due to the fact that every software is individual and in this context the used tools differ from build-process to build-process phpUnderControl 0.3.6 introduced a new feature that allows to customize the main menu bar. It is a simple placeholder based preprocessor. It extracts custom tabs from an existing phpUnderControl installation and takes them into newer version during the update process. At the moment only the main.jsp file supports this new preprocessor between each of the predefined tabs. Each phpUnderControl placeholder has the following format <%-- phpUnderControl ([0-9]+) --%> where ([0-9]+) represents a unique number. The following example shows a section from the main.jsp file as it is shipped with phpUnderControl 0.3.6. ... <cruisecontrol:tab name="log" url="<%=logs_url%>" label="XML Log File" /> <%-- phpUnderControl 4 --%> <cruisecontrol:tab name="metrics" label="Metrics" > <%@ include file="metrics.jsp" %> </cruisecontrol:tab> <%-- phpUnderControl 5 --%> <cruisecontrol:tab name="coverage" label="Coverage"> ... </cruisecontrol:tab> <%-- phpUnderControl 6 --%> <cruisecontrol:tab name="documentation" label="Documentation"> ... Now I would like to add two more documentation types to my build result. The agile Testdox documentation, generated by PHPUnit and the end user documentation generated from docbook xml files in the source repository. <%-- phpUnderControl 4 --%> <cruisecontrol:tab name="metrics" label="Metrics" > <%@ include file="metrics.jsp" %> </cruisecontrol:tab> <%-- begin phpUnderControl 5 --%> <cruisecontrol:tab name="testdox" label="Testdox"> <cruisecontrol:artifactsLink> <iframe src="<%= artifacts_url %>/testdox/testdox.html" width="100%" height="550" /> </iframe> </cruisecontrol:artifactsLink> </cruisecontrol:tab> <cruisecontrol:tab name="manual" label="Manual"> <cruisecontrol:artifactsLink> <iframe src="<%= artifacts_url %>/manual/index.html" width="100%" height="550" /> </iframe> </cruisecontrol:artifactsLink> </cruisecontrol:tab> <%-- end phpUnderControl 5 --%> <cruisecontrol:tab name="coverage" label="Coverage"> ... </cruisecontrol:tab> <%-- phpUnderControl 6 --%> I simply translated the placeholder number 5 into an opening %<-- begin phpUnderControl 5 --%> and a closing <%-- end phpUnderControl 5 --%> placeholder and put my custom tabs between this two comment. And this is what it looks like now. And the best thing is that you do not need to worry about future updates.
Posted by Manuel Pichler
in php, phpugdo, phpundercontrol, projects
at
15:32
| Comments (2)
| Trackbacks (0)
Defined tags for this entry: continuous integration, cruisecontrol, customization, java server pages, layout, phpundercontrol, phpunit
Tuesday, February 12. 2008phpUnderControl 0.3.6Except minor enhancements and bugfixes the latest phpUnderControl version comes with two new features.
Posted by Manuel Pichler
in php, phpugdo, phpundercontrol, projects
at
11:19
| Comments (6)
| Trackbacks (0)
Defined tags for this entry: continuous integration, cruisecontrol, phpundercontrol, phpunit, quality assurance, software metrics, testing
Wednesday, February 6. 2008How reusable, extensible and maintainable is your software?To provide a flexible and extendable software, it is a good OO practice to reduce the dependencies between implementing classes. This could be achieved by developing against abstractions which means both, abstract classes and interfaces. By using abstractions instead of real implementation in the application you provide some sort of contract, that could be used by others to hook into the application with their own classes that fulfill the contract. Except the extensibility of an application a good abstraction reduces the risk of breaks in multiple subsystems when something was changed in a single package. But how to get rid of all these dependencies, doing this by hand will become an impossible job, at least for larger projects. At this point a tool should be used to assist the development process. PHP_Depend is an adaption of the established Java development tool JDepend. This tool shows you the quality of your design in the terms of extensibility, reusability and maintainability. All these facts are influenced by the inter-package dependencies and the package abstraction that PHP_Depend visualizes in form of an abstract/instability chart and as a detailed XML report of all detected dependencies. PHP_Depend calculates the following metrics by counting classes, interfaces and dependencies.
With these values we can create a chart that visualizes the relationship between the instability (I) on the y-axis and the abstraction (A) on the x-axis. Because in a project not each package can achieve the optimal values of A = 1, I = 0 or A = 0, I = 1, we draw a diagonal between the two corners. This line is called the Main sequence and represents an average between abstraction (A) and instability (I). This means that packages near this line have a good mix between abstraction and instability. You can call these packages balanced. Because it is desirable for packages to be close to the Main sequence we have a fifth metric, the package distance (D) from this ideal.
If you are interested in this subject and PHP_Depend you can check out the latest version, including the unit tests, from the subversion repository or simply install the PHP_Depend PEAR package. But be aware this software is at a very early stage. mapi@arwen $ pear channel-discover pear.xplib.de mapi@arwen $ pear install xplib/PHP_Depend-alpha Now you can run PHP_Depend with the following command. pdepend <source-dir> [<output-dir>]
If you are interested in the code coverage follow this link I will close this post with a cite of Robert Martin:
The following sources were used for this post.
Posted by Manuel Pichler
in php, php_depend, phpugdo, phpundercontrol, planet-php, projects
at
17:52
| Comments (9)
| Trackback (1)
Defined tags for this entry: design quality, php, quality assurance, software architecture, software design, software metrics
Sunday, February 3. 2008New phpUnderControl release 0.3.5Yesterday I have released the latest phpUnderControl 0.3.5 version. In addition to many minor improvements this version brings two new features. A new index page, inspired by the dashboard of the continuous integration tool hudson phpUnderControl dashboard and a custom PhpDocumentor template which has its roots in the eZ Components api documentation. new phpdoc template.
Except these changes phpUnderControl comes with a lot of minor visual changes, mostly done by kore. Anymore I would like to thank tobias for his work on saturday evening, to get the phpunit.de pear channel to work
Posted by Manuel Pichler
in php, phpugdo, phpundercontrol, planet-php
at
19:41
| Comments (0)
| Trackbacks (0)
Defined tags for this entry: continuous integration, cruisecontrol, css, dashboard, phpdoc, phpundercontrol, quality assurance
Saturday, January 19. 2008phpUnderControl 0.3.x releasedYesterday I released version 0.3.(0|1|2) of phpUnderControl. Except bugfixes and enhancements the major change in this new version of phpUnderControl is an ezcGraph replacement of the original cewolf metrics view. For the excellent appearance of the generated graphics I would like to thank kore, who supported me actively with his deep knowledge of the ezcGraph component. Beside the better appearance, the new graph implementation has another advantage, it performs much better than the original cewolf implementation, because cewolf generates graphics in real time, while the new ezcGraph solution generates static graphics during the build process. To integrate the graph generator into your build process, you must alter the <publishers /> elements in the config.xml file. Simply add a CruiseControl execute-publisher that calls the phpUnderControl cli tool with the graph command, as shown in the following example. <cruisecontrol> <project name="php-under-control" buildafterfailed="false"> ... <publishers> ... <execute command="/path/to/phpuc(.php|.bat) graph logs/${project.name}"/> </publishers> </project> </cruisecontrol> The phpUnderControl graph command expects at least the project log directory as argument, it is the directory where CruiseControl stores the merged xml log files. In this default mode phpUnderControl will generate the metric charts for each build into logs/<project-name>/<build-timestamp>/graph directories. If you use a different CruiseControl setup where artifacts are not stored in the logs/ directory you can call the graph command with a second argument that specifies the output directory, for example:
[mapi@arwen /opt/cruisecontrol]$ phpuc graph logs/phpUnderControl \
artifacts/phpUnderControl
Finally I say thanks to Sebastian, because he integrates a new css file for the coverage reports into PHPUnit, that produces a harmonious overall picture between phpUnderControl and the coverage-report. This stylesheet is yet another contribution by kore. All phpUnderControl versions are available thru the phpunit.de pear channel, just type: [mapi@arwen ~]$ pear channel-discover pear.phpunit.de [mapi@arwen ~]$ pear install --alldeps phpunit/phpUnderControl-beta
Posted by Manuel Pichler
in php, phpugdo, phpundercontrol, planet-php
at
19:45
| Comments (11)
| Trackbacks (0)
Defined tags for this entry: continuous integration, cruisecontrol, css, ezcomponents, php, phpundercontrol, phpunit, quality assurance, testing
Wednesday, January 16. 2008Christmas 2007Ok it is a little bit outdated mainly because I have blogged about Sylvester earlier this year, but one of the presents I recieved no more than two weeks ago. It was this nice toy that you can see right next to this paragraph. Many thanks to Tobias who made this really great present to all groupies of the PHP User Group Dortmund
But I got my main geeky christmas present, one of these super, dupper, "everybody has it" ThinkPad notebooks, from my wife. It has really an other taste, nothing wobbles, everything works as expected under linux and I got me to work with this little red dot in the middle of the keyboard. Tuesday, January 1. 2008Sylvester 2007Sylvester 2007, I spent with my wife and the UG Members kore and jakob. In my opinion it was a really nice small event with good food, drinks and some cool parlor games. The only disappointing fact this evening was the fog, because it was impossible to enjoy our incredible view over a great part of the Ruhrgebiet. Despite the fog kore took some really cool photos with his new camera from our balcony: Before the fireworks started..., The firework (1/3), The firework (2/3), The firework (3/3), Some last skyrockets
The fog doesn't really stop in 2008
Posted by Manuel Pichler
in personal, phpugdo
at
17:59
| Comment (1)
| Trackbacks (0)
Defined tags for this entry: phpugdo, sylvester 2007
Friday, December 14. 2007Incredible experience, but true
Cite about software testing for today: "transfered to cars, if colleague Mr. XYZ tests, he puts his attention onto color and hifi instead of motor, consumption and quality". This was really crazy
Friday, November 23. 2007phpUnderControl updateI have never thought that phpUnderControl would be so interesting to others. From my point of view there were just a view modifications and extensions for the original CruiseControl setup that integrate some common PHP development tools. But the comprehensive and positive feedback told me something else. To my surprise Sebastian Bergmann asked me one day after the initial release to host the project on his PHPUnit website and I accepted his offer gladly. This means for you that you will find further releases of phpUnderControl on the PHPUnit website and in the related subversion repository. With this backing and positive feedback the development of the next phpUnderControl preview version started the same day. Beside some bugfixes and minor changes the latest phpUnderControl version has now a really nice layout, many thanks to kore who spent his time for this layout during the last UG meeting. Beyond these changes this release integrates the build artifacts of PHPUnit and PhpDocumentor into the CruiseControl user interface. For the upcoming release the planning is focused on an integrated project wizard, that allows an easy setup of custom projects, and support for windows.
Posted by Manuel Pichler
in php, phpugdo, phpundercontrol, planet-php
at
22:53
| Comments (4)
| Trackbacks (2)
Sunday, November 18. 2007First release of phpUnderControlThis is the first release of the phpUnderControl tool. This tool aims to take the first steps with CruiseControl and PHP as easy as possible. phpUnderControl integrates three of the best PHP development tools into CruiseControl, combined with an easy setup routine and a small example project. With the provided XSL-Stylesheets the generated output of PHPUnit, PHP_CodeSniffer and phpDocumentor can be visualized in CruiseControl, as you can see in the following screenshot. Getting startedNow let's take a look how to start with CruiseControl and phpUnderControl. The first things you need is a Java environment and a working installation of CruiseControl. I assume that Java is already installed and so I will not cover this topic here, but I suggest to use an original Java version from SUN instead of some versions bundled with linux distributions, because in combination with compiz or beryl the metrics view can be broken. Getting a working CruiseControl installation is a simple task. Just download one of the provided zip archives, unpack the contents and start the application. Because this initial release of phpUnderControl is only tested with CruiseControl 2.7, I suggest to use this version for the moment. You can download this version, if you click the following link: When the download has finished, just unzip the archive. unzip cruisecontrol-bin-2.7.zip -d /opt/ For a detailed installation description how to install CruiseControl and how to configure it with PHPUnit I recommend an excellent article by Sebastian Nohn and the Continuous Integration chapter from the PHPUnit Pocket Guide written by Sebastian Bergmann. Now, that you have a working CruiseControl, download the phpUnderControl tool from the following url and unpack the archive:
Small bugfix release, I left some system() calls in the source code. Now, you need to change to the phpUnderControl/bin directory and execute the following command to install the required files. All files that the command line tool modifies, are backed up with the file extension .orig. [mapi@frodo bin]$ ./phpuc.php install /opt/cruisecontrol-bin-2.7 Modifying CruiseControl files. File "main.jsp" modified. File "metrics.jsp" modified. File "xsl/buildresults.xsl" modified. Installing new CruiseControl files. File "phpcs.jsp" installed. File "phpunit-pmd.jsp" installed. File "xsl/phpcs.xsl" installed. File "xsl/phpcs-details.xsl" installed. File "xsl/phpdoc.xsl" installed. File "xsl/phphelper.xsl" installed. File "xsl/phpunit-pmd.xsl" installed. File "xsl/phpunit-pmd-details.xsl" installed. Modifying CruiseControl stylesheet. Creating backup of "css/cruisecontrol.css" as "css/cruisecontrol.css.orig". All you need now is an application with that CruiseControl can work. phpUnderControl comes with a little example application which can be installed with the following command. This example doesn't require any version control system installation. Instead it uses a special tag, that CruiseControl provides. [mapi@frodo bin]$ ./phpuc.php example -t ant /opt/cruisecontrol-bin-2.7 Creating required project directories. 1. Creating CruiseControl project dir "projects/php-under-control". 2. Creating Project input dir "php-under-control/source". 3. Creating Project source dir "php-under-control/source/src". 4. Creating Project test dir "php-under-control/source/tests". 5. Creating Project build dir "php-under-control/build". 6. Creating Project log dir "php-under-control/build/logs" 7. Creating API documentation dir "/tmp/php-under-control/api" 8. Creating Coverage dir "/tmp/php-under-control/coverage" Creating example files. Creating file "php-under-control/source/src/Math.php". Creating file "php-under-control/source/tests/MathTest.php". Creating project build file "php-under-control/build.xml". Preparing CruiseControl "/opt/cruisecontrol-bin-2.7/config.xml. 1. Loading "config.xml" data. 2. Backup original "config.xml" as "config.xml.orig". 3. Creating new project configuration. Now change to the /opt/cruisecontrol-bin-2.7 directory and execute the cruisecontrol.sh or cruisecontrol.bat script to start CruiseControl. If you open your browser with this url http://127.0.0.1:8080/buildresults/php-under-control you will see something similar to the next screenshot. PHPUnit features integratedAs mentioned in a previous post Sebastian Bergmann integrated support for Software Metrics and PMD in the PHPUnit 3.2 branch. Because he has used the original PMD format, the generated output was usable for CruiseControl without any modifications. Additionaly he integrated a third party contribution for Copy & Paste Detection that makes finding duplicate code fragments much easier. To show the results of this new report type the phpUnderControl tool provides modified versions of the original files pmd.xsl, pmd-details.xsl and metrics.jsp that can visualize the new records. PHP_CodeSniffer integration
The PEAR package PHP_CodeSniffer makes us PHP developers a present. With this handy tool coding guildline checks have become a really simple task. As a positive reaction on an other article Greg Sherwood, the lead developer of PHP_CodeSniffer, added support for the Checkstyle format to this package. Cool :-), with the upcoming 1.0.0RC3 release of PHP_CodeSniffer this package will work together with CruiseControl without any changes. The following screenshot shows the PHP_CodeSniffer result for the phpUnderControl example. Please note, all these errors are provoked and not the result of bad coding PLEASE NOTE: The current version 1.0.0RC2 has a small bug in the checkstyle output that causes CruiseControl to fail with the Checkstyle report. I hope this will be fixed in the RC3 release, but if you cannot wait just change line 720 in <pear-install>/PHP/CodeSniffer.php from echo ' line="'.$line.' "column="'.$column.'"'; to echo ' line="'.$line.'" column="'.$column.'"'; or you apply the following patch to <pear-install>/PHP/CodeSniffer.php Index: CodeSniffer.php =================================================================== RCS file: /repository/pear/PHP_CodeSniffer/CodeSniffer.php,v retrieving revision 1.55 diff -r1.55 CodeSniffer.php 720c720 < echo ' line="'.$line.' "column="'.$column.'"'; --- > echo ' line="'.$line.'" column="'.$column.'"'; or you modify the build.xml file and use the XSL-Stylesheet from my previous post. phpDocumentor integrationDuring the last user group meeting, while all others were hacking on some stuff. I thought this small javadoc legend in the "Coding violations" view must be fillable with the results of the standard PHP documentation tool phpDocumentor. The current integration is based on text matching onto the command line output of the phpdoc script which is not a perfect solution. For a future release of phpUnderControl there will be a custom implementation of the output converter that will process the documentation errors and warnings. FinallyI hope this post and the phpUnderControl tool helps someone and was interesting for some of the readers. The current version is only tested under linux which means that I cannot say anything about windows, so I would be delighted if someone provides windows phpuc.bat or phpuc.cmd file.
Posted by Manuel Pichler
in php, phpugdo, phpundercontrol, planet-php
at
16:41
| Comments (5)
| Trackback (1)
Friday, November 2. 2007eZ Components book, the best book ever
Yesterday I recieved my copy of the new eZ Components book from my favourite deliverer
On the basis of a single sample application both authors, Kore Nordmann and Tobias Schlitt, take the reader on a journey into the depth of many components and in addition they show many PHP best practices. In my opinion the approach of a single example application is really great, because the readers are not forced to switch between different contexts and code snippets, that allows them to be concentrated on the main topic of the book. What this book makes really special for me is, that I have spend most time during my summer vacation to cross-read all chapters, to propose some changes and to correct some inaccuracies. To be honest the most important part in this book are two small words in the foreword
« previous page
(Page 5 of 6, totaling 81 entries)
» next page
|
ProjectsFurther stuffCategories |

