Skip to content
PHP Censor is an open source self-hosted continuous integration server for PHP projects.
PHP HTML JavaScript CSS
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.github Improved documentation. Jun 25, 2019
app Added ./app directory to Git. May 29, 2017
bin Removed 'console.bat' file. Sep 17, 2017
docs Code style cleanup. Jun 25, 2019
public Code style cleanup. Jun 25, 2019
runtime Small fix (runtime/builds dir). Mar 14, 2018
src Changed default value of global configuration param Sep 26, 2019
tests Changed default value of global configuration param Sep 26, 2019
.codecov.yml Improved Codecov config. Dec 23, 2018
.editorconfig Small fixes. Apr 6, 2018
.gitattributes Fixed configs. Apr 15, 2019
.gitignore Code style cleanup. Jun 25, 2019
.php-censor.yml Fixed configs. Apr 15, 2019
.php_cs.dist Code style fixes. Mar 11, 2019
.travis.yml Merge branch 'release-1.0' into release-1.1 Aug 7, 2019
CHANGELOG.md Added changelog for version 1.1.1, updated dependencies and upgrade Jun 15, 2019
LICENSE Fixes. Jul 14, 2018
README.md fix readme Sep 3, 2019
VERSION.md Added changelog for version 1.1.1, updated dependencies and upgrade Jun 15, 2019
bootstrap.php Small bootstrap.php cleanup. Mar 9, 2018
composer.json Code style cleanup. Jun 25, 2019
composer.lock Added changelog for version 1.0.11, updated dependencies and upgrade Jun 15, 2019
phpmd.xml.dist
phpunit.xml.dist Merge branch 'release-1.0' Apr 15, 2019

README.md

PHP Censor Travis CI Codecov Latest Version Total downloads License

PHP Censor

PHP Censor is an open source, self-hosted, continuous integration server for PHP projects (PHPCI fork). Official twitter @php_censor.

Actual PHP Censor versions and release branches:

Version Branch Status Minimal PHP Version
1.0 release-1.0 Last stable version 5.6
1.1 release-1.1 Current stable version 5.6
1.2 master Future stable minor version (WIP) 5.6
2.0 pre-release-2.0 Future stable major version (WIP) 7.1

Dashboard

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;

Features

  • 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, PHPMessDetector, PHPTalLint and TechnicalDebt;

  • 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 to Email, XMPP, Slack, IRC, Flowdock, HipChat and Telegram;

  • Use your LDAP-server for authentication;

Changelog

Versions changelog.

Roadmap

See milestones.

Installing

  • 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 an empty database for your application (MySQL/MariaDB or PostgreSQL);

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

# For Debian-based
aptitude install beanstalkd
  • 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-pgsql-sslmode=prefer \
    --db-name=php-censor \
    --db-user=php-censor \
    --db-password=php-censor \
    --db-port=default \ # Value 'default': 5432 for PostgreSQL and 3306 for MySQL
    --admin-name=admin \
    --admin-password=admin \
    --admin-email='admin@php-censor.local' \
    --queue-use=1 \
    --queue-host=localhost \
    --queue-port=11300 \
    --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 a Docker container, you can use php-censor/docker-php-censor project.

Updating

  • 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 the repository by Git (If you want the latest master branch):

    git checkout master
    git pull -r

    Or pull the 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, TechnicalDebt, PHPLoc, PHPCpd, PHPCodeSniffer, PHPMessDetector, 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 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:

setup:
  composer:
    action:    "install"
    directory: "."
test:
  php_unit:
    config: "phpunit.xml"
  php_mess_detector:
    allow_failures: true
  php_code_sniffer:
    standard: "PSR2"
  php_cpd:
    allow_failures: true
complete:
  email:
    default_mailto_address: admin@php-censor.local

More details about configuring project.

Migrations

Run to apply latest migrations:

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

Run to create a new migration:

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

Tests

cd /path/to/php-censor

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

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

For database tests create an empty 'test_db' 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[.dist] config constants). If connection failed the tests will be skipped.

Documentation

Full PHP Censor documentation.

License

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

You can’t perform that action at this time.