Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
A project is born...
# If you use Zend Studio or Eclipse PDT create a new
# `PHP Project` named ZfBugs in your workspace
# workspace could easily be in /usr/local/zend/apache2/htdocs
# if you utilize Zend Server the location is up to you
cd ~/${Workspace}
zf create project ZendDb
# create the build structure, build.xml and build container
touch ZendDb/build.xml
# edit the build.xml
mkdir ZendDb/build
cd ZendDb/build
touch phpcs.xml phpunit.xml
<?xml version="1.0" encoding="UTF-8"?>
<project name="ZendDb" default="build" basedir=".">
<property name="source" value="." />
<target name="clean" description="Clean up and create report directories">
<!-- This will clear previous files and directories, then create
them for the next run -->
<delete dir="${basedir}/build/api" />
<delete dir="${basedir}/build/coverage" />
<delete dir="${basedir}/build/logs" />
<mkdir dir="${basedir}/build/api" />
<mkdir dir="${basedir}/build/coverage" />
<mkdir dir="${basedir}/build/logs" />
<touch file="${basedir}/build/logs/codeSniffer.txt" />
<target name="phpunit" description="Run PHPUnit">
<exec executable="phpunit" failonerror="true">
<arg line="-c ${basedir}/build/phpunit.xml" />
<target name="phpcs" description="Generate codeSniffer.txt using PHP_CodeSniffer">
<exec executable="phpcs">
${basedir}" />
<target name="phpdoc" description="Generate API documentation using PHPDocumentor">
<exec executable="phpdoc">
<arg line="-d ${source} -t ${basedir}/build/api" />
<target name="build" depends="clean,phpunit,phpcs,phpdoc" />
#edit the phpcs.xml<?xml version="1.0"?>
<ruleset name="Zend Standard">
<description>Zend Standard, exclude extraneous</description>
<rule ref="Zend" />
<phpunit bootstrap="../tests/bootstrap.php">
<testsuite name="ZendDb Test Suite">
<testsuite name="ZendDb Test Suite">
<log type="coverage-html" target="coverage" title="ZendDb"
charset="UTF-8" yui="true" highlight="true" lowUpperBound="35"
highLowerBound="70" />
<directory suffix=".php">library/</directory>
#discover all relevant channels
sudo pear channel-discover
sudo pear channel-discover
sudo pear channel-discover
sudo pear channel-discover
# install required/desired packages
sudo pear install PHPDocumentor
sudo pear install PHP_CodeSniffer
sudo pear install --alldeps phpunit/PHPUnit
sudo pear install --alldeps zfcampus/ZF
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.