3 **Modern and simple PHP task runner** inspired by Gulp and Rake aimed to automate common tasks:
5 [![Gitter](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/consolidation-org/Robo?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
6 [![Latest Stable Version](https://poser.pugx.org/consolidation/robo/v/stable.png)](https://packagist.org/packages/consolidation/robo)
7 [![Latest Unstable Version](https://poser.pugx.org/consolidation/robo/v/unstable.png)](https://packagist.org/packages/consolidation/robo)
8 [![Total Downloads](https://poser.pugx.org/consolidation/robo/downloads.png)](https://packagist.org/packages/consolidation/robo)
9 [![PHP 7 ready](http://php7ready.timesplinter.ch/consolidation/Robo/badge.svg)](https://travis-ci.org/consolidation/Robo)
10 [![License](https://poser.pugx.org/consolidation/robo/license.png)](https://www.versioneye.com/user/projects/57c4a6fe968d64004d97620a?child=57c4a6fe968d64004d97620a#tab-licenses)
12 [![Build Status](https://travis-ci.org/consolidation/Robo.svg?branch=master)](https://travis-ci.org/consolidation/Robo)
13 [![Windows CI](https://ci.appveyor.com/api/projects/status/0823hnh06pw8ir4d?svg=true)](https://ci.appveyor.com/project/greg-1-anderson/robo)
14 [![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/consolidation/Robo/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/consolidation/Robo/?branch=master)
15 [![Dependency Status](https://www.versioneye.com/user/projects/57c4a6fe968d64004d97620a/badge.svg?style=flat-square)](https://www.versioneye.com/user/projects/57c4a6fe968d64004d97620a)
17 * writing cross-platform scripts
18 * processing assets (less, sass, minification)
20 * executing daemons (and workers)
21 * watching filesystem changes
22 * deployment with sftp/ssh/docker
28 [Download robo.phar >](http://robo.li/robo.phar)
31 wget http://robo.li/robo.phar
34 To install globally put `robo.phar` in `/usr/bin`. (`/usr/local/bin/` in OSX 10.11+)
37 chmod +x robo.phar && sudo mv robo.phar /usr/bin/robo
42 chmod +x robo.phar && sudo mv robo.phar /usr/local/bin/robo
45 Now you can use it just like `robo`.
49 * Run `composer require consolidation/robo:~1`
50 * Use `vendor/bin/robo` to execute Robo tasks.
54 All tasks are defined as **public methods** in `RoboFile.php`. It can be created by running `robo`.
55 All protected methods in traits that start with `task` prefix are tasks and can be configured and executed in your tasks.
59 The best way to learn Robo by example is to take a look into [its own RoboFile](https://github.com/consolidation-org/Robo/blob/master/RoboFile.php)
60 or [RoboFile of Codeception project](https://github.com/Codeception/Codeception/blob/2.4/RoboFile.php). There are also some basic example commands in examples/RoboFile.php.
62 Here are some snippets from them:
66 Run acceptance test with local server and selenium server started.
71 class RoboFile extends \Robo\Tasks
74 function testAcceptance($seleniumPath = '~/selenium-server-standalone-2.39.0.jar')
76 // launches PHP server on port 8000 for web dir
77 // server will be executed in background and stopped in the end
78 $this->taskServer(8000)
83 // running Selenium server in background
84 $this->taskExec('java -jar ' . $seleniumPath)
88 // loading Symfony Command and running with passed argument
89 $this->taskSymfonyCommand(new \Codeception\Command\Run('run'))
90 ->arg('suite','acceptance')
96 If you execute `robo` you will see this task added to list of available task with name: `test:acceptance`.
97 To execute it you should run `robo test:acceptance`. You may change path to selenium server by passing new path as a argument:
100 robo test:acceptance "C:\Downloads\selenium.jar"
103 Using `watch` task so you can use it for running tests or building assets.
107 class RoboFile extends \Robo\Tasks {
109 function watchComposer()
111 // when composer.json changes `composer update` will be executed
112 $this->taskWatch()->monitor('composer.json', function() {
113 $this->taskComposerUpdate()->run();
121 Cleaning logs and cache
125 class RoboFile extends \Robo\Tasks
127 public function clean()
129 $this->taskCleanDir([
134 $this->taskDeleteDir([
135 'web/assets/tmp_uploads',
141 This task cleans `app/cache` and `app/logs` dirs (ignoring .gitignore and .gitkeep files)
142 Can be executed by running:
150 Creating Phar archive
155 $files = Finder::create()->ignoreVCS(true)->files()->name('*.php')->in(__DIR__);
156 $packer = $this->taskPackPhar('robo.phar');
157 foreach ($files as $file) {
158 $packer->addFile($file->getRelativePathname(), $file->getRealPath());
160 $packer->addFile('robo','robo')
168 ## We need more tasks!
170 Create your own tasks and send them as Pull Requests or create packages [with `"type": "robo-tasks"` in `composer.json` on Packagist](https://packagist.org/?type=robo-tasks).
174 Follow [@robo_php](http://twitter.com/robo_php) for updates.
176 Brought to you by [Consolidation Team](https://github.com/orgs/consolidation/people) and our [awesome contributors](https://github.com/consolidation/Robo/graphs/contributors).
180 [MIT](https://github.com/consolidation/Robo/blob/master/LICENSE)