php-censor/README.md

135 lines
4.5 KiB
Markdown
Raw Normal View History

2017-01-09 14:14:04 +01:00
[![PHPCensor](http://phpci.corpsee.com/build-status/image/9?branch=master&label=PHPCensor&style=flat-square)](http://phpci.corpsee.com/build-status/view/9?branch=master)
[![TravisCI](https://img.shields.io/travis/corpsee/php-censor/master.svg?label=TravisCI&style=flat-square)](https://travis-ci.org/corpsee/php-censor?branch=master)
[![Latest Version](https://img.shields.io/packagist/v/corpsee/php-censor.svg?label=Version&style=flat-square)](https://packagist.org/packages/corpsee/php-censor)
[![Total downloads](https://img.shields.io/packagist/dt/corpsee/php-censor.svg?label=Downloads&style=flat-square)](https://packagist.org/packages/corpsee/php-censor)
[![License](https://img.shields.io/packagist/l/corpsee/php-censor.svg?label=License&style=flat-square)](https://packagist.org/packages/corpsee/php-censor)
[![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)
2016-07-19 13:05:02 +02:00
PHP Censor
2017-01-04 13:22:20 +01:00
==========
2017-01-04 14:36:54 +01:00
**PHP Censor** is a fork of [PHPCI](https://www.phptesting.org)
(And [B8Framework](https://github.com/Block8/b8framework)) and is a open source
([BSD-2-Clause license](LICENSE.md)) continuous integration tool specifically designed for PHP.
2016-07-19 13:05:02 +02:00
What it does
2017-01-04 13:22:20 +01:00
------------
2017-01-04 14:36:54 +01:00
* Clones your project from Github, Bitbucket, Gitlab or Git;
2017-01-04 14:36:54 +01:00
* Allows you to set up and tear down test databases;
2016-07-19 13:05:02 +02:00
2017-01-04 14:36:54 +01:00
* Installs your project's Composer dependencies;
2017-01-04 14:36:54 +01:00
* Runs through any combination of the [supported plugins](docs/en/README.md));
2017-01-04 10:23:06 +01:00
[![Dashboard](docs/screenshots/dashboard.png)](docs/screenshots/dashboard.png)
2017-01-04 14:36:54 +01:00
More [screenshots](docs/en/screenshots.md).
Configuring
-----------
2017-01-05 11:36:13 +01:00
Similar to [TravisCI](https://travis-ci.org), to support PHP Censor in your project, you simply need to add a `.php-censor.yml`
2017-01-04 14:36:54 +01:00
(`phpci.yml`/`.phpci.yml` for backward compatibility with PHPCI) file to the root of your repository. The file 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/config.md).
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), MySQL (or MariaDB) 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 MySQL 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](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), or [a cron-job](docs/en/workers/cron.md) to run PHP
Censor builds;
2017-01-04 14:36:54 +01:00
More details about [installation](docs/en/installing.md).
Updating
--------
* Go to your PHP Censor directory (to `/var/www/php-censor.local` for example);
2017-01-04 10:23:06 +01:00
2017-01-04 14:36:54 +01:00
* Pull the latest code. This would look like this: `git pull`;
2017-01-04 10:23:06 +01:00
2017-01-04 14:36:54 +01:00
* Update the PHP Censor database: `./bin/console php-censor-migrations:migrate`;
2017-01-04 10:23:06 +01:00
2017-01-04 14:36:54 +01:00
* Update the Composer dependencies: `composer update`
2017-01-04 10:23:06 +01:00
Tests
2017-01-04 13:22:20 +01:00
-----
```bash
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.
2017-01-04 14:36:54 +01:00
For database B8Framework tests create empty 'b8_test' MySQL database on 'localhost' with user/password: `root/root`.
Otherwise database tests will be skipped.
Migrations
2017-01-04 13:22:20 +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
```
Documentation
2017-01-04 13:22:20 +01:00
-------------
2017-01-04 14:36:54 +01:00
[Full PHP Censor documentation](docs/en/README.md).
2016-07-19 13:05:02 +02:00
License
2017-01-04 13:22:20 +01:00
-------
2017-01-05 11:36:13 +01:00
PHP Censor is open source software licensed under the [BSD-2-Clause license](LICENSE.md).