Code Monkey home page Code Monkey logo

zend-console's Issues

modules.md syntax & getConsoleUsage() / getConsoleBanner() not displaying

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

Check Documentation For Other Things

Check docs for other problems

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

  • Bullet lists (should be single * then space at the start of line)
  • Inline code - should be marked by three backticks at start and finish
  • bookdown.json file is correctly formated and has the right escaping
  • Links between documentation using RST have been stripped
  • Any other RST has been removed correctly
  • Anything and everything not covered

If 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

array_unique is misused in RouteMatcher->parseDefinition(), and does nothing

  • I was not able to find an open or closed issue matching what I'm seeing.
  • This is not a question.

Provide a narrative description of what you are trying to accomplish.

Code to reproduce the issue

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,
    ),
  ),

Expected results

'alternatives' should have 'foo' once, at least according to code comments

Actual results

'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.

Infinite loop password prompt

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.


Check All Headers In Documentation

Check headers are correct

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.

Check Documentation Tables

Check the tables in a document

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.

zend-console not working as documented

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.

Bug in Zend\Console\Prompt\Select::show()

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


Comment

User: @DASPRiD
Created On: 2015-04-28T11:19:43Z
Updated At: 2015-04-28T11:19:43Z
Body
Can you be more specific?


Comment

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.


Password prompt broken on Windows console

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

  • It only reads uppercase characters.
  • It shows the characters that are entered.
  • When enter is pressed, the star characters suddenly popup.

This only happens in the default Windows console, not in the MINGW32 console (git bash).


Check For Blockquotes In Docs

Check the document for bad blockquoutes

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.

zend-console should not be required by zend-mvc

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.


Comment

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.


Comment

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 the required 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.


Comment

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


Comment

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


Comment

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


Mandatory Value Parameters can not be parsed

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.

$_ENV is not enabled by default, $_SERVER should be used

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

Check Documentation Code Blocks

Check code blocks are correct

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.

ZF3

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 ๐Ÿ‘Ž .

Route does not match double-dash flag

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.

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.