2017-06-20 14:38:21 +02:00
|
|
|
[![PHP Censor](http://ci.php-censor.info/build-status/image/2?branch=master&label=PHPCensor&style=flat-square)](http://ci.php-censor.info/build-status/view/2?branch=master)
|
2017-08-26 07:13:34 +02:00
|
|
|
[![Travis CI](https://img.shields.io/travis/php-censor/php-censor/master.svg?label=TravisCI&style=flat-square)](https://travis-ci.org/php-censor/php-censor?branch=master)
|
|
|
|
[![Latest Version](https://img.shields.io/packagist/v/php-censor/php-censor.svg?label=Version&style=flat-square)](https://packagist.org/packages/php-censor/php-censor)
|
|
|
|
[![Total downloads](https://img.shields.io/packagist/dt/php-censor/php-censor.svg?label=Downloads&style=flat-square)](https://packagist.org/packages/php-censor/php-censor)
|
|
|
|
[![License](https://img.shields.io/packagist/l/php-censor/php-censor.svg?label=License&style=flat-square)](https://packagist.org/packages/php-censor/php-censor)
|
2017-01-09 14:14:04 +01:00
|
|
|
[![SensioLabs Insight](https://img.shields.io/sensiolabs/i/26f28bee-a861-45b2-bc18-ed2ac7defd22.svg?label=Insight&style=flat-square)](https://insight.sensiolabs.com/projects/26f28bee-a861-45b2-bc18-ed2ac7defd22)
|
|
|
|
|
2017-08-19 06:01:55 +02:00
|
|
|
<p align="center">
|
|
|
|
<img width="500" height="auto" src="docs/images/php-censor-black.png" alt="PHP Censor" />
|
|
|
|
</p>
|
2013-05-10 15:59:22 +02:00
|
|
|
|
2017-08-19 06:01:55 +02:00
|
|
|
**PHP Censor** is a open source self-hosted continuous integration server for PHP projects
|
|
|
|
([PHPCI](https://www.phptesting.org) fork).
|
2013-05-10 15:59:22 +02:00
|
|
|
|
2017-01-25 17:11:08 +01:00
|
|
|
[![Dashboard](docs/screenshots/dashboard.png)](docs/screenshots/dashboard.png)
|
2013-05-17 17:39:44 +02:00
|
|
|
|
2017-01-25 17:11:08 +01:00
|
|
|
More [screenshots](docs/en/screenshots.md).
|
2013-05-10 15:59:22 +02:00
|
|
|
|
2017-02-12 04:03:12 +01:00
|
|
|
* [System requirements](#system-requirements)
|
|
|
|
* [Features](#features)
|
|
|
|
* [Installing](#installing)
|
|
|
|
* [Installing via Docker](#installing-via-docker)
|
|
|
|
* [Updating](#updating)
|
|
|
|
* [Configuring project](#configuring-project)
|
|
|
|
* [Migrations](#migrations)
|
|
|
|
* [Tests](#tests)
|
|
|
|
* [Documentation](#documentation)
|
|
|
|
* [License](#license)
|
|
|
|
|
2017-02-01 16:27:47 +01:00
|
|
|
System requirements
|
|
|
|
-------------------
|
|
|
|
|
2017-02-20 14:57:47 +01:00
|
|
|
* Unix-like OS (**Windows isn't supported**);
|
2017-02-01 16:27:47 +01:00
|
|
|
|
2017-02-20 14:57:47 +01:00
|
|
|
* PHP 5.6+ (with OpenSSL support and enabled functions: `exec()`, `shell_exec()` and `proc_open()`);
|
2017-02-01 16:27:47 +01:00
|
|
|
|
2017-02-20 14:57:47 +01:00
|
|
|
* Web-server (Nginx or Apache2);
|
2017-02-01 16:27:47 +01:00
|
|
|
|
2017-02-20 14:57:47 +01:00
|
|
|
* Database (MySQL/MariaDB or PostgreSQL);
|
2017-02-01 16:27:47 +01:00
|
|
|
|
2017-02-20 14:57:47 +01:00
|
|
|
* Beanstalkd queue (Optional);
|
2017-02-01 16:27:47 +01:00
|
|
|
|
2017-01-25 17:11:08 +01:00
|
|
|
Features
|
|
|
|
--------
|
2016-07-19 13:05:02 +02:00
|
|
|
|
2017-01-25 17:11:08 +01:00
|
|
|
* Clone project from Github, Bitbucket, Gitlab, Git, Mercurial, SVN or from local directory;
|
2013-05-10 15:59:22 +02:00
|
|
|
|
2017-06-27 22:34:13 +02:00
|
|
|
* 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);
|
2017-01-04 10:23:06 +01:00
|
|
|
|
2017-06-27 22:34:13 +02:00
|
|
|
* Install [Composer](docs/en/plugins/composer.md) dependencies;
|
2017-01-04 10:23:06 +01:00
|
|
|
|
2017-01-25 17:11:08 +01:00
|
|
|
* Run tests for PHPUnit, Atoum, Behat, Codeception and PHPSpec;
|
|
|
|
|
|
|
|
* Check code via Lint, PHPParallelLint, Pdepend, PHPCodeSniffer, PHPCpd, PHPCsFixer, PHPDocblockChecker, PHPLoc,
|
|
|
|
PHPMessDetect, PHPTalLint and TechnicalDept;
|
|
|
|
|
2017-08-16 22:10:36 +02:00
|
|
|
* Run through any combination of the other [supported plugins](docs/en/README.md#plugins), including Campfire, CleanBuild,
|
2017-01-25 17:11:08 +01:00
|
|
|
CopyBuild, Deployer, Env, Git, Grunt, Gulp, PackageBuild, Phar, Phing, Shell and Wipe;
|
|
|
|
|
2017-02-20 14:57:47 +01:00
|
|
|
* Send notifications on Email, XMPP, Slack, IRC, Flowdock, HipChat and [Telegram](https://github.com/LEXASOFT/PHP-Censor-Telegram-Plugin);
|
|
|
|
|
|
|
|
* Use your LDAP-server for authentication;
|
2017-01-04 14:36:54 +01:00
|
|
|
|
|
|
|
Installing
|
|
|
|
----------
|
|
|
|
|
2017-02-05 11:18:08 +01:00
|
|
|
* Go to the directory in which you want to install PHP Censor, for example: `/var/www`:
|
2017-01-04 14:36:54 +01:00
|
|
|
|
2017-02-05 10:22:59 +01:00
|
|
|
```bash
|
|
|
|
cd /var/www
|
|
|
|
```
|
2017-01-04 14:36:54 +01:00
|
|
|
|
2017-02-05 11:18:08 +01:00
|
|
|
* Create project by Composer:
|
2017-01-04 14:36:54 +01:00
|
|
|
|
2017-02-05 10:22:59 +01:00
|
|
|
```bash
|
2017-08-26 07:13:34 +02:00
|
|
|
composer create-project php-censor/php-censor php-censor.local --keep-vcs
|
2017-02-05 10:22:59 +01:00
|
|
|
```
|
2017-01-04 14:36:54 +01:00
|
|
|
|
2017-08-26 07:13:34 +02:00
|
|
|
Or download [latest archive](https://github.com/php-censor/php-censor/releases/latest) from Github, unzip it and run
|
2017-02-05 10:22:59 +01:00
|
|
|
`composer install`.
|
2017-01-04 14:36:54 +01:00
|
|
|
|
2017-02-05 11:18:08 +01:00
|
|
|
* Create empty database for application (Mysql/MariaDB or Postgres);
|
2017-01-04 14:36:54 +01:00
|
|
|
|
2017-02-05 11:18:08 +01:00
|
|
|
* Install Beanstalkd Queue (Optional, if you are going to use queue with Worker):
|
2017-01-04 14:36:54 +01:00
|
|
|
|
2017-02-05 10:22:59 +01:00
|
|
|
```bash
|
|
|
|
aptitude install beanstalkd # For deb-based
|
|
|
|
```
|
2017-01-04 14:36:54 +01:00
|
|
|
|
2017-02-05 11:18:08 +01:00
|
|
|
* Install PHP Censor itself:
|
2017-01-04 14:36:54 +01:00
|
|
|
|
2017-02-05 10:22:59 +01:00
|
|
|
```bash
|
|
|
|
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'
|
|
|
|
```
|
|
|
|
|
2017-02-05 11:18:08 +01:00
|
|
|
* [Add a virtual host to your web server](docs/en/virtual_host.md), pointing to the `public` directory within your new
|
2017-02-05 10:22:59 +01:00
|
|
|
PHP Censor directory. You'll need to set up rewrite rules to point all non-existent requests to PHP Censor;
|
|
|
|
|
2017-02-05 11:18:08 +01:00
|
|
|
* [Set up the PHP Censor Worker](docs/en/workers/worker.md) (Need configured Queue) or
|
2017-02-05 10:22:59 +01:00
|
|
|
[a cron-job](docs/en/workers/cron.md) to run PHP Censor builds;
|
2017-01-04 14:36:54 +01:00
|
|
|
|
2017-02-12 04:03:12 +01:00
|
|
|
Installing via Docker
|
|
|
|
--------------------
|
|
|
|
|
|
|
|
If you want to install PHP Censor as Docker container, you can use
|
2017-08-26 07:13:34 +02:00
|
|
|
[php-censor/docker-php-censor](https://github.com/php-censor/docker-php-censor) project.
|
2017-02-12 04:03:12 +01:00
|
|
|
|
2017-01-04 14:36:54 +01:00
|
|
|
Updating
|
|
|
|
--------
|
|
|
|
|
2017-02-05 11:18:08 +01:00
|
|
|
* Go to your PHP Censor directory (to `/var/www/php-censor.local` for example):
|
2017-02-05 10:22:59 +01:00
|
|
|
|
|
|
|
```bash
|
|
|
|
cd /var/www/php-censor.local
|
|
|
|
```
|
|
|
|
|
2017-02-05 11:18:08 +01:00
|
|
|
* Pull the latest code by Git:
|
2017-01-04 10:23:06 +01:00
|
|
|
|
2017-02-05 10:22:59 +01:00
|
|
|
```bash
|
|
|
|
git pull -r
|
|
|
|
```
|
|
|
|
|
2017-02-05 11:18:08 +01:00
|
|
|
* Update the Composer dependencies: `composer install`
|
2017-01-04 10:23:06 +01:00
|
|
|
|
2017-02-05 11:18:08 +01:00
|
|
|
* Update the PHP Censor database scheme:
|
2017-01-04 10:23:06 +01:00
|
|
|
|
2017-02-05 10:22:59 +01:00
|
|
|
```bash
|
|
|
|
./bin/console php-censor-migrations:migrate
|
|
|
|
```
|
2016-08-11 16:32:42 +02:00
|
|
|
|
2017-02-12 04:03:12 +01:00
|
|
|
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](https://travis-ci.org), 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:
|
|
|
|
|
|
|
|
```yml
|
|
|
|
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](docs/en/configuring_project.md).
|
|
|
|
|
2017-01-03 19:22:58 +01:00
|
|
|
Migrations
|
2017-01-04 13:22:20 +01:00
|
|
|
----------
|
2017-01-03 19:22:58 +01:00
|
|
|
|
|
|
|
Run to apply latest migrations:
|
|
|
|
|
|
|
|
```bash
|
|
|
|
cd /path/to/php-censor
|
|
|
|
./bin/console php-censor-migrations:migrate
|
|
|
|
```
|
|
|
|
|
|
|
|
Run to create new migration:
|
|
|
|
|
|
|
|
```bash
|
|
|
|
cd /path/to/php-censor
|
|
|
|
./bin/console php-censor-migrations:create NewMigrationName
|
|
|
|
```
|
|
|
|
|
2017-01-25 17:11:08 +01:00
|
|
|
Tests
|
|
|
|
-----
|
|
|
|
|
|
|
|
```bash
|
|
|
|
cd /path/to/php-censor
|
2017-02-18 04:31:33 +01:00
|
|
|
|
|
|
|
# For testing on MySQL DB
|
|
|
|
./vendor/bin/phpunit --configuration ./phpunit.mysql.xml
|
|
|
|
|
|
|
|
# For testing on PostgreSQL
|
|
|
|
./vendor/bin/phpunit --configuration ./phpunit.pgsql.xml
|
2017-01-25 17:11:08 +01:00
|
|
|
```
|
|
|
|
|
2017-02-18 04:31:33 +01:00
|
|
|
For Phar plugin tests set 'phar.readonly' setting to Off (0) in `php.ini` config. Otherwise tests will be skipped.
|
2017-01-25 17:11:08 +01:00
|
|
|
|
2017-02-18 04:31:33 +01:00
|
|
|
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.mysql|pgsql.xml` config). If connection failed tests will be skipped.
|
2017-01-25 17:11:08 +01:00
|
|
|
|
2017-01-03 19:22:58 +01:00
|
|
|
Documentation
|
2017-01-04 13:22:20 +01:00
|
|
|
-------------
|
2017-01-03 19:22:58 +01:00
|
|
|
|
2017-01-04 14:36:54 +01:00
|
|
|
[Full PHP Censor documentation](docs/en/README.md).
|
2017-01-03 19:22:58 +01:00
|
|
|
|
2016-07-19 13:05:02 +02:00
|
|
|
License
|
2017-01-04 13:22:20 +01:00
|
|
|
-------
|
2013-05-10 15:59:22 +02:00
|
|
|
|
2017-01-05 11:36:13 +01:00
|
|
|
PHP Censor is open source software licensed under the [BSD-2-Clause license](LICENSE.md).
|