zendframework / zend-console Goto Github PK
View Code? Open in Web Editor NEWConsole component from Zend Framework
License: BSD 3-Clause "New" or "Revised" License
Console component from Zend Framework
License: BSD 3-Clause "New" or "Revised" License
Hi,
Doing same setup as https://zendframework.github.io/zend-mvc-console/intro/, nothing is displayed by getConsoleBanner() nor getConsoleUsage(). I've done some tests to confirm that Route is found and Controller is executed. Someone's got the same issue here https://stackoverflow.com/questions/38636186/how-to-create-zf3-console-application
By the way, in modules.md, line 236 and line 293 should be ];
instead of );
.
Cheers
TLDR; Cast your eye over the documetation for any problems not covered in the other issues
Things slip through the net, so check the documentation for other problems that have been missed. Common other problems include
*
then space at the start of line)bookdown.json
file is correctly formated and has the right escapingIf you end up fixing the same problem over and over, please ping Gary Hockin - we may be able to add bespoke issue for that problem, or fix in automated capacity
I guess this is also issue for other prompts
Provide a narrative description of what you are trying to accomplish.
php > $r = new Zend\Console\RouteMatcher\DefaultRouteMatcher('[--foo | --foo]');
php > var_export($r);
Zend\Console\RouteMatcher\DefaultRouteMatcher::__set_state(array(
'parts' =>
array (
0 =>
array (
'name' => 'unnamedGroupAt1',
'literal' => false,
'required' => false,
'positional' => false,
'alternatives' =>
array (
0 => 'foo',
1 => 'foo',
),
'hasValue' => false,
),
),
'alternatives'
should have 'foo'
once, at least according to code comments
'foo'
occurs twice.
See http://php.net/manual/en/function.array-unique.php - this does not modify the input
Takes an input array and returns a new array without duplicate values.
This snippet occurs 4 times in src/RouteMatcher/DefaultRouteMatcher.php - It probably should be $options = array_unique($options);
instead.
// remove dupes
array_unique($options);
This was detected by static analysis, and may be harmless. I'm not sure of the impact of fixing this.
This issue has been moved from the zendframework
repository as part of the bug migration program as outlined here - http://framework.zend.com/blog/2016-04-11-issue-closures.html
Original Issue: https://api.github.com/repos/zendframework/zendframework/issues/7560
User: @waltertamboer
Created On: 2015-05-30T08:55:03Z
Updated At: 2015-11-06T21:58:16Z
Body
The Zend\Console\Prompt\Password
class seems to end up in an infinite loop when ran in an MINGW32 console (giti bash) on Windows machines and in the normal Windows console. (Test on Windwos 8.1 - Zend Framework 2.4.2)
There is a while (true)
loop which only breaks when the entered character is equal to PHP_EOL
, this never seems to be true.
I'm not sure how this behaves on Mac or Linux machines but maybe it would be better to check for line endings:
if (ord($char) === 10 || ord($char) === 13) {
Issue #7559 might be related.
TLDR; Headers should use the
#
,##
etc to format different levels of headers, and not be underlines using=====
or ``-----`, or be psuedo header using bold
Check all headers on the documentation - headers should use the hash style of declaration rather then be underlined with equals or dashes. The more hashes, the more of a subheading. Eg:
#
is equal to <h1>
##
is equal to <h2>
###
is equal to <h3>
####
is equal to <h4>
#####
is equal to <h5>
Headings should be appropriate for their level in the documentation.
Psuedo headers using bold tags **
should be replaced with appropriate level of heading tag.
No documentation found at https://zendframework.github.io/zend-console/
TLDR; All tables should be in the format of GHFM using
|
and-
as horizontal and vertical separators respectively
Check all tables are in the correct format. Please don't use leading and trailing |
- more information on github flavoured markdown tables can be found here.
The Docs say:
When a zend-mvc application is run from a console window (a shell window or Windows command prompt), it will recognize this fact and prepare zend-mvc components to handle the request. Console support is enabled by default, but to function properly it requires at least one console route and one action controller to handle the request. [...]
That seems not to be true and i can't find any code in zend-mvc (v3) that handles console-requests.
This doc should be replaced by working examples.
May be, this is an version issue. So zend-console should require zend-mvc v2 or documentation should point out that this only works with zend-mvc v2. ... and generally provide only documentation for its on functionality and usage.
This issue has been moved from the zendframework
repository as part of the bug migration program as outlined here - http://framework.zend.com/blog/2016-04-11-issue-closures.html
Original Issue: https://api.github.com/repos/zendframework/zendframework/issues/7465
User: @IvanoP
Created On: 2015-04-28T11:15:45Z
Updated At: 2015-11-06T21:28:47Z
Body
This method can't support more of 9 items
User: @DASPRiD
Created On: 2015-04-28T11:19:43Z
Updated At: 2015-04-28T11:19:43Z
Body
Can you be more specific?
User: @IvanoP
Created On: 2015-04-28T11:43:30Z
Updated At: 2015-04-28T11:43:30Z
Body
In Zend\Console\Prompt\Select the method show() over overrides the show() method in Zend\Console\Prompt\Char. In this method the user input is read by readChar() method. This Method read a single characther. So you cannot input a two char index for a option in Select.
This issue has been moved from the zendframework
repository as part of the bug migration program as outlined here - http://framework.zend.com/blog/2016-04-11-issue-closures.html
Original Issue: https://api.github.com/repos/zendframework/zendframework/issues/7559
User: @waltertamboer
Created On: 2015-05-30T08:54:41Z
Updated At: 2015-11-06T21:57:00Z
Body
The password prompt seems to be broken on my Windows 8.1 machine (Zend Framework 2.4.2).
This only happens in the default Windows console, not in the MINGW32 console (git bash).
TLDR; Check blockquotes are formatted correctly using
>
and check headings in blockquotes are using###
Blockquotes are donated by a single greater than character and then a space. Make sure all the blockquotes in every doc file are correctly formatted. Headings in blockquotes should use ###
and not bold.
Any paragraph spacing in blockquotes should be marked using a single greater than, then a space.
This issue has been moved from the zendframework
repository as part of the bug migration program as outlined here - http://framework.zend.com/blog/2016-04-11-issue-closures.html
Original Issue: https://api.github.com/repos/zendframework/zendframework/issues/7107
User: @marc-mabe
Created On: 2015-01-07T18:16:45Z
Updated At: 2015-04-03T06:51:53Z
Body
The zend-console
component is already within the suggest
part of composer but in fact if you use zend-mvc
only for HTTP handling using defaults you have to install zend-console
only because it's using Console::isConsole()
.
see https://github.com/zendframework/zf2/blob/67f098af070b29d5042e89e936604df3193d2212/library/Zend/Mvc/Service/RequestFactory.php#L28
see https://github.com/zendframework/zf2/blob/67f098af070b29d5042e89e936604df3193d2212/library/Zend/Mvc/Service/ResponseFactory.php#L28
This simple check should be replaced by PHP_SAPI == 'cli'
. I don't know if it's required for testing to virtually mark the current running script as non CLI but this should be simple enough to be duplicated in zend-mvc
to not require zend-console
.
User: @Ocramius
Created On: 2015-01-07T18:23:00Z
Updated At: 2015-01-07T18:23:00Z
Body
The MVC is supposed to run both in console and in HTTP environments: I don't think that should be changed at all (personal opinion).
Also, please remember to use absolute commit-based URIs when linking code, or the references will be lost as the branches get updated.
User: @marc-mabe
Created On: 2015-01-07T18:29:44Z
Updated At: 2015-01-07T18:30:03Z
Body
The MVC is supposed to run both in console and in HTTP environments
Than it would need to be part of therequired
section.
In my opinion the mvc should not hard require HTTP or Console. Sure it's designed to work with both and that's very nice but it should not be required.
User: @marc-mabe
Created On: 2015-01-07T18:32:57Z
Updated At: 2015-01-07T18:32:57Z
Body
Also, please remember to use absolute commit-based URIs when linking code, or the references will be lost as the branches get updated.
updated links to reference the latest commit
User: @Pittiplatsch
Created On: 2015-01-08T06:42:33Z
Updated At: 2015-01-08T06:42:33Z
Body
In my opinion the mvc should not hard require HTTP or Console. Sure it's designed to work with both and that's very nice but it should not be required.
+1
Maybe kind of IOC can help here, i.e. let zend-console
inject some flag into zend-mvc
during bootstrap? Should be trivial by using an appropriate event...
User: @harikt
Created On: 2015-04-03T06:51:52Z
Updated At: 2015-04-03T06:51:52Z
Body
Hi @Ocramius ,
I was learning zend-mv from the docs http://framework.zend.com/manual/current/en/modules/zend.mvc.intro.html
I have came across a few dependency that the zend-mvc really need or throw errors not found.
"zendframework/zend-modulemanager": "~2.4",
"zendframework/zend-loader": "~2.4",
"zendframework/zend-view": "~2.4",
"zendframework/zend-serializer": "~2.4",
"zendframework/zend-log": "~2.4",
"zendframework/zend-i18n":"~2.4",
"zendframework/zend-console": "~2.4",
"zendframework/zend-http": "~2.4",
"zendframework/zend-cache": "~2.4"
Though, some of you may disagree with me.
Thanks
Related to #29
I tried to create a route where a group of Value Parameters is mandatory like this example:
<?php
return [
// ....
'console-export-prepared-products' => [
'options' => [
'route' => 'export prepared products (--from-file=|--model=)',
'defaults' => [
'controller' => \Controller\PreparedProductsController::class,
'action' => 'export',
'verbose' => false,
]
]
],
//...
];
But this results into a InvalidArgumentException:
Fatal error: Uncaught exception 'Zend\Console\Exception\InvalidArgumentException' with message 'Cannot understand Console route at "(--from-file=|--model=)"' in /var/www/mw/vendor/zendframework/zendframework/library/Zend/ServiceManager/ServiceManager.php on line 946
Zend\Console\Exception\InvalidArgumentException: Cannot understand Console route at "(--from-file=|--model=|--recent)" in /var/www/mw/vendor/zendframework/zendframework/library/Zend/Console/RouteMatcher/DefaultRouteMatcher.php on line 432
I expected that the route is only matched if either the parameter --from-file
or --model
is set.
Ubuntu has a default setting which only stores the environment variables in $_SERVER. The $_ENV is always empty, only when variables_order is changed to EGPCS $_ENV is available.
Quote from the php.ini:
; This directive determines which super global arrays are registered when PHP
; starts up. G,P,C,E & S are abbreviations for the following respective super
; globals: GET, POST, COOKIE, ENV and SERVER. There is a performance penalty
; paid for the registration of these arrays and because ENV is not as commonly
; used as the others, ENV is not recommended on productions servers. You
; can still get access to the environment variables through getenv() should you
; need to.
Therefore I think zend-console should use $_SERVER instead of $_ENV
TLDR; Check in all files that codeblocks are correct, in PSR-2 format and have PHP syntax highlighting applied.
Code blocks should be in the following format...
```php 'ZEND-FRAMEWORK'); // No required options $rendererOptions = array(); $renderer = Barcode::factory( 'code39', 'image', $barcodeOptions, $rendererOptions ); ```
Note the three backticks then php in the opening fence, and the closing fence is just three backticks. It's common for the opening backticks to have no code type, or something like source.
Code should also have been automatically formatted into PSR-2 format, but sometimes these slip through the net.
Hi @Maks3w and others ^^
Just to know if there is a channel of communication about zend-console and ZF3
Just want to contribute and add or port new features because zend-console is ... really poor ๐ .
This is my simple route definition:
'[--flag|-f] <arg>'
Only "-f" and "-flag" match, "--flag" does not. According to the documentation, "--flag" should match, which would also follow common conventions.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.