Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
app Added ./app directory to Git. May 29, 2017
bin Removed 'console.bat' file. Sep 17, 2017
docs Added global application config (config.yml) option Mar 7, 2018
public Refactored Http. Mar 9, 2018
runtime Small fix (runtime/builds dir). Mar 14, 2018
src Fixed typo in russian translation ('Переодичный' -> 'Периодичный'). Mar 19, 2018
tests Refactored Csrf form widget. + Added unit tests for Csrt. Mar 13, 2018
.codecov.yml Refactored project structure. Mar 9, 2018
.editorconfig Added .editorconfig file. See: Nov 11, 2017
.gitignore Small fix (runtime/builds dir). Mar 14, 2018
.php-censor.yml Added coverage option in .php-censor.yml config. Mar 6, 2018
.travis.yml Merged PostgreSQL and MySQL tests inti one PHPUnit XML config. Feb 28, 2018 Documentation improvements. Mar 7, 2018 Improved Mar 7, 2018 Code style fixes. Nov 11, 2017 Improved Mar 7, 2018 Small updates Jan 6, 2017 Code style fixes. Nov 11, 2017 Fixed 'Tests' section after tests refactoring. Mar 8, 2018 Updated application version to 0.21.0. Feb 21, 2018
bootstrap.php Small bootstrap.php cleanup. Mar 9, 2018
composer.json Refactored Csrf form widget. + Added unit tests for Csrt. Mar 13, 2018
composer.lock Refactored Csrf form widget. + Added unit tests for Csrt. Mar 13, 2018
phpmd.xml Added status and source build fields validation. Mar 12, 2018
phpunit.xml Refactored project structure. Mar 9, 2018

PHP Censor Travis CI SensioLabs Insight Codecov Latest Version Total downloads License

PHP Censor

PHP Censor is a open source self-hosted continuous integration server for PHP projects (PHPCI fork).

Twitter: @php_censor.


More screenshots.

System requirements

  • Unix-like OS (Windows isn't supported);

  • PHP 5.6+ (with OpenSSL support and enabled functions: exec(), shell_exec() and proc_open());

  • Web-server (Nginx or Apache2);

  • Database (MySQL/MariaDB or PostgreSQL);

  • Beanstalkd queue (Optional, needed if you use worker instead of cronjob);


  • Clone project from GitHub, Bitbucket (Git/Hg), GitLab, Git, Hg (Mercurial), SVN (Subversion) or from local directory;

  • Set up and tear down database tests for PostgreSQL, MySQL or SQLite;

  • Install Composer dependencies;

  • Run tests for PHPUnit, Atoum, Behat, Codeception and PHPSpec;

  • Check code via Lint, PHPParallelLint, Pdepend, PHPCodeSniffer, PHPCpd, PHPCsFixer, PHPDocblockChecker, PHPLoc, PHPMessDetect, PHPTalLint and TechnicalDept;

  • Run through any combination of the other supported plugins, including Campfire, CleanBuild, CopyBuild, Deployer, Env, Git, Grunt, Gulp, PackageBuild, Phar, Phing, Shell and Wipe;

  • Send notifications on Email, XMPP, Slack, IRC, Flowdock, HipChat and Telegram;

  • Use your LDAP-server for authentication;


  • Go to the directory in which you want to install PHP Censor, for example: /var/www:
cd /var/www
  • Create project by Composer:
composer create-project php-censor/php-censor php-censor.local --keep-vcs

Or download latest archive from GitHub, unzip it and run composer install.

  • Create empty database for application (MySQL/MariaDB or PostgreSQL);

  • Install Beanstalkd Queue (Optional, if you are going to use queue with Worker):

aptitude install beanstalkd # For deb-based
  • Install PHP Censor itself:
cd ./php-censor.local

# Interactive installation
./bin/console php-censor:install

# Non-interactive installation
./bin/console php-censor:install --url='http://php-censor.local' --db-type=pgsql --db-host=localhost --db-name=php-censor --db-user=php-censor --db-password=php-censor --db-port=null --admin-name=admin --admin-password=admin --admin-email='admin@php-censor.local' --queue-use=1 --queue-host=localhost --queue-name=php-censor

# Non-interactive installation with prepared config.yml file
./bin/console php-censor:install --config-from-file=yes --admin-name=admin --admin-password=admin --admin-email='admin@php-censor.local'

Installing via Docker

If you want to install PHP Censor as Docker container, you can use php-censor/docker-php-censor project.


  • Go to your PHP Censor directory (to /var/www/php-censor.local for example):

    cd /var/www/php-censor.local
  • Pull the latest code from repository by Git (If you want latest master branch):

    git checkout master
    git pull -r

    Or pull latest version:

    git fetch
    git checkout <version>
  • Update the Composer dependencies: composer install

  • Update the database scheme:

    ./bin/console php-censor-migrations:migrate
  • Restart Supervisord workers (If you use workers and Supervisord):

    sudo supervisorctl status
    sudo supervisorctl restart <worker:worker_00>
    sudo supervisorctl restart <worker:worker_nn>

    Or restart Systemd workers (If you use workers and Systemd):

    sudo systemctl restart <worker@1.service>
    sudo systemctl restart <worker@n.service>

Configuring project

There are several ways to set up the project:

  • Add project without any project config (Runs "zero-config" plugins, including: Composer, TechnicalDept, PHPLoc, PHPCpd, PHPCodeSniffer, PHPMessDetect, PHPDocblockChecker, PHPParallelLint, PHPUnit and Codeception);

  • Similar to Travis CI, to support PHP Censor in your project, you simply need to add a .php-censor.yml (phpci.yml/.phpci.yml for backward compatibility with PHPCI) file to the root of your repository;

  • Add project config in PHP Censor project page (And it will cancel file config from project repository);

The project config should look something like this:

    action: "install"
    config: "phpunit.xml"
    allow_failures: true
    standard: "PSR2"
    allow_failures: true
    default_mailto_address: admin@php-censor.local

More details about configuring project.


Run to apply latest migrations:

cd /path/to/php-censor
./bin/console php-censor-migrations:migrate

Run to create new migration:

cd /path/to/php-censor
./bin/console php-censor-migrations:create NewMigrationName


cd /path/to/php-censor

./vendor/bin/phpunit --configuration ./phpunit.xml --coverage-html ./tests/runtime/coverage -vvv --colors=always

For Phar plugin tests set 'phar.readonly' setting to Off (0) in php.ini config. Otherwise tests will be skipped.

For database B8Framework tests create empty 'b8_test' database on 'localhost' with user/password: root/<empty> for MySQL and with user/password: postgres/<empty> for PostgreSQL (You can change default test user, password and database name in phpunit.xml config constants). If connection failed tests will be skipped.


Full PHP Censor documentation.


PHP Censor is open source software licensed under the BSD-2-Clause license.