Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

initial commit

  • Loading branch information...
commit bd84e7501b75a06e2018d8730b3c72310ba22151 0 parents
Marcelo Gornstein authored
2  .gitignore
@@ -0,0 +1,2 @@
+build/*
+vendor/*
90 build.properties
@@ -0,0 +1,90 @@
+version=0.0.0
+name=App
+summary="Summary"
+author.name="Marcelo Gornstein"
+author.email="marcelog@gmail.com"
+author.username="marcelog"
+pear.channel="pear.marcelog.name"
+description="Description"
+dir.output=${project.basedir}/build
+dir.tmp=${dir.output}/tmp
+dir.src=${project.basedir}/src/mg/App
+dir.vendor=${project.basedir}/vendor
+dir.vendor.bin=${dir.vendor}/bin
+dir.vendor.php=${dir.vendor}/php
+phing=${php.exec} ${dir.vendor.php}/phing.php -Dversion=${version}
+;phing=${dir.vendor.bin}/phing
+package.output.dir=${dir.output}
+php.ini=${project.basedir}/resources/php.ini
+php.args=-c ${php.ini} -d include_path=${dir.vendor.php}:${dir.vendor.php}/log4php
+php.bin=/usr/php-5.3/bin/php
+php.exec=${php.bin} ${php.args}
+defaultpear.bin=/usr/php-5.3/bin/pear
+pear.cfg=${dir.vendor}/.pearrc
+defaultpear.exec=${defaultpear.bin} -c ${pear.cfg}
+pear.exec=${dir.vendor}/bin/pear -c ${pear.cfg}
+
+phpdepend.exec=${php.exec} ${dir.vendor.bin}/pdepend
+phpdepend.output=${dir.output}/php-depend
+phpdepend.output.html.dir=${phpdepend.output}/html
+phpdepend.output.html.file=${phpdepend.output.html.dir}/index.html
+phpdepend.output.xml.dir=${phpdepend.output}
+phpdepend.output.xml.file=${phpdepend.output.xml.dir}/php-depend.xml
+phpdepend.style=resources/pdepend.xsl
+phpdepend.args=--jdepend-xml=${phpdepend.output.xml.file} --jdepend-chart=${phpdepend.output.html.dir}/pdepend.svg --ignore=.git,test/ --overview-pyramid=${phpdepend.output.html.dir}/pyramid.svg ${dir.src}
+
+phpcs.exec=${php.exec} ${dir.vendor.bin}/phpcs
+phpcs.output=${dir.output}/php-cs
+phpcs.output.html.dir=${phpcs.output}/html
+phpcs.output.html.file=${phpcs.output.html.dir}/index.html
+phpcs.output.xml.dir=${phpcs.output}
+phpcs.output.xml.file=${phpcs.output.xml.dir}/php-cs.xml
+phpcs.style=resources/checkstyle.xsl
+phpcs.args=--report=checkstyle --report-file=${phpcs.output.xml.file} --standard=PEAR --extensions=php --ignore=.git/,doc/,resources/,build ${dir.src}
+
+junit.output.xml.dir=${phpunit.output}
+junit.output.xml.file=${junit.output.xml.dir}/junit.xml
+junit.style=resources/phpunit_to_surefire.xslt
+phpunit.exec=TMPDIR=${dir.output}/tmp TEST=true ${php.exec} ${dir.vendor.bin}/phpunit
+phpunit.output=${dir.output}/php-unit
+phpunit.output.html.dir=${phpunit.output}/html
+phpunit.output.xml.dir=${phpunit.output}
+phpunit.output.xml.file=${phpunit.output.xml.dir}/php-unit.xml
+phpunit.args=${php.args} --repeat 1 --stop-on-error --stop-on-failure --stop-on-incomplete --debug --verbose --process-isolation --bootstrap ./bootstrap.php --configuration phpunit.xml --log-junit ${phpunit.output.xml.file} --coverage-html ${phpunit.output.html.dir} --verbose
+
+phpmd.exec=${php.exec} ${dir.vendor.bin}/phpmd
+phpmd.output=${dir.output}/php-md
+phpmd.output.html.dir=${phpmd.output}/html
+phpmd.output.html.file=${phpmd.output.html.dir}/index.html
+phpmd.output.xml.dir=${phpmd.output}
+phpmd.output.xml.file=${phpmd.output.xml.dir}/php-md.xml
+phpmd.style=resources/pmd.xslt
+phpmd.args=${dir.src} xml rulesets/codesize.xml,rulesets/unusedcode.xml,rulesets/naming.xml --extensions php --reportfile ${phpmd.output.xml.file}
+
+phpcpd.exec=${php.exec} ${dir.vendor.bin}/phpcpd
+phpcpd.output=${dir.output}/php-cpd
+phpcpd.output.html.dir=${phpcpd.output}/html
+phpcpd.output.html.file=${phpcpd.output.html.dir}/index.html
+phpcpd.output.xml.dir=${phpcpd.output}
+phpcpd.output.xml.file=${phpcpd.output.xml.dir}/php-cpd.xml
+phpcpd.style=resources/cpd.xslt
+phpcpd.args=--log-pmd ${phpcpd.output.xml.file} --verbose ${dir.src}
+
+phpdoc.exec=${php.exec} ${dir.vendor.bin}/docblox
+phpdoc.output=${dir.output}/php-doc
+phpdoc.output.html.dir=${phpdoc.output}/html
+phpdoc.args=-d ${dir.src} -t ${phpdoc.output.html.dir} --sourcecode --visibility public,protected,private --parseprivate --title ${summary}
+
+phploc.exec=${php.exec} ${dir.vendor.bin}/phploc
+phploc.output=${dir.output}/php-loc
+phploc.output.html.dir=${phploc.output}/html
+phploc.output.html.file=${phploc.output.html.dir}/phploc.txt
+phploc.args=${dir.src}
+
+phar=${name}-${version}.phar
+genphar.exec=${php.exec} resources/generatePhar.php
+genphar.args=${package.output.dir}/${phar} ${dir.src}
+peartgz=${name}-${version}.tgz
+
+genpear.exec=${php.exec} resources/generatePackageXml.php ${name} ${summary} ${description} ${version} ${author.name} ${author.email} ${author.username} ${pear.channel}
+
252 build.xml
@@ -0,0 +1,252 @@
+<project name="CiPhp" default="all" basedir=".">
+ <property file="./build.properties"/>
+ <target name="prepare" depends="clean">
+ <mkdir dir="${dir.output}"/>
+ <mkdir dir="${dir.tmp}"/>
+ </target>
+
+ <target name="clean">
+ <delete dir="${dir.output}"/>
+ </target>
+
+ <target name="phpdepend">
+ <exec command="${phing} _phpdepend" passthru="true"/>
+ </target>
+ <target name="_phpdepend">
+ <mkdir dir="${phpdepend.output.xml.dir}"/>
+ <mkdir dir="${phpdepend.output.html.dir}"/>
+ <exec
+ command="${phpdepend.exec} ${phpdepend.args}"
+ dir="${project.basedir}"
+ passthru="true"
+ />
+ <xslt
+ file="${phpdepend.output.xml.file}"
+ tofile="${phpdepend.output.html.file}"
+ style="${phpdepend.style}"
+ />
+ </target>
+
+ <target name="phpcs">
+ <exec command="${phing} _phpcs" passthru="true"/>
+ </target>
+ <target name="_phpcs">
+ <mkdir dir="${phpcs.output.xml.dir}"/>
+ <mkdir dir="${phpcs.output.html.dir}"/>
+ <exec
+ command="${phpcs.exec} ${phpcs.args}"
+ dir="${project.basedir}"
+ passthru="true"
+ />
+ <xslt
+ file="${phpcs.output.xml.file}"
+ tofile="${phpcs.output.html.file}"
+ style="${phpcs.style}"
+ />
+ </target>
+
+ <target name="phpunit">
+ <exec command="${phing} _phpunit" passthru="true"/>
+ </target>
+ <target name="_phpunit">
+ <mkdir dir="${phpunit.output.xml.dir}"/>
+ <mkdir dir="${phpunit.output.html.dir}"/>
+ <exec
+ command="${phpunit.exec} ${phpunit.args}"
+ dir="${project.basedir}/test"
+ passthru="true"
+ />
+ <xslt
+ file="${phpunit.output.xml.file}"
+ tofile="${junit.output.xml.file}"
+ style="${junit.style}"
+ />
+ </target>
+
+ <target name="phpmd">
+ <exec command="${phing} _phpmd" passthru="true"/>
+ </target>
+ <target name="_phpmd">
+ <mkdir dir="${phpmd.output.xml.dir}"/>
+ <mkdir dir="${phpmd.output.html.dir}"/>
+ <exec
+ command="${phpmd.exec} ${phpmd.args}"
+ dir="${project.basedir}"
+ passthru="true"
+ />
+ <xslt
+ file="${phpmd.output.xml.file}"
+ tofile="${phpmd.output.html.file}"
+ style="${phpmd.style}"
+ />
+ </target>
+
+ <target name="phpcpd">
+ <exec command="${phing} _phpcpd" passthru="true"/>
+ </target>
+ <target name="_phpcpd">
+ <mkdir dir="${phpcpd.output.xml.dir}"/>
+ <mkdir dir="${phpcpd.output.html.dir}"/>
+ <exec
+ command="${phpcpd.exec} ${phpcpd.args}"
+ dir="${project.basedir}"
+ passthru="true"
+ />
+ <xslt
+ file="${phpcpd.output.xml.file}"
+ tofile="${phpcpd.output.html.file}"
+ style="${phpcpd.style}"
+ />
+ </target>
+
+ <target name="phpdoc">
+ <exec command="${phing} _phpdoc" passthru="true"/>
+ </target>
+ <target name="_phpdoc">
+ <mkdir dir="${phpdoc.output.html.dir}"/>
+ <exec
+ command="${phpdoc.exec} ${phpdoc.args}"
+ dir="${project.basedir}"
+ passthru="true"
+ />
+ </target>
+
+ <target name="phploc">
+ <exec command="${phing} _phploc" passthru="true"/>
+ </target>
+ <target name="_phploc">
+ <mkdir dir="${phploc.output.html.dir}"/>
+ <exec
+ command="${phploc.exec} ${phploc.args} > ${phploc.output.html.file}"
+ dir="${project.basedir}"
+ passthru="true"
+ />
+ </target>
+
+ <target name="package">
+ <exec command="${phing} _package" passthru="true"/>
+ </target>
+ <target name="_package">
+ <mkdir dir="${package.output.dir}"/>
+ <exec
+ command="${pear.exec} channel-discover ${pear.channel}"
+ dir="${project.basedir}" passthru="true"
+ />
+ <exec
+ command="${genphar.exec} ${genphar.args}"
+ dir="${project.basedir}"
+ passthru="true"
+ />
+ <exec
+ command="${genpear.exec}" dir="${project.basedir}" passthru="true"
+ output="${dir.output}/package.xml"
+ />
+ <copy file="${dir.output}/package.xml" tofile="${dir.src}/package.xml" />
+ <exec
+ command="${pear.exec} package" dir="${dir.src}" passthru="true"
+ />
+ <delete file="${dir.src}/package.xml" />
+ <move file="${dir.src}/${peartgz}" tofile="${dir.output}/${peartgz}" overwrite="true"/>
+ </target>
+
+ <target name="install-dependencies">
+ <mkdir dir="${dir.vendor}"/>
+ <exec
+ command="${defaultpear.bin} config-create ${dir.vendor} ${dir.vendor}/.pearrc"
+ passthru="true"
+ />
+ <exec
+ command="${defaultpear.exec} config-set php_bin ${php.bin}"
+ passthru="true"
+ />
+ <exec
+ command="${defaultpear.exec} config-set php_dir ${dir.vendor}/php"
+ passthru="true"
+ />
+ <exec
+ command="${defaultpear.exec} config-set bin_dir ${dir.vendor}/bin"
+ passthru="true"
+ />
+ <exec
+ command="${defaultpear.exec} config-set cache_dir ${dir.vendor}/cache"
+ passthru="true"
+ />
+ <exec
+ command="${defaultpear.exec} config-set cfg_dir ${dir.vendor}/cfg"
+ passthru="true"
+ />
+ <exec
+ command="${defaultpear.exec} config-set data_dir ${dir.vendor}/data"
+ passthru="true"
+ />
+ <exec
+ command="${defaultpear.exec} config-set download_dir ${dir.vendor}/download"
+ passthru="true"
+ />
+ <exec
+ command="${defaultpear.exec} config-set temp_dir ${dir.vendor}/tmp"
+ passthru="true"
+ />
+ <exec
+ command="${defaultpear.exec} config-set doc_dir ${dir.vendor}/doc"
+ passthru="true"
+ />
+ <exec
+ command="${defaultpear.exec} config-set test_dir ${dir.vendor}/test"
+ passthru="true"
+ />
+ <exec
+ command="${defaultpear.exec} config-set www_dir ${dir.vendor}/www"
+ passthru="true"
+ />
+ <exec
+ command="${defaultpear.exec} config-set auto_discover 1"
+ passthru="true"
+ />
+ <exec
+ command="${defaultpear.exec} install pear"
+ passthru="true"
+ />
+ <exec
+ command="${pear.exec} install --alldeps pear.phpunit.de/PHPUnit"
+ passthru="true"
+ />
+ <exec
+ command="${pear.exec} install --alldeps phpunit/phploc"
+ passthru="true"
+ />
+ <exec
+ command="${pear.exec} install --alldeps pear.docblox-project.org/DocBlox"
+ passthru="true"
+ />
+ <exec
+ command="${pear.exec} install --alldeps pear.pdepend.org/PHP_Depend-beta"
+ passthru="true"
+ />
+ <exec
+ command="${pear.exec} install --alldeps pear.phpmd.org/PHP_PMD"
+ passthru="true"
+ />
+ <exec
+ command="${pear.exec} install --alldeps pear.phpunit.de/phpcpd"
+ passthru="true"
+ />
+ <exec
+ command="${pear.exec} install --alldeps PHP_CodeSniffer"
+ passthru="true"
+ />
+ <exec
+ command="${pear.exec} install --alldeps pear.phing.info/phing"
+ passthru="true"
+ />
+ </target>
+
+ <target name="clean-dependencies">
+ <delete dir="${dir.vendor}"/>
+ </target>
+
+ <target name="all" depends="clean, prepare, package, report"/>
+ <target name="build" depends="prepare, test"/>
+ <target name="test" depends="prepare, phpunit"/>
+ <target name="report" depends="build, phploc, phpdoc, phpdepend, phpcs, phpmd, phpcpd"/>
+</project>
210 resources/checkstyle.xsl
@@ -0,0 +1,210 @@
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
+<xsl:output method="html" indent="yes"/>
+<xsl:decimal-format decimal-separator="." grouping-separator="," />
+
+<xsl:key name="files" match="file" use="@name" />
+
+<!-- Checkstyle XML Style Sheet by Rolf Wojtech <rolf@wojtech.de> -->
+<!-- (based on checkstyle-noframe-sorted.xsl by Stephane Bailliez -->
+<!-- <sbailliez@apache.org> and sf-patch 1721291 by Leo Liang) -->
+<!-- Changes: -->
+<!-- * Outputs seperate columns for error/warning/info -->
+<!-- * Sorts primarily by #error, secondarily by #warning, tertiary by #info -->
+<!-- * Compatible with windows path names (converts '\' to '/' for html anchor) -->
+<!-- -->
+<!-- Part of the Checkstyle distribution found at http://checkstyle.sourceforge.net -->
+<!-- Usage (generates checkstyle_report.html): -->
+<!-- <checkstyle failonviolation="false" config="${check.config}"> -->
+<!-- <fileset dir="${src.dir}" includes="**/*.java"/> -->
+<!-- <formatter type="xml" toFile="${doc.dir}/checkstyle_report.xml"/> -->
+<!-- </checkstyle> -->
+<!-- <style basedir="${doc.dir}" destdir="${doc.dir}" -->
+<!-- includes="checkstyle_report.xml" -->
+<!-- style="${doc.dir}/checkstyle-noframes-severity-sorted.xsl"/> -->
+
+<xsl:template match="checkstyle">
+ <html>
+ <head>
+ <style type="text/css">
+ .bannercell {
+ border: 0px;
+ padding: 0px;
+ }
+ body {
+ margin-left: 10;
+ margin-right: 10;
+ font:normal 80% arial,helvetica,sanserif;
+ background-color:#FFFFFF;
+ color:#000000;
+ }
+ .a td {
+ background: #efefef;
+ }
+ .b td {
+ background: #fff;
+ }
+ th, td {
+ text-align: left;
+ vertical-align: top;
+ }
+ th {
+ font-weight:bold;
+ background: #ccc;
+ color: black;
+ }
+ table, th, td {
+ font-size:100%;
+ border: none
+ }
+ table.log tr td, tr th {
+
+ }
+ h2 {
+ font-weight:bold;
+ font-size:140%;
+ margin-bottom: 5;
+ }
+ h3 {
+ font-size:100%;
+ font-weight:bold;
+ background: #525D76;
+ color: white;
+ text-decoration: none;
+ padding: 5px;
+ margin-right: 2px;
+ margin-left: 2px;
+ margin-bottom: 0;
+ }
+ </style>
+ </head>
+ <body>
+ <a name="top"></a>
+ <!-- jakarta logo -->
+ <table border="0" cellpadding="0" cellspacing="0" width="100%">
+ <tr>
+ <td class="bannercell" rowspan="2">
+ <!--a href="http://jakarta.apache.org/">
+ <img src="http://jakarta.apache.org/images/jakarta-logo.gif" alt="http://jakarta.apache.org" align="left" border="0"/>
+ </a-->
+ </td>
+ <td class="text-align:right"><h2>CheckStyle Audit</h2></td>
+ </tr>
+ <tr>
+ <td class="text-align:right">Designed for use with <a href='http://checkstyle.sourceforge.net/'>CheckStyle</a> and <a href='http://jakarta.apache.org'>Ant</a>.</td>
+ </tr>
+ </table>
+ <hr size="1"/>
+
+ <!-- Summary part -->
+ <xsl:apply-templates select="." mode="summary"/>
+ <hr size="1" width="100%" align="left"/>
+
+ <!-- Package List part -->
+ <xsl:apply-templates select="." mode="filelist"/>
+ <hr size="1" width="100%" align="left"/>
+
+ <!-- For each package create its part -->
+ <xsl:apply-templates select="file[@name and generate-id(.) = generate-id(key('files', @name))]" />
+
+ <hr size="1" width="100%" align="left"/>
+
+
+ </body>
+ </html>
+</xsl:template>
+
+
+
+ <xsl:template match="checkstyle" mode="filelist">
+ <h3>Files</h3>
+ <table class="log" border="0" cellpadding="5" cellspacing="2" width="100%">
+ <tr>
+ <th>Name</th>
+ <th>Errors</th>
+ <th>Warnings</th>
+ <th>Infos</th>
+ </tr>
+ <xsl:for-each select="file[@name and generate-id(.) = generate-id(key('files', @name))]">
+
+ <!-- Sort method 1: Primary by #error, secondary by #warning, tertiary by #info -->
+ <xsl:sort data-type="number" order="descending" select="count(key('files', @name)/error[@severity='error'])"/>
+ <xsl:sort data-type="number" order="descending" select="count(key('files', @name)/error[@severity='warning'])"/>
+ <xsl:sort data-type="number" order="descending" select="count(key('files', @name)/error[@severity='info'])"/>
+
+ <!-- Sort method 1: Sum(#error+#info+#warning) (uncomment to use, comment method 1) -->
+ <!--
+ <xsl:sort data-type="number" order="descending" select="count(key('files', @name)/error)"/>
+ -->
+
+ <xsl:variable name="errorCount" select="count(key('files', @name)/error[@severity='error'])"/>
+ <xsl:variable name="warningCount" select="count(key('files', @name)/error[@severity='warning'])"/>
+ <xsl:variable name="infoCount" select="count(key('files', @name)/error[@severity='info'])"/>
+
+ <tr>
+ <xsl:call-template name="alternated-row"/>
+ <td><a href="#f-{translate(@name,'\','/')}"><xsl:value-of select="@name"/></a></td>
+ <td><xsl:value-of select="$errorCount"/></td>
+ <td><xsl:value-of select="$warningCount"/></td>
+ <td><xsl:value-of select="$infoCount"/></td>
+ </tr>
+ </xsl:for-each>
+ </table>
+ </xsl:template>
+
+
+ <xsl:template match="file">
+ <a name="f-{translate(@name,'\','/')}"></a>
+ <h3>File <xsl:value-of select="@name"/></h3>
+
+ <table class="log" border="0" cellpadding="5" cellspacing="2" width="100%">
+ <tr>
+ <th>Severity</th>
+ <th>Error Description</th>
+ <th>Line</th>
+ </tr>
+ <xsl:for-each select="key('files', @name)/error">
+ <xsl:sort data-type="number" order="ascending" select="@line"/>
+ <tr>
+ <xsl:call-template name="alternated-row"/>
+ <td><xsl:value-of select="@severity"/></td>
+ <td><xsl:value-of select="@message"/></td>
+ <td><xsl:value-of select="@line"/></td>
+ </tr>
+ </xsl:for-each>
+ </table>
+ <a href="#top">Back to top</a>
+ </xsl:template>
+
+
+ <xsl:template match="checkstyle" mode="summary">
+ <h3>Summary</h3>
+ <xsl:variable name="fileCount" select="count(file[@name and generate-id(.) = generate-id(key('files', @name))])"/>
+ <xsl:variable name="errorCount" select="count(file/error[@severity='error'])"/>
+ <xsl:variable name="warningCount" select="count(file/error[@severity='warning'])"/>
+ <xsl:variable name="infoCount" select="count(file/error[@severity='info'])"/>
+ <table class="log" border="0" cellpadding="5" cellspacing="2" width="100%">
+ <tr>
+ <th>Files</th>
+ <th>Errors</th>
+ <th>Warnings</th>
+ <th>Infos</th>
+ </tr>
+ <tr>
+ <xsl:call-template name="alternated-row"/>
+ <td><xsl:value-of select="$fileCount"/></td>
+ <td><xsl:value-of select="$errorCount"/></td>
+ <td><xsl:value-of select="$warningCount"/></td>
+ <td><xsl:value-of select="$infoCount"/></td>
+ </tr>
+ </table>
+ </xsl:template>
+
+ <xsl:template name="alternated-row">
+ <xsl:attribute name="class">
+ <xsl:if test="position() mod 2 = 1">a</xsl:if>
+ <xsl:if test="position() mod 2 = 0">b</xsl:if>
+ </xsl:attribute>
+ </xsl:template>
+</xsl:stylesheet>
+
+
98 resources/cpd.xslt
@@ -0,0 +1,98 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- Stylesheet to turn the XML output of CPD into a nice-looking HTML page -->
+<!-- $Id$ -->
+<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+<xsl:output method="html" encoding="UTF-8" doctype-public="-//W3C//DTD HTML 4.01 Transitional//EN"
+ doctype-system="http://www.w3.org/TR/html4/loose.dtd" indent="yes"/>
+
+<xsl:template match="pmd-cpd">
+<html>
+ <head>
+ <script type="text/javascript">
+ function toggleCodeSection(btn, id)
+ {
+ area = document.getElementById(id);
+ if (area.style.display == 'none')
+ {
+ btn.innerHTML = '-';
+ area.style.display = 'inline';
+ }
+ else
+ {
+ btn.innerHTML = '+';
+ area.style.display = 'none';
+ }
+ }
+ </script>
+ <style>
+ .SummaryTitle { }
+ .SummaryNumber { background-color:#DDDDDD; text-align: center; }
+ .ItemNumber { background-color: #DDDDDD; }
+ .CodeFragment { background-color: #BBBBBB; display:none; font:normal normal normal 9pt Courier; }
+ .ExpandButton { background-color: #FFFFFF; font-size: 8pt; width: 20px; height: 20px; margin:0px; }
+ </style>
+ </head>
+<body>
+ <h2>Summary of duplicated code</h2>
+ This page summarizes the code fragments that have been found to be replicated in the code.
+ Only those fragments longer than 30 lines of code are shown.
+ <p/>
+ <table border="1" class="summary" cellpadding="2">
+ <tr style="background-color:#CCCCCC;">
+ <th># duplications</th>
+ <th>Total lines</th>
+ <th>Total tokens</th>
+ <th>Approx # bytes</th>
+ </tr>
+ <tr>
+ <td class="SummaryNumber"><xsl:value-of select="count(//duplication[@lines>30])"/></td>
+ <td class="SummaryNumber"><xsl:value-of select="sum(//duplication[@lines>30]/@lines)"/></td>
+ <td class="SummaryNumber"><xsl:value-of select="sum(//duplication[@lines>30]/@tokens)"/></td>
+ <td class="SummaryNumber"><xsl:value-of select="sum(//duplication[@lines>30]/@tokens) * 4"/></td>
+ </tr>
+ </table>
+ <p/>
+ You expand and collapse the code fragments using the + buttons. You can also navigate to the source code by clicking
+ on the file names.
+ <p/>
+ <table>
+ <tr style="background-color: #444444; color: #DDDDDD;"><td>ID</td><td>Files</td><td>Lines</td></tr>
+ <xsl:for-each select="//duplication[@lines>30]">
+ <xsl:sort data-type="number" order="descending" select="@lines"/>
+ <tr>
+ <td class="ItemNumber"><xsl:value-of select="position()"/></td>
+ <td>
+ <table>
+ <xsl:for-each select="file">
+ <tr><td><a><xsl:attribute name="href">../src/<xsl:value-of select="@path"/>.html#<xsl:value-of select="@line"/></xsl:attribute><xsl:value-of select="@path"/></a></td><td> line <xsl:value-of select="@line"/></td></tr>
+ </xsl:for-each>
+ </table>
+ </td>
+ <td># lines : <xsl:value-of select="@lines"/></td>
+ </tr>
+ <tr>
+ <td> </td>
+ <td colspan="2" valign="top">
+ <table><tr>
+ <td valign="top">
+ <button class="ExpandButton" ><xsl:attribute name="onclick">blur(); toggleCodeSection(this, 'frag_<xsl:value-of select="position()"/>')</xsl:attribute>+</button>
+ </td>
+ <td>
+ <textarea cols="100" rows="30" wrap="off" class='CodeFragment' style='display:none;'>
+ <xsl:attribute name="id">frag_<xsl:value-of select="position()"/></xsl:attribute>
+ <xsl:value-of select="codefragment"/>
+ </textarea>
+ </td>
+ </tr></table>
+ </td>
+ </tr>
+ <tr><td colspan="2"><hr/></td></tr>
+ </xsl:for-each>
+ </table>
+
+
+</body>
+</html>
+</xsl:template>
+
+</xsl:stylesheet>
83 resources/generatePackageXml.php
@@ -0,0 +1,83 @@
+<?php
+$name = $argv[1];
+$summary = $argv[2];
+$description = $argv[3];
+$version = $argv[4];
+$authorName = $argv[5];
+$authorEmail = $argv[6];
+$authorUsername = $argv[7];
+$pearChannel = $argv[8];
+$src = realpath(__DIR__ . "/../src/mg/$name");
+$installPath = "/$name";
+
+?>
+<?xml version="1.0" encoding="UTF-8"?>
+<package packagerversion="1.9.4" version="2.0" xmlns="http://pear.php.net/dtd/package-2.0" xmlns:tasks="http://pear.php.net/dtd/tasks-1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://pear.php.net/dtd/tasks-1.0 http://pear.php.net/dtd/tasks-1.0.xsd http://pear.php.net/dtd/package-2.0 http://pear.php.net/dtd/package-2.0.xsd">
+ <name><?php echo $name; ?></name>
+ <channel><?php echo $pearChannel; ?></channel>
+ <summary><?php echo $summary; ?></summary>
+ <description><?php echo $description; ?></description>
+ <lead>
+ <name><?php echo $authorName; ?></name>
+ <user><?php echo $authorUsername; ?></user>
+ <email><?php echo $authorEmail; ?></email>
+ <active>yes</active>
+ </lead>
+ <date><?php echo date('Y-m-d'); ?></date>
+ <time><?php echo date('H:m:i'); ?></time>
+ <version>
+ <release><?php echo $version; ?></release>
+ <api><?php echo $version; ?></api>
+ </version>
+ <stability>
+ <release>stable</release>
+ <api>stable</api>
+ </stability>
+ <license uri="http://www.apache.org/licenses/">Apache</license>
+ <notes>None</notes>
+ <contents>
+ <dir baseinstalldir="<?php echo $installPath; ?>" name="<?php echo $src; ?>/">
+<?php
+
+function dumpFileInfo($realPath, $pearPath) {
+ global $installPath;
+?>
+<file baseinstalldir="<?php echo $installPath; ?>" md5sum="<?php echo md5_file($realPath); ?>" name="<?php echo $pearPath; ?>" role="php" />
+<?php
+}
+
+function generateFileInfo($realPath, $pearPath) {
+ foreach (scandir($realPath) as $entry) {
+ if ($entry == '.' || $entry == '..') {
+ continue;
+ }
+ if (empty($pearPath)) {
+ $entryPearPath = $entry;
+ } else {
+ $entryPearPath = "$pearPath/$entry";
+ }
+ $entryRealPath = realpath("$realPath/$entry");
+ if (is_file($entryRealPath)) {
+ dumpFileInfo($entryRealPath, $entryPearPath);
+ } else {
+ generateFileInfo($entryRealPath, $entryPearPath);
+ }
+ }
+}
+generateFileInfo($src, '');
+?>
+ </dir>
+ </contents>
+ <dependencies>
+ <required>
+ <php>
+ <min>5.3.3</min>
+ </php>
+ <pearinstaller>
+ <min>1.4.0</min>
+ </pearinstaller>
+ </required>
+ </dependencies>
+ <phprelease />
+ <changelog/>
+</package>
10 resources/generatePhar.php
@@ -0,0 +1,10 @@
+ <?php
+$stub =
+'<?php
+require_once "phar://ciphp.phar/App/App.php";
+__HALT_COMPILER();
+?>';
+$phar = new Phar($argv[1]);
+$phar->setAlias('ciphp.phar');
+$phar->buildFromDirectory($argv[2]);
+$phar->setStub($stub);
276 resources/pdepend.xsl
@@ -0,0 +1,276 @@
+<?xml version="1.0"?>
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
+
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+<xsl:output method="html" indent="yes" encoding="US-ASCII"/>
+
+<xsl:template match="PDepend">
+ <html>
+ <head>
+ <title>PDepend Analysis</title>
+
+ <style type="text/css">
+ body {
+ font:normal 68% verdana,arial,helvetica;
+ color:#000000;
+ }
+ table tr td, tr th {
+ font-size: 68%;
+ }
+ table.details tr th{
+ font-weight: bold;
+ text-align:left;
+ background:#a6caf0;
+ }
+ table.details tr td{
+ background:#eeeee0;
+ }
+
+ p {
+ line-height:1.5em;
+ margin-top:0.5em; margin-bottom:1.0em;
+ margin-left:2em;
+ margin-right:2em;
+ }
+ h1 {
+ margin: 0px 0px 5px; font: 165% verdana,arial,helvetica
+ }
+ h2 {
+ margin-top: 1em; margin-bottom: 0.5em; font: bold 125% verdana,arial,helvetica
+ }
+ h3 {
+ margin-bottom: 0.5em; font: bold 115% verdana,arial,helvetica
+ }
+ h4 {
+ margin-bottom: 0.5em; font: bold 100% verdana,arial,helvetica
+ }
+ h5 {
+ margin-bottom: 0.5em; font: bold 100% verdana,arial,helvetica
+ }
+ h6 {
+ margin-bottom: 0.5em; font: bold 100% verdana,arial,helvetica
+ }
+ .Error {
+ font-weight:bold; color:red;
+ }
+ .Failure {
+ font-weight:bold; color:purple;
+ }
+ .Properties {
+ text-align:right;
+ }
+ </style>
+
+
+ </head>
+ <body>
+ <!--h1>JDepend Report</h1>
+ <ul>
+ <xsl:for-each select="./Packages/Package">
+ <xsl:sort select="@name"/>
+ <li><xsl:value-of select="@name"/></li>
+ </xsl:for-each>
+ </ul-->
+
+ <h1><a name="top">JDepend Analysis</a></h1>
+ <p align="right">Designed for use with <a href="http://www.clarkware.com/software/JDepend.html">JDepend</a> and <a href="http://jakarta.apache.org">Ant</a>.</p>
+ <hr size="2" />
+
+ <table width="100%"><tr><td>
+ <a name="NVsummary"><h2>Summary</h2></a>
+ </td><td align="right">
+ [<a href="#NVsummary">summary</a>]
+ [<a href="#NVpackages">packages</a>]
+ [<a href="#NVcycles">cycles</a>]
+ [<a href="#NVexplanations">explanations</a>]
+ </td></tr></table>
+
+ <table width="100%" class="details">
+ <tr>
+ <th>Package</th>
+ <th>Total Classes</th>
+ <th><a href="#EXnumber">Abstract Classes</a></th>
+ <th><a href="#EXnumber">Concrete Classes</a></th>
+ <th><a href="#EXafferent">Afferent Couplings</a></th>
+ <th><a href="#EXefferent">Efferent Couplings</a></th>
+ <th><a href="#EXabstractness">Abstractness</a></th>
+ <th><a href="#EXinstability">Instability</a></th>
+ <th><a href="#EXdistance">Distance</a></th>
+
+ </tr>
+ <xsl:for-each select="./Packages/Package">
+ <xsl:if test="count(error) = 0">
+ <tr>
+ <td align="left">
+ <a>
+ <xsl:attribute name="href">#PK<xsl:value-of select="@name"/>
+ </xsl:attribute>
+ <xsl:value-of select="@name"/>
+ </a>
+ </td>
+ <td align="right"><xsl:value-of select="Stats/TotalClasses"/></td>
+ <td align="right"><xsl:value-of select="Stats/AbstractClasses"/></td>
+ <td align="right"><xsl:value-of select="Stats/ConcreteClasses"/></td>
+ <td align="right"><xsl:value-of select="Stats/Ca"/></td>
+ <td align="right"><xsl:value-of select="Stats/Ce"/></td>
+ <td align="right"><xsl:value-of select="Stats/A"/></td>
+ <td align="right"><xsl:value-of select="Stats/I"/></td>
+ <td align="right"><xsl:value-of select="Stats/D"/></td>
+
+
+ </tr>
+ </xsl:if>
+ </xsl:for-each>
+ <xsl:for-each select="./Packages/Package">
+ <xsl:if test="count(error) &gt; 0">
+ <tr>
+ <td align="left">
+ <xsl:value-of select="@name"/>
+ </td>
+ <td align="left" colspan="8"><xsl:value-of select="error"/></td>
+ </tr>
+ </xsl:if>
+ </xsl:for-each>
+ </table>
+
+ <table width="100%"><tr><td>
+ <a name="NVpackages"><h2>Packages</h2></a>
+ </td><td align="right">
+ [<a href="#NVsummary">summary</a>]
+ [<a href="#NVpackages">packages</a>]
+ [<a href="#NVcycles">cycles</a>]
+ [<a href="#NVexplanations">explanations</a>]
+ </td></tr></table>
+
+ <xsl:for-each select="./Packages/Package">
+ <xsl:if test="count(error) = 0">
+ <h3><a><xsl:attribute name="name">PK<xsl:value-of select="@name"/></xsl:attribute>
+ <xsl:value-of select="@name"/></a></h3>
+
+ <table width="100%"><tr>
+ <td><a href="#EXafferent">Afferent Couplings</a>: <xsl:value-of select="Stats/Ca"/></td>
+ <td><a href="#EXefferent">Efferent Couplings</a>: <xsl:value-of select="Stats/Ce"/></td>
+ <td><a href="#EXabstractness">Abstractness</a>: <xsl:value-of select="Stats/A"/></td>
+ <td><a href="#EXinstability">Instability</a>: <xsl:value-of select="Stats/I"/></td>
+ <td><a href="#EXdistance">Distance</a>: <xsl:value-of select="Stats/D"/></td>
+ </tr></table>
+
+ <table width="100%" class="details">
+ <tr>
+ <th>Abstract Classes</th>
+ <th>Concrete Classes</th>
+ <th>Used by Packages</th>
+ <th>Uses Packages</th>
+ </tr>
+ <tr>
+ <td valign="top" width="25%">
+ <xsl:if test="count(AbstractClasses/Class)=0">
+ <i>None</i>
+ </xsl:if>
+ <xsl:for-each select="AbstractClasses/Class">
+ <xsl:value-of select="node()"/><br/>
+ </xsl:for-each>
+ </td>
+ <td valign="top" width="25%">
+ <xsl:if test="count(ConcreteClasses/Class)=0">
+ <i>None</i>
+ </xsl:if>
+ <xsl:for-each select="ConcreteClasses/Class">
+ <xsl:value-of select="node()"/><br/>
+ </xsl:for-each>
+ </td>
+ <td valign="top" width="25%">
+ <xsl:if test="count(UsedBy/Package)=0">
+ <i>None</i>
+ </xsl:if>
+ <xsl:for-each select="UsedBy/Package">
+ <a>
+ <xsl:attribute name="href">#PK<xsl:value-of select="node()"/></xsl:attribute>
+ <xsl:value-of select="node()"/>
+ </a><br/>
+ </xsl:for-each>
+ </td>
+ <td valign="top" width="25%">
+ <xsl:if test="count(DependsUpon/Package)=0">
+ <i>None</i>
+ </xsl:if>
+ <xsl:for-each select="DependsUpon/Package">
+ <a>
+ <xsl:attribute name="href">#PK<xsl:value-of select="node()"/></xsl:attribute>
+ <xsl:value-of select="node()"/>
+ </a><br/>
+ </xsl:for-each>
+ </td>
+ </tr>
+ </table>
+ </xsl:if>
+ </xsl:for-each>
+
+ <table width="100%"><tr><td>
+ <a name="NVcycles"><h2>Cycles</h2></a>
+ </td><td align="right">
+ [<a href="#NVsummary">summary</a>]
+ [<a href="#NVpackages">packages</a>]
+ [<a href="#NVcycles">cycles</a>]
+ [<a href="#NVexplanations">explanations</a>]
+ </td></tr></table>
+
+ <xsl:if test="count(Cycles/Package) = 0">
+ <p>There are no cyclic dependancies.</p>
+ </xsl:if>
+ <xsl:for-each select="Cycles/Package">
+ <h3><xsl:value-of select="@Name"/></h3><p>
+ <xsl:for-each select="Package">
+ <xsl:value-of select="."/><br/>
+ </xsl:for-each></p>
+ </xsl:for-each>
+
+ <table width="100%"><tr><td>
+ <a name="NVexplanations"><h2>Explanations</h2></a>
+ </td><td align="right">
+ [<a href="#NVsummary">summary</a>]
+ [<a href="#NVpackages">packages</a>]
+ [<a href="#NVcycles">cycles</a>]
+ [<a href="#NVexplanations">explanations</a>]
+ </td></tr></table>
+
+ <p>The following explanations are for quick reference and are lifted directly from the original <a href="http://www.clarkware.com/software/JDepend.html">JDepend documentation</a>.</p>
+
+ <h3><a name="EXnumber">Number of Classes</a></h3>
+ <p>The number of concrete and abstract classes (and interfaces) in the package is an indicator of the extensibility of the package.</p>
+ <h3><a name="EXafferent">Afferent Couplings</a></h3>
+ <p>The number of other packages that depend upon classes within the package is an indicator of the package's responsibility. </p>
+ <h3><a name="EXefferent">Efferent Couplings</a></h3>
+ <p>The number of other packages that the classes in the package depend upon is an indicator of the package's independence. </p>
+ <h3><a name="EXabstractness">Abstractness</a></h3>
+ <p>The ratio of the number of abstract classes (and interfaces) in the analyzed package to the total number of classes in the analyzed package. </p>
+ <p>The range for this metric is 0 to 1, with A=0 indicating a completely concrete package and A=1 indicating a completely abstract package. </p>
+ <h3><a name="EXinstability">Instability</a></h3>
+ <p>The ratio of efferent coupling (Ce) to total coupling (Ce / (Ce + Ca)). This metric is an indicator of the package's resilience to change. </p>
+ <p>The range for this metric is 0 to 1, with I=0 indicating a completely stable package and I=1 indicating a completely instable package. </p>
+ <h3><a name="EXdistance">Distance</a></h3>
+ <p>The perpendicular distance of a package from the idealized line A + I = 1. This metric is an indicator of the package's balance between abstractness and stability. </p>
+ <p>A package squarely on the main sequence is optimally balanced with respect to its abstractness and stability. Ideal packages are either completely abstract and stable (x=0, y=1) or completely concrete and instable (x=1, y=0). </p>
+ <p>The range for this metric is 0 to 1, with D=0 indicating a package that is coincident with the main sequence and D=1 indicating a package that is as far from the main sequence as possible. </p>
+
+ </body>
+ </html>
+</xsl:template>
+
+</xsl:stylesheet>
107 resources/php.ini
@@ -0,0 +1,107 @@
+[PHP]
+error_reporting = E_ALL
+display_errors = On
+display_startup_errors = On
+log_errors = On
+report_memleaks = On
+extension_dir = /usr/php-5.3/lib/php/extensions/no-debug-non-zts-20090626
+allow_url_fopen = On
+allow_url_include = On
+safe_mode = Off
+memory_limit = 1024M
+short_open_tag = Off
+
+[Date]
+date.timezone = America/Buenos_Aires
+
+extension=apc.so
+apc.enabled="1"
+apc.shm_segments="1"
+apc.shm_size="30M"
+apc.num_files_hint="1024"
+apc.ttl="7200"
+apc.user_ttl="7200"
+apc.gc_ttl="3600"
+apc.cache_by_default="1"
+;apc.filters=""
+;apc.mmap_file_mask="/tmp/apcphp5.XXXXXX"
+apc.slam_defense="0"
+apc.file_update_protection="2"
+apc.enable_cli="1"
+apc.max_file_size="1M"
+apc.stat="1"
+apc.write_lock="1"
+apc.report_autofilter="0"
+apc.include_once_override="0"
+apc.rfc1867="0"
+apc.rfc1867_prefix="upload_"
+apc.rfc1867_name="APC_UPLOAD_PROGRESS"
+apc.rfc1867_freq="0"
+apc.localcache="0"
+apc.localcache.size="512"
+apc.coredump_unmap="0"
+memcache.allow_failover=true
+memcache.max_failover_attempts=20
+memcache.chunk_size=32768
+memcache.default_port=11211
+memcache.hash_strategy=standard
+memcache.hash_function=crc32
+;extension = suhosin.so
+
+
+; -----------------------------------------------------------------------------
+; This file was taken from Mandriva Linux with their permission
+; -----------------------------------------------------------------------------
+
+[suhosin]
+suhosin.executor.include.whitelist="phar"
+suhosin.mail.protect = 1
+zend_extension=/usr/php-5.3/lib/php/extensions/no-debug-non-zts-20090626/xdebug.so
+xdebug.auto_trace="0"
+xdebug.trace_output_dir="/tmp/xdebug"
+xdebug.trace_output_name="trace.%c"
+xdebug.trace_format="0"
+xdebug.trace_options="0"
+xdebug.collect_includes="1"
+xdebug.collect_params="0"
+xdebug.collect_return="0"
+xdebug.collect_vars="0"
+xdebug.default_enable="1"
+xdebug.extended_info="1"
+xdebug.manual_url="http://www.php.net"
+xdebug.max_nesting_level="100"
+xdebug.show_exception_trace="0"
+xdebug.show_local_vars="0"
+xdebug.show_mem_delta="0"
+xdebug.dump.COOKIE="NULL"
+xdebug.dump.ENV="NULL"
+xdebug.dump.FILES="NULL"
+xdebug.dump.GET="NULL"
+xdebug.dump.POST="NULL"
+xdebug.dump.REQUEST="NULL"
+xdebug.dump.SERVER="NULL"
+xdebug.dump.SESSION="NULL"
+xdebug.dump_globals="1"
+xdebug.dump_once="1"
+xdebug.dump_undefined="0"
+xdebug.profiler_enable="0"
+xdebug.profiler_output_dir="/tmp/ding"
+xdebug.profiler_output_name="cachegrind.out.%t.%p"
+xdebug.profiler_enable_trigger="1"
+xdebug.profiler_append="0"
+xdebug.profiler_aggregate="0"
+xdebug.remote_enable="1"
+xdebug.remote_handler="dbgp"
+xdebug.remote_host="192.168.0.195"
+xdebug.remote_mode="req"
+xdebug.remote_port="9000"
+xdebug.remote_autostart=""
+xdebug.remote_log="/tmp/xdebug-remote.log"
+xdebug.idekey=""
+xdebug.var_display_max_data="512"
+xdebug.var_display_max_depth="2"
+xdebug.var_display_max_children="128"
+extension=timezonedb.so
+extension=memcached.so
+extension=yaml.so
+phar.readonly=false
10 resources/phpunit_to_surefire.xslt
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+<xsl:template match="/">
+ <xsl:element name="testsuites">
+ <xsl:for-each select="//testsuite[@file]">
+ <xsl:copy-of select="." />
+ </xsl:for-each>
+ </xsl:element>
+</xsl:template>
+</xsl:stylesheet>
99 resources/pmd.xslt
@@ -0,0 +1,99 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- $Header$ -->
+<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+<xsl:output method="html" encoding="UTF-8" doctype-public="-//W3C//DTD HTML 4.01 Transitional//EN"
+ doctype-system="http://www.w3.org/TR/html4/loose.dtd" indent="yes"/>
+
+<xsl:template name="message">
+<xsl:value-of disable-output-escaping="yes" select="."/>
+</xsl:template>
+
+<xsl:template name="priorityDiv">
+<xsl:if test="@priority = 1">p1</xsl:if>
+<xsl:if test="@priority = 2">p2</xsl:if>
+<xsl:if test="@priority = 3">p3</xsl:if>
+<xsl:if test="@priority = 4">p4</xsl:if>
+<xsl:if test="@priority = 5">p5</xsl:if>
+</xsl:template>
+
+<xsl:template name="timestamp">
+ <xsl:value-of select="substring-before(//pmd/@timestamp, 'T')"/> - <xsl:value-of select="substring-before(substring-after(//pmd/@timestamp, 'T'), '.')"/>
+</xsl:template>
+
+<xsl:template match="pmd">
+<html>
+<head>
+ <title>PMD <xsl:value-of select="//pmd/@version"/> Report</title>
+ <script type="text/javascript" src="sorttable.js"></script>
+ <style type="text/css">
+ body { margin-left: 2%; margin-right: 2%; font:normal verdana,arial,helvetica; color:#000000; }
+ table.sortable tr th { font-weight: bold; text-align:left; background:#a6caf0; }
+ table.sortable tr td { background:#eeeee0; }
+ table.classcount tr th { font-weight: bold; text-align:left; background:#a6caf0; }
+ table.classcount tr td { background:#eeeee0; }
+ table.summary tr th { font-weight: bold; text-align:left; background:#a6caf0; }
+ table.summary tr td { background:#eeeee0; text-align:center;}
+ .p1 { background:#FF9999; }
+ .p2 { background:#FFCC66; }
+ .p3 { background:#FFFF99; }
+ .p4 { background:#99FF99; }
+ .p5 { background:#9999FF; }
+ div.top{text-align:right;margin:1em 0;padding:0}
+ div.top div{display:inline;white-space:nowrap}
+ div.top div.left{float:left}
+ #content>div.top{display:table;width:100%}
+ #content>div.top div{display:table-cell}
+ #content>div.top div.left{float:none;text-align:left}
+ #content>div.top div.right{text-align:right}
+ </style>
+</head>
+<body>
+ <H1><div class="top"><div class="left">PMD <xsl:value-of select="//pmd/@version"/> Report</div><div class="right"><xsl:call-template name="timestamp"/></div></div></H1>
+ <hr/>
+ <h2>Summary</h2>
+ <table border="0" class="summary">
+ <tr>
+ <th>Files</th>
+ <th>Total</th>
+ <th>Priority 1</th>
+ <th>Priority 2</th>
+ <th>Priority 3</th>
+ <th>Priority 4</th>
+ <th>Priority 5</th>
+ </tr>
+ <tr>
+ <td><xsl:value-of select="count(//file)"/></td>
+ <td><xsl:value-of select="count(//violation)"/></td>
+ <td><div class="p1"><xsl:value-of select="count(//violation[@priority = 1])"/></div></td>
+ <td><div class="p2"><xsl:value-of select="count(//violation[@priority = 2])"/></div></td>
+ <td><div class="p3"><xsl:value-of select="count(//violation[@priority = 3])"/></div></td>
+ <td><div class="p4"><xsl:value-of select="count(//violation[@priority = 4])"/></div></td>
+ <td><div class="p5"><xsl:value-of select="count(//violation[@priority = 5])"/></div></td>
+ </tr>
+ </table>
+ <hr/>
+ <table border="0" width="100%" class="sortable" id="sortable_id">
+ <tr>
+ <th>Prio</th>
+ <th>File</th>
+ <th>Line</th>
+ <th align="left">Description</th>
+ </tr>
+ <xsl:for-each select="file">
+ <xsl:for-each select="violation">
+ <tr>
+ <td style="padding: 3px" align="right"><div><xsl:attribute name="class"><xsl:call-template name="priorityDiv"/></xsl:attribute><xsl:value-of disable-output-escaping="yes" select="@priority"/></div></td>
+ <td style="padding: 3px" align="left"><xsl:value-of disable-output-escaping="yes" select="translate(substring-before(../@name,'.java'),'/','.')"/></td>
+ <td style="padding: 3px" align="right"><xsl:value-of disable-output-escaping="yes" select="@beginline"/></td>
+ <td style="padding: 3px" align="left" width="100%"><xsl:if test="@externalInfoUrl"><a><xsl:attribute name="href"><xsl:value-of select="@externalInfoUrl"/></xsl:attribute><xsl:call-template name="message"/></a></xsl:if><xsl:if test="not(@externalInfoUrl)"><xsl:call-template name="message"/></xsl:if></td>
+ </tr>
+ </xsl:for-each>
+ </xsl:for-each>
+ </table>
+ <br/>
+ <p>Generated by <a href="http://pmd.sourceforge.net">PMD <b><xsl:value-of select="//pmd/@version"/></b></a> on <xsl:call-template name="timestamp"/>.</p>
+</body>
+</html>
+</xsl:template>
+
+</xsl:stylesheet>
33 src/mg/App/App.php
@@ -0,0 +1,33 @@
+<?php
+/**
+ * My Application sample
+ *
+ * @category SampleCiWithPhp
+ * @package App
+ * @author Marcelo Gornstein <marcelog@gmail.com>
+ * @license http://marcelog.github.com/ Apache License 2.0
+ * @link http://marcelog.github.com/
+ */
+namespace App;
+
+/**
+ * My Application sample
+ *
+ * @category SampleCiWithPhp
+ * @package App
+ * @author Marcelo Gornstein <marcelog@gmail.com>
+ * @license http://marcelog.github.com/ Apache License 2.0
+ * @link http://marcelog.github.com/
+ */
+class App
+{
+ /**
+ * This will run the application.
+ *
+ * @return integer
+ */
+ public function run()
+ {
+ return 42;
+ }
+}
15 test/App/AppTest.php
@@ -0,0 +1,15 @@
+<?php
+use App\App;
+
+class Test_App extends PHPUnit_Framework_TestCase
+{
+ /**
+ * @test
+ */
+ public function can_return_secret_of_the_universe()
+ {
+ $app = new App();
+ $this->assertEquals(42, $app->run());
+ }
+}
+
3  test/bootstrap.php
@@ -0,0 +1,3 @@
+<?php
+require_once __DIR__ . '/../src/mg/App/App.php';
+
19 test/phpunit.xml
@@ -0,0 +1,19 @@
+<phpunit
+ backupGlobals="false"
+ backupStaticAttributes="false"
+ syntaxCheck="false"
+ convertErrorsToExceptions="true"
+ convertNoticesToExceptions="true"
+ convertWarningsToExceptions="true"
+>
+ <filter>
+ <whitelist>
+ <directory suffix=".php">../src/mg/App</directory>
+ </whitelist>
+ </filter>
+ <testsuites>
+ <testsuite name="App">
+ <directory suffix=".php">App</directory>
+ </testsuite>
+ </testsuites>
+</phpunit>
Please sign in to comment.
Something went wrong with that request. Please try again.