{"id":15025776,"url":"https://github.com/huttopia/console-bundle","last_synced_at":"2025-04-09T20:04:17.545Z","repository":{"id":56987247,"uuid":"90374388","full_name":"Huttopia/console-bundle","owner":"Huttopia","description":"Add some nice features to symfony/console","archived":false,"fork":false,"pushed_at":"2022-09-19T13:42:42.000Z","size":26,"stargazers_count":8,"open_issues_count":0,"forks_count":5,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-09T20:04:11.523Z","etag":null,"topics":["console","doctrine2","php","php7","php71","symfony","symfony-console"],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Huttopia.png","metadata":{"files":{"readme":"README.md","changelog":"changelog.md","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-05-05T12:40:33.000Z","updated_at":"2024-10-22T21:04:59.000Z","dependencies_parsed_at":"2022-08-21T12:50:19.358Z","dependency_job_id":null,"html_url":"https://github.com/Huttopia/console-bundle","commit_stats":null,"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Huttopia%2Fconsole-bundle","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Huttopia%2Fconsole-bundle/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Huttopia%2Fconsole-bundle/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Huttopia%2Fconsole-bundle/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Huttopia","download_url":"https://codeload.github.com/Huttopia/console-bundle/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248103865,"owners_count":21048245,"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","doctrine2","php","php7","php71","symfony","symfony-console"],"created_at":"2024-09-24T20:02:59.593Z","updated_at":"2025-04-09T20:04:17.519Z","avatar_url":"https://github.com/Huttopia.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![version](https://img.shields.io/badge/version-1.3.3-green.svg)](https://github.com/huttopia/console-bundle)\n[![symfony](https://img.shields.io/badge/symfony/frameworkbundle-^2.3%20||%20^3.0%20||%20^4.0%20||%20^5.0-blue.svg)](https://symfony.com)\n[![symfony](https://img.shields.io/badge/symfony/console-^2.3%20||%20^3.0%20||%20^4.0%20||%20^5.0-blue.svg)](https://symfony.com)\n![Lines](https://img.shields.io/badge/code%20lines-973-green.svg)\n![Total Downloads](https://poser.pugx.org/huttopia/console-bundle/downloads)\n\n# ConsoleBundle\n\nAllow to exclude some commands.\n\nFor example, if you don't want to have _doctrine:schema:update_ command in _prod_ env: now you can :).\n\nAdd configuration to _doctrine:schema:update_ to get queries for more than one database per connection.\n\n[Changelog](changelog.md)\n\n# Installation\n\n```bash\ncomposer require huttopia/console-bundle ^1.3\n```\n\nReplace parts of `bin/console`:\n```php\n# Replace use Symfony\\Bundle\\FrameworkBundle\\Console\\Application; by this one\nuse Huttopia\\ConsoleBundle\\Application;\n\n# Add this line before $input = new ArgvInput();\n$allCommands = \\Huttopia\\ConsoleBundle\\CommandOption\\AllCommandsOption::parseAllCommandsOption($argv);\n$input = new ArgvInput();\n\n# Replace Application creation (it should be the last 2 lines of your bin/console)\n// $application = new Application($kernel);\n// $application-\u003erun($input);\n(new Application($kernel))\n    -\u003esetAllCommands($allCommands)\n    -\u003erun($input);\n```\n\n## Symfony \u003c= 3\n```php\n# app/AppKernel.php\nclass AppKernel\n{\n    public function registerBundles()\n    {\n        $bundles = [\n            new \\Huttopia\\ConsoleBundle\\ConsoleBundle()\n        ];\n    }\n}\n```\n\n## Symfony \u003e= 4\n\n```yaml\n# config/bundles.php\nreturn [\n    Huttopia\\ConsoleBundle\\ConsoleBundle::class =\u003e ['all' =\u003e true]\n];\n```\n\n# Exclude commands\n\n```yaml\n# Symfony \u003c= 3: app/config/config.yml\n# Symfony \u003e= 4: config/packages/console_bundle.yaml\nconsole:\n    excluded:\n        - 'foo:bar:baz'\n        - 'bar:foo:baz'\n```\n\n# Hide parts of command list\n\nWhen you call `bin/console` or `bin/console list`, you see the list of commands.\n\nOutput is cut in 4 parts:\n * Symfony version, environment and debug mode state\n * Help for usage syntax\n * Help for options available with all commands\n * Commands list\n\nYou can configure at what verbosity level each part will be shown.\n\nVerbosity level could be `0`, `1` (`-v`), `2` (`-vv`) or `3` (`-vvv`).\n```yaml\n# Symfony \u003c= 3: app/config/config.yml\n# Symfony \u003e= 4: config/packages/console_bundle.yaml\nconsole:\n    list:\n        symfonyVersionVerbosityLevel: 1\n        usageVerbosityLevel: 1\n        optionsVerbosityLevel: 1\n        availableCommandsVerbosityLevel: 0\n```\n\n# Colorise some commands\n\nWhen you call `bin/console` or `bin/console list`, you see the list of commands.\n\nYou can change the color of each part of the command name and description:\n\n```\nconsole:\n    list:\n        output:\n            # See https://symfony.com/doc/current/console/coloring.html\n            styles:\n                foo:\n                    foreground: cyan # 1st parameter of new OutputFormatterStyle()\n                    background: green # 2nd parameter of new OutputFormatterStyle()\n                    options: [bold, underscore] # 3rd parameter of new OutputFormatterStyle()\n            commands:\n                generate:benchmark: \"\u003cfoo\u003e%%s\u003c/\u003e%%s%%s\" # 1st %s is command name, 2nd is spaces between name and description and 3rd is the description\n            highlights: # Shortcut for \"\u003chighlight\u003e%%s\u003c/\u003e%%s\u003chighlight\u003e%%s\u003c/\u003e\" who will write command name and description in cyan instead of green and white\n                - 'cache:clear'\n``` \n\n# doctrine:schema:update for more than one database\n\n_doctrine:schema:update_ has a major problem for us: only one database per connection is managed.\n\nIn our projects, we have more than one database per connection, so _doctrine:schema:update_ don't show queries for all our databases.\n \n_UpdateDatabaseSchemaCommand_ replace _doctrine:schema:update_ and call old _doctrine:schema:update_ for all configured databases!\n\n## Configuration\n\n```yaml\n# Symfony \u003c= 3: app/config/config.yml\n# Symfony \u003e= 4: config/packages/console_bundle.yaml\nconsole:\n    databases:\n        - database_name_1\n        - database_name_2\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhuttopia%2Fconsole-bundle","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhuttopia%2Fconsole-bundle","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhuttopia%2Fconsole-bundle/lists"}