{"id":13623167,"url":"https://github.com/consolidation/Robo","last_synced_at":"2025-04-15T14:32:08.236Z","repository":{"id":13494591,"uuid":"16185196","full_name":"consolidation/robo","owner":"consolidation","description":"Modern task runner for PHP","archived":false,"fork":false,"pushed_at":"2024-10-22T13:19:40.000Z","size":20443,"stargazers_count":2660,"open_issues_count":180,"forks_count":304,"subscribers_count":81,"default_branch":"5.x","last_synced_at":"2024-10-29T21:59:58.766Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://robo.li","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/consolidation.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2014-01-23T20:47:44.000Z","updated_at":"2024-10-25T03:34:40.000Z","dependencies_parsed_at":"2023-01-14T00:30:20.016Z","dependency_job_id":"a2803e54-e39d-4619-aadd-b771bf77acb5","html_url":"https://github.com/consolidation/robo","commit_stats":{"total_commits":1426,"total_committers":175,"mean_commits":8.148571428571428,"dds":0.517531556802244,"last_synced_commit":"e8de4c8643af16913031f56345c445043b8e19f9"},"previous_names":["consolidation-org/robo"],"tags_count":107,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/consolidation%2Frobo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/consolidation%2Frobo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/consolidation%2Frobo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/consolidation%2Frobo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/consolidation","download_url":"https://codeload.github.com/consolidation/robo/tar.gz/refs/heads/5.x","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223677468,"owners_count":17184475,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-01T21:01:28.815Z","updated_at":"2024-11-08T11:30:21.234Z","avatar_url":"https://github.com/consolidation.png","language":"PHP","funding_links":[],"categories":["目录","Table of Contents","PHP","类库"],"sub_categories":["任务运行者 Task Runners","Task Runners","任务","Globalization"],"readme":"# RoboTask\n\n**Modern and simple PHP task runner** inspired by Gulp and Rake aimed to automate common tasks:\n\n[![Gitter](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/consolidation/Robo?utm_source=badge\u0026utm_medium=badge\u0026utm_campaign=pr-badge\u0026utm_content=badge)\n[![Latest Stable Version](https://poser.pugx.org/consolidation/robo/v/stable.png)](https://packagist.org/packages/consolidation/robo)\n[![Latest Unstable Version](https://poser.pugx.org/consolidation/robo/v/unstable.png)](https://packagist.org/packages/consolidation/robo)\n[![Total Downloads](https://poser.pugx.org/consolidation/robo/downloads.png)](https://packagist.org/packages/consolidation/robo)\n\n[![ci](https://github.com/consolidation/robo/workflows/CI/badge.svg)](https://github.com/consolidation/robo/actions)\n[![scrutinizer](https://scrutinizer-ci.com/g/consolidation/robo/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/consolidation/robo/?branch=master)\n[![codecov](https://codecov.io/gh/consolidation/robo/branch/main/graph/badge.svg?token=CAaB7ofhxx)](https://codecov.io/gh/consolidation/robo)\n[![license](https://poser.pugx.org/consolidation/robo/license)](https://packagist.org/packages/consolidation/robo)\n\n* writing cross-platform scripts\n* processing assets (less, sass, minification)\n* running tests\n* executing daemons (and workers)\n* watching filesystem changes\n* deployment with sftp/ssh/docker\n\n## Branches\n\n| Branch | Support Level | Symfony | League Container | psr/log | PHP Versions |\n| ------ | ------------- | ------- | ---------------- | ------------ | ------------ |\n| [5.x](https://github.com/consolidation/robo/tree/5.x) | Stable             | 6 - 7 | 3 | 2 - 3 | 8.2 - 8.3 |\n| [4.x](https://github.com/consolidation/robo/tree/4.x) | Stable             | 6     | 3 | 2 - 3 | 8.0 - 8.3 |\n| [3.x](https://github.com/consolidation/robo/tree/3.x) | Not supported      | 4 - 6 | 3 | 1 - 2 | 7.1 - 8.1 |\n| [2.x](https://github.com/consolidation/robo/tree/2.x) | Not supported      | 4 - 5 | 2 | 1 - 2 | 7.1 - 7.4 |\n| [1.x](https://github.com/consolidation/robo/tree/1.x) | Not supported      | 2 - 4 | 2 | 1 - 2 | 5.5 - 7.4 |\n\nAll versions are roughly compatible; the breaking changes introduced at each major version are fairly minor, and typically only affect classes that are not used by most clients.\n\nNote also that Robo 5.x removed consolidation/self-update as a direct dependency. You will need to explicitly add it if you are using it to update your application phar.\n\n## Installing\n\n### Phar\n\n[Download robo.phar \u003e](https://robo.li/robo.phar)\n\n```\nwget https://robo.li/robo.phar\n```\n\nTo install globally put `robo.phar` in `/usr/bin`. (`/usr/local/bin/` in OSX 10.11+)\n\n```\nchmod +x robo.phar \u0026\u0026 sudo mv robo.phar /usr/bin/robo\n```\n\nOSX 10.11+\n```\nchmod +x robo.phar \u0026\u0026 sudo mv robo.phar /usr/local/bin/robo\n```\n\nNow you can use it simply via `robo`.\n\n### Composer\n\n* Run `composer require consolidation/robo:^4`\n* Use `vendor/bin/robo` to execute Robo tasks.\n\n## Usage\n\nAll tasks are defined as **public methods** in `RoboFile.php`. It can be created by running `robo init`.\nAll protected methods in traits that start with `task` prefix are tasks and can be configured and executed in your tasks.\n\n## Examples\n\nThe best way to learn Robo by example is to take a look into [its own RoboFile](https://github.com/consolidation/Robo/blob/2.x/RoboFile.php)\n 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`.\n\nHere are some snippets from them:\n\n---\n\nRun acceptance test with local server and selenium server started.\n\n\n``` php\n\u003c?php\n\nuse Robo\\Symfony\\ConsoleIO;\n\nclass RoboFile extends \\Robo\\Tasks\n{\n\n    function testAcceptance(ConsoleIO $io, $seleniumPath = '~/selenium-server-standalone-2.39.0.jar')\n    {\n       // launches PHP server on port 8000 for web dir\n       // server will be executed in background and stopped in the end\n       $this-\u003ecollectionBuilder($io)-\u003etaskServer(8000)\n            -\u003ebackground()\n            -\u003edir('web')\n            -\u003erun();\n\n       // running Selenium server in background\n       $this-\u003ecollectionBuilder($io)-\u003etaskExec('java -jar ' . $seleniumPath)\n            -\u003ebackground()\n            -\u003erun();\n\n       // loading Symfony Command and running with passed argument\n       $this-\u003ecollectionBuilder($io)-\u003etaskSymfonyCommand(new \\Codeception\\Command\\Run('run'))\n            -\u003earg('suite','acceptance')\n            -\u003erun();\n    }\n}\n```\n\nIf you execute `robo` you will see this task added to list of available task with name: `test:acceptance`.\nTo execute it you should run `robo test:acceptance`. You may change path to selenium server by passing new path as a argument:\n\n```\nrobo test:acceptance \"C:\\Downloads\\selenium.jar\"\n```\n\nUsing `watch` task so you can use it for running tests or building assets.\n\n``` php\n\u003c?php\nclass RoboFile extends \\Robo\\Tasks {\n\n    function watchComposer(ConsoleIO $io)\n    {\n        // when composer.json changes `composer update` will be executed\n        $this-\u003ecollectionBuilder($io)-\u003etaskWatch()-\u003emonitor('composer.json', function() use ($io) {\n            $this-\u003ecollectionBuilder($io)-\u003etaskComposerUpdate()-\u003erun();\n        })-\u003erun();\n    }\n}\n```\n\n---\n\nCleaning logs and cache\n\n``` php\n\u003c?php\nclass RoboFile extends \\Robo\\Tasks\n{\n    public function clean(ConsoleIO $io)\n    {\n        $this-\u003ecollectionBuilder($io)-\u003etaskCleanDir([\n            'app/cache',\n            'app/logs'\n        ])-\u003erun();\n\n        $this-\u003ecollectionBuilder($io)-\u003etaskDeleteDir([\n            'web/assets/tmp_uploads',\n        ])-\u003erun();\n    }\n}\n```\n\nThis task cleans `app/cache` and `app/logs` dirs (ignoring .gitignore and .gitkeep files)\nCan be executed by running:\n\n```\nrobo clean\n```\n\n----\n\nCreating Phar archive\n\n``` php\nfunction buildPhar(collectionBuilder $io)\n{\n    $files = Finder::create()-\u003eignoreVCS(true)-\u003efiles()-\u003ename('*.php')-\u003ein(__DIR__);\n    $packer = $this-\u003ecollectionBuilder($io)-\u003etaskPackPhar('robo.phar');\n    foreach ($files as $file) {\n        $packer-\u003eaddFile($file-\u003egetRelativePathname(), $file-\u003egetRealPath());\n    }\n    $packer-\u003eaddFile('robo','robo')\n        -\u003eexecutable('robo')\n        -\u003erun();\n}\n```\n\n---\n\n## We need more tasks!\n\nCreate 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).\n\n## Credits\n\nFollow [@robo_php](https://twitter.com/robo_php) for updates.\n\nBrought to you by [Consolidation Team](https://github.com/orgs/consolidation/people) and our [awesome contributors](https://github.com/consolidation/Robo/graphs/contributors).\n\n## License\n\n[MIT](https://github.com/consolidation/Robo/blob/3.x/LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fconsolidation%2FRobo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fconsolidation%2FRobo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fconsolidation%2FRobo/lists"}