erp-mgroen / php-censor
PHP Censor is a open source self-hosted continuous integration server for PHP projects (PHPCI fork).
Requires
- php: >=5.6.0
- ext-curl: *
- ext-json: *
- ext-openssl: *
- ext-pdo: *
- ext-xml: *
- block8/php-docblock-checker: 1.3.*
- bower-asset/admin-lte: 2.3.*
- bower-asset/font-awesome: 4.7.*
- bower-asset/ionicons: 2.0.*
- bower-asset/raphael: 2.2.*
- codeception/codeception: 2.3.*
- doctrine/instantiator: 1.0.*
- guzzlehttp/guzzle: 6.2.*
- jakub-onderka/php-parallel-lint: 0.9.*
- mnsami/composer-custom-directory-installer: 1.1.*
- monolog/monolog: 1.22.*
- npm-asset/codemirror: 5.23.*
- npm-asset/sprintf-js: 1.0.*
- pda/pheanstalk: 3.1.*
- phploc/phploc: 4.0.*
- phpmd/phpmd: 2.6.*
- phpunit/php-token-stream: 1.4.*
- phpunit/phpunit: 5.7.*
- pimple/pimple: 3.0.*
- psr/log: 1.0.*
- robmorgan/phinx: 0.8.*
- sebastian/phpcpd: 2.0.*
- sensiolabs/ansi-to-html: 1.1.*
- sensiolabs/security-checker: 4.0.*
- squizlabs/php_codesniffer: 2.8.*
- swiftmailer/swiftmailer: 5.4.*
- symfony/console: 3.3.*
- symfony/yaml: 3.3.*
Suggests
- hipchat/hipchat-php: For HipchatNotify plugin
- maknz/slack: For SlackNotify plugin
- mremi/flowdock: For FlowdockNotify plugin
This package is auto-updated.
Last update: 2025-01-06 10:31:52 UTC
README
PHP Censor is a open source self-hosted continuous integration server for PHP projects (PHPCI fork).
More screenshots.
- System requirements
- Features
- Installing
- Installing via Docker
- Updating
- Configuring project
- Migrations
- Tests
- Documentation
- License
System requirements
-
Unix-like OS (Windows isn't supported);
-
PHP 5.6+ (with OpenSSL support and enabled functions:
exec()
,shell_exec()
andproc_open()
); -
Web-server (Nginx or Apache2);
-
Database (MySQL/MariaDB or PostgreSQL);
-
Beanstalkd queue (Optional);
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, HipChat and Telegram;
-
Use your LDAP-server for authentication;
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 Postgres);
-
Install Beanstalkd Queue (Optional, if you are going to use queue with Worker):
aptitude install beanstalkd # For deb-based
- 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-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'
-
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 (Need configured Queue) or a cron-job to run PHP Censor builds;
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, 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.
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 # For testing on MySQL DB ./vendor/bin/phpunit --configuration ./phpunit.mysql.xml # For testing on PostgreSQL ./vendor/bin/phpunit --configuration ./phpunit.pgsql.xml
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/<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.
Documentation
Full PHP Censor documentation.
License
PHP Censor is open source software licensed under the BSD-2-Clause license.