How to Configure phpUnderControl

http://docs.google.com/present/view?id=dfc724c8_4cmdtpqhs
Configuring phpUnderControl

This an overview of configuring phpUnderControl. This includes adding projects using phpUnderControl's command line, enabling PHP Mess Detector, enabling Artifacts, and adding new tab on phpUnderControl's menu.


Install Cruisecontrol

Requirements:

- Java
- Ant (CC ships with its own copy of Ant)

Install phpUnderControl

Requirements:

- PHP

Add Projects Using phpUnderControl Command Line

By default, if you use phpUnderControl command line, you will be required for version control. While some programs listed under Optional Requirements, can be ignored by specifying some options.

e.g. --without-code-sniffer will disable PHP_CodeSniffer support.

Requirements

- version control

Optional Requirements

- php code browser
- php code sniffer
- ezComponents Graph library
- php documentor
- phpunit
- php mess detector

Command

./phpuc.php project --project-name test --without-code-browser --coding-guideline Zend --version-control svn --version-control-url https://REPOURL/ --username USER--password 'PASSWORD' --source-dir application --test-dir tests /opt/cruisecontrol

Enable PHPUnit PMD Tab on phpUnderControl

PHP Mess Detector is not included on phpUnderControl's project command so we need to add it manually on our build.xml

<target name="phpmd">
 <exec executable="phpmd" dir="${basedir}/source" logerror="on">
  <arg line="${basedir}/source/application/ xml codesize,unusedcode,naming
   --ignore *.phtml,*/views/scripts/*
   --reportfile ${basedir}/build/logs/phpmd.xml" />
 </exec>
</target>

Enable phpUnderControl Artifacts

If you add project using phpUnderControl's command line, its artifactspublisher points to logs instead of artifacts folder.

Steps on how to enable phpUnderControl artifacts

- Create /PATH_TO_CRUISECONTROL/artifacts/PROJECT_NAME
- Replace all instance of dest="logs/${project.name}" with dest="artifacts/${project.name}" on your config.xml

Add New Tab on phpUnderControl's Menu

phpUnderControl tab menus can be found in /PATH_TO_CRUISECONTROL/webapps/cruisecontrol/main.jsp.

Steps on how to add new tab on phpUnderControl's menu

- Create /PATH_TO_CRUISECONTROL/projects/PROJECT_NAME/build/xdebug
- Modify /PATH_TO_CRUISECONTROL/config.xml and add these line of codes under <publishers>

<artifactspublisher dir="projects/${project.name}/build/xdebug" dest="artifacts/${project.name}" subdirectory="xdebug"/>

- Modify /PATH_TO_CRUISECONTROL/webapps/cruisecontrol/main.jsp and add these line of codes:

<cruisecontrol:tab name="xdebug" label="Xdebug">
  <cruisecontrol:artifactsLink>
   <iframe src="<%=request.getContextPath() %>/<%= artifacts_url %>/xdebug" class="tab-content">
   </iframe>
  </cruisecontrol:artifactsLink>
 </cruisecontrol:tab>

No comments: