PHPCI, Continous Integration Tool that designed for PHP

PHPCI Continuous Integration for PHP Projects

Travis CI and Jenkins CI are famous continuous integration services for merging the codes from developers working copies. They are helping us prevent integration problems integration hell. PHPCI is the continuous integration tool that specific designed for PHP and is writtern in PHP. PHPCI also integrated with another PHP tools like Composer, PHP Unit Test and PHP Spec etc…

PHPCI is a free and open source continuous integration tool specifically designed for PHP. We’ve built it with simplicity in mind, so whilst it doesn’t do everything Jenkins can do, it is a breeze to set up and use.

PHPCI is free and open source. You can setup PHPCI in 2 minute and self hosted it.

Setup & Dependencies

PHP requires below requirements and dependencies

  • PHP 5.3.3 +
  • Apache or Nginx Web Server
  • MySQL Server
  • Enable exec() in php.ini
  • php-openssl module installed

and then you can follow the installation guide to install.

Setting

Almost similar to Travis CI, you need to add a phpci.yml file to the root of your code base. Here is a example:

build_settings:
    ignore:
        - "vendor"
        - "tests"
    mysql:
        host: "localhost"
        user: "root"
        pass: ""        

setup:
    mysql:
        - "DROP DATABASE IF EXISTS test;"
        - "CREATE DATABASE test;"
        - "GRANT ALL PRIVILEGES ON test.* TO test@'localhost' IDENTIFIED BY 'test';"
    composer:
        action: "install"

test:
    php_unit:
        config:
            - "PHPUnit-all.xml"
            - "PHPUnit-ubuntu-fix.xml"
        directory:
            - "tests/"
        run_from: "phpunit/"
    php_mess_detector:
        allow_failures: true
    php_code_sniffer:
        standard: "PSR2"
    php_cpd:
        allow_failures: true

complete:
    mysql:
        - "DROP DATABASE IF EXISTS test;"

Check it out

Note: PHPCI is still under beta version, it may not so stable to use. We introduce it because it is awesome as we code PHP too. Let’s test the PHPCI together and contribute to them

Related Articles