Blogs / Thiago Campos Viana / PHP Continuous Integration: A first attempt

PHP Continuous Integration: A first attempt

Monday 22 November 2010 4:11:39 am

  • Currently 3 out of 5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

By : Thiago Campos Viana

In this post I will create a walkthrough on how to set up an php continuous enviroment on Windows. This is not a complete post, I will need your help to make it perfect.

 Download XAMMP Lite
 
 http://www.apachefriends.org/en/xampp-windows.html
 
 Install it in C:\
 
 \apache\conf\httpd.conf
 
 Uncoment #LoadModule rewrite_module modules/mod_rewrite.so 
 Change the settings in the file: C:\xampplite\php\php.ini
 

max_execution_time 180
max_input_time 180
memory_limit 128

 
 
 
 
 ########################
 
 Control Panel->System->Advanced->Environment Variables->User Variables for XXXX
 Add or change the PATH variable with the value: C:\xampplite\php
 
 ########################
 Download XDebug
 
 http://xdebug.org/download.php
 
Rename the dll file to XDebug to php_xdebug.dll
 
Move it to C:\xampplite\php\ext
 
 
Open the file C:\xampplite\php\php.ini:
 

# At the XDebug block add: zend_extension = "XAMPP_HOME\php\ext\php_xdebug.dll".
 # Find and uncomment the line: xdebug.remote_host=localhost. Change the value of the setting from localhost to 127.0.0.1.
 # Find and uncomment the line: xdebug.remote_enable = 0. Change 0 to 1.
 # Find and uncomment the line: xdebug.remote_handler = "dbgp".
 # Find and uncomment the line: xdebug.remote_port = 9000.
 # Save the php.ini file.

 
 
 
 ########################
 
 Install pear extensions
 
 Start->Run->Type "cmd"
 
 

cd C:\xampplite\php
 
pear channel-update pear.php.net
 
pear channel-discover pear.symfony-project.com
pear install symfony/YAML
#pear upgrade symfony/YAML

pear channel-discover components.ez.no
pear install -a ezc/eZComponents
#pear upgrade ezc/eZComponents


 
pear channel-discover pear.phpunit.de
pear remote-list -c phpunit
pear install --alldeps phpunit/PHPUnit
#pear upgrade phpunit/PHPUnit

pear install PhpDocumentor
 
pear install Testing_Selenium-beta
 
pear install PHP_CodeSniffer
 
pear channel-discover pear.xplib.de
 
pear install xplib/PHP_CodeSniffer_Standards_EZC-beta
 
pear install phpunit/PHP_CodeBrowser
 

 
 
pear channel-discover pear.pdepend.org
 
 
pear install pdepend/PHP_Depend-beta
 
 
pear channel-discover pear.phpmd.org
 
pear install phpmd/PHP_PMD-alpha
 
pear install --alldeps phpunit/phpUnderControl

 http://sourceforge.net/projects/cruisecontrol/files/
 
 Install java jdk
 change the JAVA_HOME variable to C:\Program Files\Java\jdk1.6.0_17
 

Maybe it could be needed to copy jdk_home/lib/tools.jar to jre6_home/lib/ext
 
 
 Run using the Start menu the file cruisecontrol.bat
 
 phpuc install "C:\Program Files\CruiseControl"
 
 
 Close the cruisecontrol prompt and go to the Start menu and open it again.
 
 
 ########################
 Download Netbeans (PHP or Full)
 http://netbeans.org/downloads/index.html
 
 Change Netbeans language:
 
 Netbeans_Folder\etc
 
 Open "netbeans.conf", find the default options line:
 
 netbeans_default_options="-J-client -J-Xss2m -J-Xms32m -J-XX:PermSize=32m -J-XX:MaxPermSize=200m -J-Xverify:none -J-Dapple.laf.useScreenMenuBar=true"
 
Add "-J-Duser.language=en -J-Duser.region=US" to the end of line:
 

netbeans_default_options="-J-client -J-Xss2m -J-Xms32m 
-J-XX:PermSize=32m -J-XX:MaxPermSize=200m -J-Xverify:none 
-J-Dapple.laf.useScreenMenuBar=true -J-Duser.language=en 
-J-Duser.region=US"

 
Open the Netbeans

 Tools->Options->PHP
 
 General
 PHP 5 Interpreter=C:\xampplite\php\php.exe
 UnitTesting
 PHPUnit Script: C:\xampplite\php\phpunit.bat
 
 
 ########################
 Download NBGit
 
 http://code.google.com/p/nbgit/
 
 Netbeans->Tools->Plugins->Download->Add Plugin
 
 Team->Git->Clone other
 
 http://github.com/ezsystems/ezpublish.git ( Only the benchmark and tests folder are important now )
 
 ###########################
 download netbeans php codesniffer
 
 http://github.com/beberlei/netbeans-php-enhancements/downloads/
 
 
 
 Tools->options->php->code sniffer->pear
 
 #################################
 
 available plugins
 
 selenium module for php
 
 #################################
 
 php md for netbeans ( I'm not sure if it is woking )
 
 
 http://sourceforge.net/projects/phpmdnb/
 
 Tool->options->misc->phpmd
 
 Using phpmd:

phpmd C:\xampplite\htdocs\ez\kernel\classes\ezaudit.php xml codesize,design,unusedcode,naming --reportfile C:\teste.xml

 
 ############################
 
 Using pdepend:

pdepend --summary-xml=/tmp/summary.xml \ 
 --jdepend-chart=/tmp/jdepend.svg \ --overview-pyramid=/tmp/pyramid.svg \
 /usr/local/share/pear/PHP/Depend

 
 
 ############################
 Download ez publish
 
 http://share.ez.no/download-develop
 
 C:\xampplite\htdocs
 
 extract ezpublishcommunity-4.4.0-with_ezc-gpl.tar.gz
 rename the folder ezpublish-4.4.0-with_ezc-gpl to ez
 

 Install it.

 
 
 #########
 
Running tests:

php bin/php/ezpgenerateautoloads.php -e
php tests/runtests.php extension/extfolder

BD testing

php tests/runtests.php -D mysql://root@localhost/ezpublish extension/extfolder

#########

Now you need to set up cruisecontrol to work with your project.

eZ debug

Timing: Jan 18 2025 00:05:08
Script start
Timing: Jan 18 2025 00:05:08
Module start 'content'
Timing: Jan 18 2025 00:05:08
Module end 'content'
Timing: Jan 18 2025 00:05:08
Script end

Main resources:

Total runtime0.2745 sec
Peak memory usage6,144.0000 KB
Database Queries186

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0108 588.9844180.8125
Module start 'content' 0.01090.1079 769.7969444.6563
Module end 'content' 0.11880.1557 1,214.4531412.6172
Script end 0.2744  1,627.0703 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00451.6487210.0002
Check MTime0.00160.5845210.0001
Mysql Total
Database connection0.00110.384710.0011
Mysqli_queries0.159458.05841860.0009
Looping result0.00230.83331840.0000
Template Total0.241087.820.1205
Template load0.00200.745020.0010
Template processing0.238987.028620.1195
Template load and register function0.00010.026610.0001
states
state_id_array0.00140.511410.0014
state_identifier_array0.00100.346420.0005
Override
Cache load0.00200.73831740.0000
Sytem overhead
Fetch class attribute name0.00170.601830.0006
Fetch class attribute can translate value0.00150.561310.0015
class_abstraction
Instantiating content class attribute0.00000.002430.0000
XML
Image XML parsing0.00020.078310.0002
General
dbfile0.00311.1116220.0001
String conversion0.00000.003630.0000
Note: percentages do not add up to 100% because some accumulators overlap

CSS/JS files loaded with "ezjscPacker" during request:

CacheTypePacklevelSourceFiles
CSS0extension/community/design/community/stylesheets/ext/jquery.autocomplete.css
extension/community_design/design/suncana/stylesheets/scrollbars.css
extension/community_design/design/suncana/stylesheets/tabs.css
extension/community_design/design/suncana/stylesheets/roadmap.css
extension/community_design/design/suncana/stylesheets/content.css
extension/community_design/design/suncana/stylesheets/star-rating.css
extension/community_design/design/suncana/stylesheets/syntax_and_custom_tags.css
extension/community_design/design/suncana/stylesheets/buttons.css
extension/community_design/design/suncana/stylesheets/tweetbox.css
extension/community_design/design/suncana/stylesheets/jquery.fancybox-1.3.4.css
extension/bcsmoothgallery/design/standard/stylesheets/magnific-popup.css
extension/sevenx/design/simple/stylesheets/star_rating.css
extension/sevenx/design/simple/stylesheets/libs/fontawesome/css/all.min.css
extension/sevenx/design/simple/stylesheets/main.v02.css
extension/sevenx/design/simple/stylesheets/main.v02.res.css
JS0extension/ezjscore/design/standard/lib/yui/3.17.2/build/yui/yui-min.js
extension/ezjscore/design/standard/javascript/jquery-3.7.0.min.js
extension/community_design/design/suncana/javascript/jquery.ui.core.min.js
extension/community_design/design/suncana/javascript/jquery.ui.widget.min.js
extension/community_design/design/suncana/javascript/jquery.easing.1.3.js
extension/community_design/design/suncana/javascript/jquery.ui.tabs.js
extension/community_design/design/suncana/javascript/jquery.hoverIntent.min.js
extension/community_design/design/suncana/javascript/jquery.popmenu.js
extension/community_design/design/suncana/javascript/jScrollPane.js
extension/community_design/design/suncana/javascript/jquery.mousewheel.js
extension/community_design/design/suncana/javascript/jquery.cycle.all.js
extension/sevenx/design/simple/javascript/jquery.scrollTo.js
extension/community_design/design/suncana/javascript/jquery.cookie.js
extension/community_design/design/suncana/javascript/ezstarrating_jquery.js
extension/community_design/design/suncana/javascript/jquery.initboxes.js
extension/community_design/design/suncana/javascript/app.js
extension/community_design/design/suncana/javascript/twitterwidget.js
extension/community_design/design/suncana/javascript/community.js
extension/community_design/design/suncana/javascript/roadmap.js
extension/community_design/design/suncana/javascript/ez.js
extension/community_design/design/suncana/javascript/ezshareevents.js
extension/sevenx/design/simple/javascript/main.js

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1node/view/full.tplblog_entry/full.tplextension/community_design/design/suncana/override/templates/blog_entry/full.tplEdit templateOverride template
2content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
9content/datatype/view/ezxmltags/strong.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/strong.tplEdit templateOverride template
23content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
6content/datatype/view/ezxmltags/link.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/link.tplEdit templateOverride template
13content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
8content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
1content/datatype/view/ezkeyword.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezkeyword.tplEdit templateOverride template
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/pagelayout.tplEdit templateOverride template
 Number of times templates used: 64
 Number of unique templates used: 9

Time used to render debug report: 0.0002 secs