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`.
37 chmod +x robo.phar && sudo mv robo.phar /usr/bin/robo
40 Now you can use it just like `robo`.
44 * Run `composer require consolidation/robo:~1`
45 * Use `vendor/bin/robo` to execute Robo tasks.
49 All tasks are defined as **public methods** in `RoboFile.php`. It can be created by running `robo`.
50 All protected methods in traits that start with `task` prefix are tasks and can be configured and executed in your tasks.
54 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)
55 or [RoboFile of Codeception project](https://github.com/Codeception/Codeception/blob/master/RoboFile.php). There are also some basic example commands in examples/RoboFile.php.
57 Here are some snippets from them:
61 Run acceptance test with local server and selenium server started.
66 class RoboFile extends \Robo\Tasks
69 function testAcceptance($seleniumPath = '~/selenium-server-standalone-2.39.0.jar')
71 // launches PHP server on port 8000 for web dir
72 // server will be executed in background and stopped in the end
73 $this->taskServer(8000)
78 // running Selenium server in background
79 $this->taskExec('java -jar ' . $seleniumPath)
83 // loading Symfony Command and running with passed argument
84 $this->taskSymfonyCommand(new \Codeception\Command\Run('run'))
85 ->arg('suite','acceptance')
91 If you execute `robo` you will see this task added to list of available task with name: `test:acceptance`.
92 To execute it you should run `robo test:acceptance`. You may change path to selenium server by passing new path as a argument:
95 robo test:acceptance "C:\Downloads\selenium.jar"
98 Using `watch` task so you can use it for running tests or building assets.
102 class RoboFile extends \Robo\Tasks {
104 function watchComposer()
106 // when composer.json changes `composer update` will be executed
107 $this->taskWatch()->monitor('composer.json', function() {
108 $this->taskComposerUpdate()->run();
116 Cleaning logs and cache
120 class RoboFile extends \Robo\Tasks
122 public function clean()
124 $this->taskCleanDir([
129 $this->taskDeleteDir([
130 'web/assets/tmp_uploads',
136 This task cleans `app/cache` and `app/logs` dirs (ignoring .gitignore and .gitkeep files)
137 Can be executed by running:
145 Creating Phar archive
150 $files = Finder::create()->ignoreVCS(true)->files()->name('*.php')->in(__DIR__);
151 $packer = $this->taskPackPhar('robo.phar');
152 foreach ($files as $file) {
153 $packer->addFile($file->getRelativePathname(), $file->getRealPath());
155 $packer->addFile('robo','robo')
163 ## We need more tasks!
165 Create your own tasks and send them as Pull Requests or create packages prefixed with `robo-` on Packagist.
169 Follow [@robo_php](http://twitter.com/robo_php) for updates.
171 Brought to you by [Consolidation Team](https://github.com/orgs/consolidation/people) and our [awesome contributors](https://github.com/consolidation/Robo/graphs/contributors).
175 [MIT](https://github.com/consolidation/Robo/blob/master/LICENSE)