{"id":19349220,"url":"https://github.com/efrane/consoleadditions","last_synced_at":"2025-04-23T06:30:50.580Z","repository":{"id":26031191,"uuid":"107152491","full_name":"eFrane/ConsoleAdditions","owner":"eFrane","description":"Tools to make working with Symfony Console even more awesome.","archived":false,"fork":false,"pushed_at":"2024-12-13T00:06:00.000Z","size":1655,"stargazers_count":5,"open_issues_count":6,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-02T09:22:37.052Z","etag":null,"topics":["console","php-library","symfony","symfony-console"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/eFrane.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.md","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":"2017-10-16T16:15:37.000Z","updated_at":"2024-06-21T16:25:14.000Z","dependencies_parsed_at":"2024-11-10T04:25:29.631Z","dependency_job_id":"4d184fbe-82cf-4c06-8417-68b06ab4b40a","html_url":"https://github.com/eFrane/ConsoleAdditions","commit_stats":{"total_commits":141,"total_committers":4,"mean_commits":35.25,"dds":"0.34042553191489366","last_synced_commit":"d073caa68034c578230207fdf9d173f360f75e20"},"previous_names":[],"tags_count":14,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eFrane%2FConsoleAdditions","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eFrane%2FConsoleAdditions/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eFrane%2FConsoleAdditions/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eFrane%2FConsoleAdditions/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/eFrane","download_url":"https://codeload.github.com/eFrane/ConsoleAdditions/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250384733,"owners_count":21421784,"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":["console","php-library","symfony","symfony-console"],"created_at":"2024-11-10T04:25:21.232Z","updated_at":"2025-04-23T06:30:50.057Z","avatar_url":"https://github.com/eFrane.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Build Status](https://travis-ci.org/eFrane/ConsoleAdditions.svg?branch=master)](https://travis-ci.org/eFrane/ConsoleAdditions)\n[![Latest Stable Version](https://poser.pugx.org/efrane/console-additions/v/stable)](https://packagist.org/packages/efrane/console-additions)\n[![Latest Unstable Version](https://poser.pugx.org/efrane/console-additions/v/unstable)](https://packagist.org/packages/efrane/console-additions)\n[![License](https://poser.pugx.org/efrane/console-additions/license)](https://packagist.org/packages/efrane/console-additions)\n\n# Console Additions\n\nTools to make working with Symfony Console even more awesome.\n\n## Installation\n\nThis package is available on [Packagist](https://packagist.org/packages/efrane/console-additions):\n\n```bash\ncomposer require efrane/console-additions\n```\n\n## The Additions\n\n### `Batch`\n\nThis class offers batching commands of a Symfony Console Application. This can be\nuseful when writing things like deployment or update scripts as console commands\nwhich call many other commands in a set order e.g. cache updating, database\nmigrations, etc.\n\nUsage in a `Command::execute`:\n\n```php\n\\EFrane\\ConsoleAdditions\\Command\\Batch::create($this-\u003egetApplication(), $output)\n    -\u003eadd('my:command --with-option')\n    -\u003eadd('my:other:command for-this-input')\n    -\u003erun();\n```\n\n**Shell Commands**\n\nBatches can be an intertwined set of console application and system shell\ncommands. This is an advanced feature which requires the `symfony/process`\npackage as additional dependency.\n\nSince shell commands internally create `Process` objects, the `Batch` API\nexposes to methods for adding a shell command:\n\n- `addShell` adds the process with the given configuration (see Batch::addShell for details) \n- `addShellCb(string $cmd, callable $cb)` creates the process and passes it to a callback\n  for further configuration. This is especially useful when the desired command requires\n  some kind of process piping.\n\n**Silencing Errors**\n\nIt is possible to run a Batch of commands without throwing exceptions.\n\n### Output\n\nThis Package offers additional console output interfaces:\n\n#### `FileOutput`\n\nFileOutputs write all their data to a file stream and come in to concrete flavours:\n\n- `NativeFileOutput` uses the native PHP file streaming functions, thus being a good\n  option for local destinations and depending on your servers PHP streaming protocols\n  configuration it might even suffice for remote destinations.\n  \n- `FlysystemFileOutput` on the other hand passes the stream data on to a \n  `league/flysystem`-Adapter, thus being able to send that data to any Flysystem-supported\n  destination, i.e. S3, Dropbox, FTP, etc.\n\n#### `MultiplexedOutput`\n\nMultiplexedOutput can be used to combine multiple output interfaces to act as one.\nThis is the logical companion of file outputs since usually one would probably\nwant to send the output to the user's console and some other destination.\nA simple setup inside might look like this:\n\n```php\n    class Command extends \\Symfony\\Component\\Console\\Command {\n        public function execute(InputInterface $input, OutputInterface $output) {\n            // send output to multiple destinations\n            $output = new \\EFrane\\ConsoleAdditions\\Output\\MultiplexedOutput([\n                $output,\n                new \\EFrane\\ConsoleAdditions\\Output\\NativeFileOutput('command.log')\n            ]);\n            \n            // normal console command\n            \n        }\n    }\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fefrane%2Fconsoleadditions","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fefrane%2Fconsoleadditions","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fefrane%2Fconsoleadditions/lists"}