Git Product home page Git Product logo

console's Introduction

Website 🚀 contributte.org | Contact 👨🏻‍💻 f3l1x.io | Twitter 🐦 @contributte

Usage

To install latest version of contributte/console use Composer.

composer require contributte/console

Documentation

For details on how to use this package, check out our documentation.

Versions

State Version Branch Nette PHP
dev ^0.11.0 master 3.2+ >=8.1
stable ^0.10.0 master 3.2+ >=8.1

Development

See how to contribute to this package. This package is currently maintained by these authors.


Consider to support contributte development team. Also thank you for using this package.

console's People

Contributors

artemevsin avatar dakur avatar enumag avatar f3l1x avatar forrest79 avatar gappa avatar ipsosdavidkriz avatar jankonas avatar janmikes avatar jantvrdik avatar janzarubadek avatar mabar avatar martinmystikjonas avatar miloshavlicek avatar mrceperka avatar paveljanda avatar petrparolek avatar roman3349 avatar solcik avatar vody105 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  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

console's Issues

Nette 3.0 compatiblity issue

There seem to be problem with usage of deprecated method in ConsoleExtension on line 127 as the method second argument (setClass) was deprecated.

Tested with v3.0.0-beta2

Any ETA on stable version supporting PHP 8?

Hi, the latest stable version is not compatible with PHP 8 according to composer.json, can we expect it released any time soon?
This question applies to all maintained contributte packages, but I don't want to flood every repo with same issue.
Thanks.

Entrypoint - Špatná detekce wwwDir

Ahoj @f3l1x.
Chci říct, že super práce. Právě přepisujem kod a nahrazujem Kdyby\Doctrine pomocí Nettrine :)
Nicméně k problému.
Mohl bys prosím poradit, případně to i doplnit do DOC, jak správně detekovat wwwDir?

Jde o to, že kdy použiji tvůj příklad i s umístěním, tak se špatně nastaví wwwDir.
https://github.com/contributte/console/tree/master/.docs#entrypoint

Což není vůbec ideální a některé věci začnou fungovat neočekáváně.

Nejsnadnější řešení by bylo přesunout script vedle index.php, ale to se mi opravdu nechce.
V podstatě bych potřeboval po vytvoření containeru změnit wwwDir parameter.

Lazy commands and callInjects

I am trying this as replacement for Kdyby/Console and I had idea of small improvement. What about use container callInjects when lazy loading commands by CommandLoader. Commands then would behave similar to presenters. Creazed when needed with required dependencies autimatically injected. It would provide easy way to get dependencies without helpers. What do you think? Should I prepare PR?

Contributte.org documentation not up to date

Commit bcaad99 removed the config parameter lazy as the commands are now lazy by default, but this is not reflected in the documentation on contributte.org. The documentation in this repository seems to reflect that correctly, so the contributte.org documentation probably just needs to be synced.

Get rid of foo in sake of newbies

I needed to explain how commands work, but docs were not much helpful.

Couldn't be there rather some artificial Article or UserModel injected, some article:add or users:add command registered and instead of "Some magic" some code demonstrated?

I remember well how much I struggled with these foo stuff many years ago when I was trying to understand what are interfaces for. I actually didn't understand it then until years later someone showed me real world interface.

Reference: https://www.google.com/search?q=why+not+to+use+foo

Support for nette 3.1 and nette/utils 4.0

I cannot install package because of conflicts:

Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - contributte/di[v0.5.1, ..., v0.5.2] require nette/di ~3.0.2 -> found nette/di[v3.0.2, ..., v3.0.15] but it conflicts with your root composer.json require (^3.1).
    - contributte/di v0.5.3 requires nette/di ~3.0.13 -> found nette/di[v3.0.13, v3.0.14, v3.0.15] but it conflicts with your root composer.json require (^3.1).
    - contributte/di v0.5.4 requires nette/utils ^3.2.8 -> found nette/utils[v3.2.8, v3.2.9] but it conflicts with your root composer.json require (^4.0).
    - contributte/console v0.9.2 requires contributte/di ^0.5.1 -> satisfiable by contributte/di[v0.5.1, v0.5.2, v0.5.3, v0.5.4].
    - Root composer.json requires contributte/console ^0.9.2 -> satisfiable by contributte/console[v0.9.2].

Use the option --with-all-dependencies (-W) to allow upgrades, downgrades and removals for packages currently locked to specific versions.
You can also try re-running composer require with an explicit version constraint, e.g. "composer require contributte/console:*" to figure out if any version is installable, or "composer require contributte/console:^2.1" if you know which you need.

Can you check it and add support for latest nette packages?

Not able to build without helperSet

Trying to migrate from kdyby. My conf:

console:
	name: xxx
	version: '1.0'
	catchExceptions: true
	autoExit: true
	url: http://example.com
	lazy: false
	helperSet: null
	helpers: []

And build throw error:

Nette\DI\ServiceCreationException: Service 'console.helperSet': Factory and type are missing in definition of service.

ver:

  - Installing nette/di (v3.0.1): Cloning 4aff517a1c from cache
  - Installing contributte/console (v0.7.1): Cloning a676e1a395 from cache

Allow nullable url

Allow url to be null.

'url' => Expect::anyOf(Expect::string(), Expect::null())

Basic commands [idea]

I'm just thinking about some basic commands.

Assets

Cache

  • nette:cache:purge

Database

  • nette:database:dump

DI

  • nette:di:purge
  • nette:di:warmup

NEON

Solved via Neonizer - https://github.com/contributte/neonizer.

Latte

  • nette:latte:purge
  • nette:latte:warmup

Router

  • nette:router:dump
  • nette:router:match [url]
  • nette:router:link [args]

Security

  • nette:security:password [password]
  • nette:security:acl --all --roles --resources

Utils

  • nette:utils:random
  • nette:utils:json:lint

Validator (really?)

  • nette:validator:email
  • nette:validator:url

Provide CLI mode, e.q. Contributte\Console\DI\ConsoleExtension(%consoleMode%).

Ahoj,

toto je spíše dotaz, nerozumím této hlášce kterou dostanu po spuštění konzole když postupuji přesně podle tutorialu. Hláška samozřejmě zmizí pokud přidám parametr v konfiguraci:

extensions:
    console: Contributte\Console\DI\ConsoleExtension(true)

ale ta kontrola tam předpokládám k něčemu je, tak se chci zeptat kde dělám chybu, případně poprosit o dopsání dokumentace.

Jinak super práce, taky jsem nesnášel ohýbání routeru.

Díky.

PHP 7.3 support

Hi, I started work on new project with PHP 7.3, and there is problem with resolving requirements symfony/console.

Problem 1
    - symfony/console 4.4.x-dev requires php ^7.1.3 -> your PHP version (7.3.6-1+ubuntu18.04.1+deb.sury.org+1) overridden by "config.platform.php" version (7.1) does not satisfy that requirement.

Packages and PHP requirements update

Hello,

I wanted to make a PR to update symfony/console and minimal PHP version, but I noticed that the package still has CI actions for EOL PHP versions, like 7.2.

So my question is - is it needed to support old PHP version in CI?
If so, is it possible to update dependencies without breaking the CI?

Downloading old version would still be possible, through versioning on Packagist.

Kind regards
John

Lazy mode, BC break?

In previous version (master) was default lazy value false, in current configuration schema in "next" branch is that value set to true, so everyone with zero extension configuration runs in problem that he needs to define his command names statically.

Solution would be remove this option, and register lazy commands automatically when they have tags: [console.command: app:foo] in .neon configuration or they have configured default name statically. Instead of throwing ServiceCreationException, https://github.com/contributte/console/blob/next/src/DI/ConsoleExtension.php#L181 can be $applicationDef->addSetup('add', [$service]); and lazy configuration will not be needed.

ConsoleExtension doesn't support `Nette\DI\Statement`

When using global functions in NEON config like: not(%debugMode%) they get created by DI as Nette\DI\Statement but here ConsoleExtension is casting them to bool which silently fails and evaulates to true regardless of the statement value

Version: 0.5.0

There is not any default HelperSet?

I've just migrated from Kdyby/Console and I'm not able to use any native helper of Symfony/Console.
I'm trying to use question helper:

$this->helper = $this->getHelper('question');

which returns Cannot retrieve helper "question" because there is no HelperSet defined.
As the documentation says:

You could also define you custom helperSet just in case.`

I thought that there is some default/native helperSet (and I can add my own custom set too) but there is not helperSet at all. How do I implement basic helpers from Symfony? Is there any example? Is there any example of custom helperSet too?

I see that can do something like this:

$set = new HelperSet();
$set->set(new QuestionHelper());
$this->setHelperSet($set);

for every helper I need. But is there any shorter way (like - set every native helper from symfony)?

Thank you for help

Edit:
While testing, I've created BasicHelperSet which extends HelperSet and contains only one helper. I've registred it in config by using: helperSet: App\Console\BasicHelperSet in console section (as is written in documentation) but I'm still getting same error ..no HelperSet defined.. (I am purging temp aswell).

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.