Skip to content
This repository was archived by the owner on Jan 31, 2020. It is now read-only.

new feature: ConsoleHelper #63

Conversation

weierophinney
Copy link
Member

Provides the following:

  • Console output using STDOUT for meaningful, expected output
  • Console output using STDERR for error messages
  • Ensures any line breaks are converted to PHP_EOL
  • Optionally provides console color escape sequences to provide context, which means:
    • Detecting whether or not the console supports colors in the first place
    • Providing appropriate escape sequences to produce color

This feature is being developed to support some of the console tooling we've been creating, including:

  • zf-development-mode
  • zf-composer-autoloading
  • new zend-servicemanager factory/configuration generation tooling

Essentially, tools that have zero or small numbers of arguments that can be easily parsed manually, but for which we want to provide color output.

Provides the following:

- Console output using `STDOUT` for meaningful, expected output
- Console output using `STDERR` for error messages
- Ensures any line breaks are converted to `PHP_EOL`
- Optionally provides console color escape sequences to provide context, which means:
    - Detecting whether or not the console supports colors in the first place
    - Providing appropriate escape sequences to produce color
@weierophinney weierophinney added this to the 3.1.0 milestone Sep 12, 2016
@weierophinney
Copy link
Member Author

Ping @GeeH !

@RalfEggert
Copy link

Looks good, but I wonder why this is not added to Zend\Console.

@weierophinney
Copy link
Member Author

@RalfEggert I discussed that with @GeeH , and we had three possibilities open to us.

Action Pros Cons
Add to zend-console Same domain, many utilities already present. Adds zend-stdlib as an additional requirement; makes the code largely redundant.
Create new repo SRP, small footprint Another component to maintain.
Add to zend-stdlib Most repos already require it; no additional dependencies; small footprint. Appearance of duplication.

Interestingly, zend-servicemanager, which is where we originally started developing this, has no requirements other than container-interop, which meant if we created the functionality elsewhere, it automatically means an additional requirement for the component. To keep requirements minimal, we felt the second and third options made most sense, and since this package already has infrastructure, felt the maintenance overhead would be better suited here.

@RalfEggert
Copy link

@weierophinney Thanks for clarification!

@GeeH
Copy link
Contributor

GeeH commented Sep 13, 2016

All good.

👍

weierophinney added a commit that referenced this pull request Sep 13, 2016
weierophinney added a commit that referenced this pull request Sep 13, 2016
@weierophinney weierophinney deleted the feature/console-helper branch September 13, 2016 14:31
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants