app | ||
bin | ||
docs | ||
public | ||
runtime | ||
src | ||
tests | ||
.gitignore | ||
.php-censor.yml | ||
.travis.yml | ||
bootstrap.php | ||
CHANGELOG.md | ||
composer.json | ||
composer.lock | ||
LICENSE.md | ||
phpunit.xml | ||
README.md |
PHP Censor
PHP Censor is a open source self-hosted continuous integration server for PHP projects (Fork of PHPCI).
More screenshots.
Features
-
Clone project from Github, Bitbucket, Gitlab, Git, Mercurial, SVN 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 and HipChat;
Configuring
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:
setup:
composer:
action: "install"
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.
Installing
You will need PHP 5.6+ (with OpenSSL support and enabled functions: exec()
, shell_exec()
and proc_open()
)
with web-server (Nginx or Apache2), DB (MySQL/MariaDB or PostgreSQL) database and Composer.
-
Go to the directory in which you want to install PHP Censor, for example:
/var/www
; -
Download PHP Censor from this repository and unzip it (to
/var/www/php-censor.local
for example); -
Go to the PHP Censor directory:
cd /var/www/php-censor.local
; -
Install dependencies using Composer:
composer install
; -
Create empty database for application;
-
Install Beanstalkd queue (
aptitude install beanstalkd
); -
Install PHP Censor itself:
./bin/console php-censor:install
; -
Add a virtual host to your web server, 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, or a cron-job to run PHP Censor builds;
More details about installation.
Updating
-
Go to your PHP Censor directory (to
/var/www/php-censor.local
for example); -
Pull the latest code. This would look like this:
git pull
; -
Update the PHP Censor database:
./bin/console php-censor-migrations:migrate
; -
Update the Composer dependencies:
composer install
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
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/root
.
Otherwise database tests will be skipped.
Documentation
Full PHP Censor documentation.
License
PHP Censor is open source software licensed under the BSD-2-Clause license.