zfcampus / zf-console

Create console applications in PHP
BSD 3-Clause "New" or "Revised" License
64 stars 25 forks source link

Supplied useful filters #8

Closed slaff closed 10 years ago

slaff commented 10 years ago

Suggested implementation for issue #6:

QueryString: to allow arguments such as --directives=session.save_handler=cluster&something=else, which would be parsed to the array ["session.save_handler" => "cluster", "something" => "else"]. PHP's parse_str() could be used for an initial implementation; however, it munges keys to valid PHP variable names, and thus a custom implementation should likely be used.

JSON: to allow arguments such as --directives='{"session.save_handler": "cluster", "something": "else"}', which would parse to the same value as in the QueryString example above.

Explode: to allow delimited arguments to be parsed to an array: --modules=foo,bar,baz would be come ['foo', 'bar', 'baz']. The delimiter would be a comma by default, but could be specified during instantiation (or, if using the FilterPluginManager, when requesting the filter).

slaff commented 10 years ago

@weierophinney Can you take a look at this request?