Coder Social home page Coder Social logo

zf-console's People

Contributors

1ma avatar arnaudligny avatar asurrey avatar geerteltink avatar michalbundyra avatar mtymek avatar slaff avatar stefanotorresi avatar weierophinney avatar zf2timo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

zf-console's Issues

Warning generated every time I use console

Hello.

In multiple applications, every time I use a console route I get the following warning:

HP Warning:  cli_set_process_title(): cli_set_process_title had an error: Not initialized correctly in /Users/geeh/www/modules.zendframework.com/vendor/zfcampus/zf-console/src/Application.php on line 534

This happens both inside and outside of ZF2 app.

Thank you.

Supply useful filters

Per @slaff:

  • 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).

Commands and subcommands

How to create this console router?

myscript.php zone <command> <args>

Command can be: import and export.
<args> can be path or id

Some problems:

zone 

must print list of available commands (like 'Available commands: import, export')

zone import (without any other args)

must print help for zone import command (like 'usage zone import /path/to/file.json`)

zone export

must print help for zone export command (like 'usage zone export ')

and now

zone import file.json

or

zone export 100

must launch any one or two functions from \Foo\Bar class

How can i do this?

Please create new version 1.0.4

The last commits merged since 1.0.3 are not tagged with a version number. If I install this via composer I cannot use:

"require": {
    "zfcampus/zf-console": "1.*"
},

I must use:

"require": {
    "zfcampus/zf-console": "dev-master*"
},

Running with service manager

Could you gave example how to do dependency injection from service manager ( container interop ) that define in the configuration to the handler ?

Disabling banner and footer from an argument

Is there a way or a suggested solution to disable banner and footer from a command-line argument?

I would like to be able to use an argument like --disable_banner to disable the banner. This would be useful when piping the output but I would like to have control it from the command line.

I figure that I could preparse the arguments before $app->run() is called to look for the --quiet argument.

Any suggestions?

Thanks

Create Skeleton Application

Make it easy for every PHP developer to start creating a ZF-CLI application.

  • Create boilerplate code
  • Add simple getting started example(s)
  • Add phar support (pack your app in a single stand-alone file).
  • Documentation: Add an article or short tutorial.

Better error handling

Now is little bit tricky to eg. log errors in zf-console.

I like the idea of new error handler in stratigility. Especially error response (message) generation, triggering listeners (useful for logging) etc.

Do you have any idea how this implement in zf-console? Your opinions?

At service-manager to handle commands / all objects?

I thought of adding the ZF2 ServiceManager to handle the commands. I think it would make it much easier to create factories to create command instances. Or we could even add all objects to the ServiceManager, especially the Application instance. That would make it much easier to inject the Application instance to the HelpCommand as well. We could even refactor the Application class and pull out the standard commands to external classes (like the HelpCommand). An extra interface could standardize the __invoke() methods for all commands.

Would the effort be worth it or would it introduce an unwanted complexity or overhead?

Wrong zend/console requirement version

as DefaultRouteMatcher and RouteMatcherInterface was introduced in Zend 2.3.0 release the composer.json requirement specified as

"zendframework/zend-console": "~2.0"

could not met the proper version of ZendConsole which cause the errors when importing

use Zend\Console\RouteMatcher\DefaultRouteMatcher;
use Zend\Console\RouteMatcher\RouteMatcherInterface;

minimal version requirements should be reviewed to prevent that issue

Adding a RouteInterface definition

Hi,

I started using this microframework about a week ago. Works great especially when integrating with a ZF3 framework or resuing existing ZF3 modules.

I wrote a lot of route handlers and got a little lazy at figuring out what the __invoke function should have as arguments. So I wrote a Route Interface definition to ensure compliance with how handlers are invoked.

If you are interested, I forked the project and added RouteInterface.php under the src folder.

I am quite new to GitHub as a contributor and I am not sure about how to do pull requests and such.

Thanks
Eric

Better error handling

What I am missing is good default error handler that prints information based on a template set in the configuration. Something similar to:

======================================================================
   The application has thrown an exception!
======================================================================
 :className
 :message

when not in debug mode and the full exception stack trace when in debug mode.

Positional value parameters with name

Hi,

I would like to provide the parameter name with positional value parameter.

Currently, if I pass the name it appends that name to the value.

Example:

php script.php build project=1 name=Test

Expected results

[
'project' => 1,
'name' => 'Test',
]

Actual results

[
'project' => 'project=1',
'name' => 'name=Test',
]

I know, I can add an optional parameter like [--project=1] and then add a check on code level. But I don't want to do this.

Is there any possibility we can achieve this?

Any help would be much appreciated.

Thanks

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.