Popularity
5.3
Growing
Activity
8.8
Declining
527
29
83

Description

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

Code Quality Rank: L4
Monthly Downloads: 2
Programming language: PHP
License: BSD 2-clause "Simplified" License

PHP Censor alternatives and similar libraries

Based on the "Continuous Integration" category

Do you think we are missing an alternative of PHP Censor or a related project?

Add another 'Continuous Integration' Library

README

PHP Censor Travis CI Codecov Latest Version Total downloads License

PHP Censor is a 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](docs/screenshots/dashboard.png)](docs/screenshots/dashboard.png)

More [screenshots](docs/en/screenshots.md).

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](docs/en/sources/github.md), [Bitbucket](docs/en/sources/bitbucket.md) (Git/Hg), [GitLab](docs/en/sources/gitlab.md), [Git](docs/en/sources/git.md), Hg (Mercurial), SVN (Subversion) or from local directory;

  • Set up and tear down database tests for [PostgreSQL](docs/en/plugins/pgsql.md), [MySQL](docs/en/plugins/mysql.md) or [SQLite](docs/en/plugins/sqlite.md);

  • Install [Composer](docs/en/plugins/composer.md) 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](docs/en/README.md#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;

Changelog

[Versions changelog](CHANGELOG.md).

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

  • Install Beanstalkd Queue (Optional, if you are going to use 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=null \
    --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'
  • [Add a virtual host to your web server](docs/en/virtual_host.md), pointing to the public directory within your new PHP Censor directory. You'll need to set up rewrite rules to point all non-existent requests to PHP Censor;

  • [Set up the PHP Censor Worker](docs/en/workers/worker.md);

Installing via Docker

If you want to install PHP Censor as 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 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, 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](docs/en/configuring_project.md).

Migrations

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

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 tests will be skipped.

For database tests create 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 tests will be skipped.

Documentation

[Full PHP Censor documentation](docs/en/README.md).

License

PHP Censor is open source software licensed under the [BSD-2-Clause license](LICENSE).


*Note that all licence references and agreements mentioned in the PHP Censor README section above are relevant to that project's source code only.