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

Overview

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.

Comments
  • compatible with php 8.0

    compatible with php 8.0

    This pull request is for an issue #14

    | Q | A |-------------- | ------ | Documentation | no | Bugfix | no | BC Break | no | New Feature | yes | RFC | no | QA | yes

    opened by juizmill 4
  • PHP 7.4 fixtures

    PHP 7.4 fixtures

    There are some little changes in PHP 7.4 with could break the normal usage of Laminas Console. Perhaps these things can be fixed:

    • Failure return values of fread() is now false and not '', see https://github.com/laminas/laminas-console/blob/master/src/Adapter/AbstractAdapter.php#L531
    Bug 
    opened by panvid 4
  • Route does not match double-dash flag

    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.


    Originally posted by @hschletz at https://github.com/zendframework/zend-console/issues/6

    opened by weierophinney 3
  • Mandatory Value Parameters can not be parsed

    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 https://github.com/zendframework/zend-console/issues/27

    opened by weierophinney 3
  • Infinite loop password prompt

    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 https://github.com/zendframework/zend-console/issues/21

    opened by weierophinney 2
  • PHP 8.0 support

    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
    Enhancement Help Wanted hacktoberfest-accepted 
    opened by boesing 1
  • Psalm integration

    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.
    Enhancement Help Wanted hacktoberfest-accepted 
    opened by boesing 1
  • $_ENV is not enabled by default, $_SERVER should be used

    $_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 https://github.com/zendframework/zend-console/issues/18

    opened by weierophinney 1
  • Password prompt broken on Windows console

    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 https://github.com/zendframework/zend-console/issues/22

    opened by weierophinney 1
  • Bug in Zend\Console\Prompt\Select::show()

    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 https://github.com/zendframework/zend-console/issues/23

    opened by weierophinney 1
  • zend-console should not be required by zend-mvc

    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 https://github.com/zendframework/zend-console/issues/24

    opened by weierophinney 1
Owner
Laminas Project
Laminas components and MVC.
Laminas Project
Vandar Cashier is a Laravel package that allows you to seamlessly implement IPG and Direct Debit on your application

Vandar Cashier is a Laravel package that provides you with a seamless integration with Vandar services. Take a look at Vandar Documentation for more i

Vandar 11 Dec 14, 2022
laravel package help you to implement geographical calculation, with several algorithms that help you deal with coordinates and distances.

Geographical Calculator Geographical Calculator was developed for laravel 5.8+ to help you to implement geographical calculation, with With several al

karam mustafa 342 Dec 31, 2022
A package to implement repository pattern for laravel models

Laravel Model UUID A simple package to use Repository Pattern approach for laravel models . Repository pattern Repositories are classes or components

null 26 Dec 21, 2022
A Laravel 8 Project Implement with GraphQL With Sanctum APIs Authentications Which utilized in Any Frontend or Any Mobile Application Programs.

A Laravel 8 Project Implement with GraphQL With Sanctum APIs Authentications Which utilized in Any Frontend or Any Mobile Application Programs.

Vikas Ukani 3 Jan 6, 2022
Cascading deletes for Eloquent models that implement soft deletes

Cascading soft deletes for the Laravel PHP Framework Introduction In scenarios when you delete a parent record - say for example a blog post - you may

Michael Dyrynda 767 Jan 6, 2023
Filament Plugin to help implement Cloudflare turnstile into your forms.

Filament Turnstile Filament Turnstile, is a plugin to help you implement the Cloudflare turnstile. This plugin uses Laravel Turnstile Behind the scene

Coderflex 5 Jun 12, 2023
Create and manage A Domain Driven Design (DDD) in your Laravel app, simply and efficiently.

Create and manage A Domain Driven Design (DDD) in your Laravel app, simply and efficiently.

Lucas Nepomuceno 4 Jun 11, 2022
Create a downloads list - quick and easy. With categories and mobile friendly design

Simple downloads list plugin for wordpress Create a downloads list - quick and easy. With categories and mobile friendly design What is Simple downloa

Neofix 2 Dec 4, 2022
A simple laravel package to validate console commands arguments and options.

Command Validator A simple laravel package to validate console commands arguments and options. Installation Require/Install the package using composer

Touhidur Rahman 20 Jan 20, 2022
In-browser console for Laravel PHP framework.

Laravel 4 Console In-browser console for Laravel 4 PHP framework. This bundle executes your code within ConsoleController@postExecute context, and dis

null 172 Dec 30, 2022
Need some filters? This package is based on the Repository Design Pattern to let you create specific queries easily.

DevMakerLab/Laravel-Filters Need some filters? This package is based on the Repository Design Pattern to let you create specific queries easily. Insta

DevMakerLab 19 Feb 20, 2022
Laravel Design Pattern Generator (api generator)

Laravel Design Pattern Generator (api generator) you can create your restful api easily by using this library and you can filter, sort and include elo

HusseinAlaa 2 Sep 25, 2022
Rede social com laravel que possui as seguintes funcionalidades: Adicionar ao amigos, Criação de Grupo, Perfil, Criação de post, Comentários entre outros... Além de possuir um design

Social Network Sobre o Projeto Fala Devs! Estou trazendo aqui uma rede social com laravel que possui as seguintes funcionalidades: Adicionar ao amigos

Raissadev 4 Aug 1, 2022
Message box application written in Laravel - simple inbox design using auth UI.

About Laravel Laravel is a web application framework with expressive, elegant syntax. We believe development must be an enjoyable and creative experie

null 0 Dec 25, 2021
Aplicación Laravel-Livewire-Tailwind. La aplicación se conecta a APIRest y muestra resultados, búsquedas, historial, Responsive Design

About Laravel Laravel is a web application framework with expressive, elegant syntax. We believe development must be an enjoyable and creative experie

Juan Gómez 0 Feb 10, 2022
Mutex for Laravel Console Commands.

Laravel Console Mutex Mutex for Laravel Console Commands. Laravel Console Mutex 8.x 8.x 7.x 7.x 6.x 6.x 5.8.* 5.8.* 5.7.* 5.7.* 5.6.* 5.6.* 5.5.* 5.5.

Dmitry Ivanov 125 Dec 17, 2022
📝 Artisan Menu - Use Artisan via an elegant console GUI

?? Artisan Menu Use Artisan via an elegant console GUI Features Run built-in and custom Artisan commands from a console GUI Prompts to enter required

Jordan Hall 149 Dec 29, 2022
A wrapper package to run mysqldump from laravel console commands.

A wrapper package to run mysqldump from laravel console commands.

Yada Khov 24 Jun 24, 2022
This package provides a console command to convert dynamic JS/CSS to static JS/CSS assets.

Laravel Nova Search This package provides a console command to convert dynamic JS/CSS to static JS/CSS assets. Requirements laravel-mix v6.0+ php 7.3+

Akki Khare 3 Jul 19, 2022