Skip to content
Sebastian Bergmann edited this page Jan 30, 2014 · 7 revisions

phpCodeControl

phpCodeControl is a commit inspection tool which aims to provide insight into your development process and provide the means to easily inspect and find your commits.
Although this tool has extra support for PHP projects it does nonetheless work with any project.

The aim of this project is to support multiple SCM systems and is designed to make the best possible use of them.
Currently supported SCM systems are:

  • Subversion
  • Git

Please note: the software is currently in an alpha state and the signature for the SCM adapters is still in flux and might change.

Installation

phpCodeControl is completely build on top of the symfony framework and thus developers who are used to the framework will be able to use it without too much thought.

Note: to restrict the amount of space needed and prevent duplication symfony is not included in this package. It can be separately downloaded as described in step 2.

Dependency: phpCodeControl depends on the Text_Diff PEAR package to execute its comparisons. You can either download the package from the PEAR website or use the PEAR installer to download it.
Make sure that you have the package in you path and phpCodeControl will be able to find it.
Please be aware that the Text_Diff package generates quite a bit of E_NOTICE and E_STRICT messages as it is PHP4 compatible.

  1. Download the software and place it somewhere outside the web root
  2. Download symfony from http://svn.symfony-project.com/branches/1.4/ and put it in the /lib/vendor/symfony folder
  3. Create a database named phpCodeControl and a user with USAGE access (Select, Insert, Update, Delete); ex. GRANT USAGE ON phpCodeControl.* TO ’phpCodeControl’@’localhost’ IDENTIFIED BY “1nC0ntr0l”;
  4. Update the file config/databases.yml to point to your server and an administrative user
  5. From a command-line, change your working directory to the directory where you have installed phpCodeControl
  6. run the command ‘./symfony project:permissions’ to initialize the most important permissions in the folder
  7. run the command ‘./symfony doctrine:build-sql’ to create the SQL needed to populate the database
  8. run the command ‘./symfony doctrine:insert-sql’ to insert the SQL into your database
  9. run the command ‘./symfony doctrine:data-load’ to insert default values needed to operate the application
  10. Update the file config/databases.yml to use your new USAGE-only user
  11. Set up a vhost for this installation, an example can be found in the config directory

Once these steps are completed you will have a working installation!

Note: Currently the interface does not provide an option to add a project / scm location to phpCodeControl. Until this has been made you can add your path to the Scm table in your database manually.

Populating your database

In order to use phpCodeControl you will have to populate the database. This is done via the phpcc:update symfony task followed by the id of the SCM entry to update.
Thus, to update the data for the path #1 defined in the Scm table you should run:
./symfony phpcc:update 1
The first time this script might take a while (depending upon the size of the project) as it tries to load all historical information.

Ideally you would want to hook this script onto the ‘on commit’ handler of your SCM or as a CRON job, this way you can never forget to run the script and have the most actual information present at all times.

Clone this wiki locally