Giter Club home page Giter Club logo

laminas-console's Introduction

laminas-console

This package is abandoned and will receive no further development!

We recommend using laminas/laminas-cli.

Build Status Coverage Status

Laminas\Console is a component to design and implement console applications in PHP.

Deprecated

Both the laminas-console and the laminas-mvc-console components will likely not be maintained long-term, as there are more complete implementations available elsewhere. We strongly urge developers to start migrating their console tooling to use other libraries, such as symfony/console.

laminas-console's People

Stargazers

 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

laminas-console's Issues

Psalm integration

Feature Request

Q A
QA yes

Summary

As decided during the Technical-Steering-Committee Meeting on August 3rd, 2020, Laminas wants to implement vimeo/psalm in all packages.

Implementing psalm is quite easy.

Required

  • Create a psalm.xml in the project root
  • Copy and paste the contents from this psalm.xml.dist
  • Run $ composer require --dev vimeo/psalm
  • Run $ vendor/bin/psalm --set-baseline=psalm-baseline.xml
  • Add a composer script static-analysis with the command psalm --shepherd --stats
  • Add a new line to script: in .travis.yml: - if [[ $TEST_COVERAGE == 'true' ]]; then composer static-analysis ; fi
  • Remove phpstan from the project (phpstan.neon.dist, .travis.yml entry, composer.json require-dev and scripts)
Optional
  • Fix as many psalm errors as possible.

PHP 8.0 support

Feature Request

Q A
New Feature yes

Summary

To be prepared for the december release of PHP 8.0, this repository has some additional TODOs to be tested against the new major version.

In order to make this repository compatible, one has to follow these steps:

  • Modify composer.json to provide support for PHP 8.0 by adding the constraint ~8.0.0
  • Modify composer.json to drop support for PHP less than 7.3
  • Modify composer.json to implement phpunit 9.3 which supports PHP 7.3+
  • Modify .travis.yml to ignore platform requirements when installing composer dependencies (simply add --ignore-platform-reqs to COMPOSER_ARGS env variable)
  • Modify .travis.yml to add PHP 8.0 to the matrix (NOTE: Do not allow failures as PHP 8.0 has a feature freeze since 2020-08-04!)
  • Modify source code in case there are incompatibilities with PHP 8.0

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.



Originally posted by @GeeH at zendframework/zend-console#23

$_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


Originally posted by @jaapio at zendframework/zend-console#18

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



Originally posted by @GeeH at zendframework/zend-console#22

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


Originally posted by @lrochas at zendframework/zend-console#26

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.


Originally posted by @zf2timo at zendframework/zend-console#27

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



Originally posted by @GeeH at zendframework/zend-console#24

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.



Originally posted by @GeeH at zendframework/zend-console#21

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.