Giter Site home page Giter Site logo

contributte / console-extra Goto Github PK

View Code? Open in Web Editor NEW
28.0 8.0 7.0 203 KB

:recycle: Nette-based console commands for latte, DIC, MVC, security, utils and many others.

Home Page: https://contributte.org/packages/contributte/console-extra.html

License: MIT License

PHP 98.60% Makefile 1.38% Latte 0.03%
console symfony-console nette-framework contributte caching nette

console-extra's Introduction

Website ๐Ÿš€ contributte.org | Contact ๐Ÿ‘จ๐Ÿปโ€๐Ÿ’ป f3l1x.io | Twitter ๐Ÿฆ @contributte

Usage

To install latest version of contributte/console-extra use Composer.

composer require contributte/console-extra

Documentation

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

Versions

State Version Branch Nette PHP
dev ^0.9 master 3.2+ >=8.1
stable ^0.8 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-extra's People

Contributors

cniry avatar f3l1x avatar gappa avatar h4kuna avatar keeehi avatar mabar avatar michalhlavka avatar petrparolek avatar roman3349 avatar solcik avatar trejjam avatar vody105 avatar vojtechmares 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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

console-extra's Issues

Using with Kdyby/Console

Hi,

maybe some people will want to start using this package while still using Kdyby/Console. I was using modette/cache-cleaner before (which is now abandoned), which also required some "hacking" :)

However, this package requires a bit different approach (maybe I'm just doing it wrong, I also don't want to edit other package's files). This is what I did to make AdvancedCache\CacheCleanCommand to work with Kdyby/Console:

services:
	 localFsCleaner: Contributte\Console\Extra\Cache\Cleaners\LocalFilesystemCleaner([%tempDir%/cache/])

console:
	commands:
		- Contributte\Console\Extra\Command\AdvancedCache\CacheCleanCommand([@localFsCleaner])

And voilรก:

Available commands:
	help                                  Displays help for a command
	list                                  Lists commands
	contributte
		contributte:cache:clean            Clean cache 

No need to register the extension itself (which is questionable? :)

So, I was thinking of adding a guide to the docs for users interested in using this package who are still "vendor-locked" in Kdyby/Console. Is it a good idea? :)

nette:latte:warmup - Unexpected tag {_}, did you mean {=}?

Suddenly I am getting by bin/console nette:latte:warmup hundreds of errors like:

[CAUTION] Warmuping error:                                                                                           
 !           /home/vagrant/project/redesign/app/modules/Frontend/Presenters/templates/Journal/parts/teaserDefault.latt
 !           e                                                                                                          
 !           Error: Unexpected tag {_}, did you mean {=}? (in '.../parts/teaserDefault.latte' on line 10 at column 21) 

Really a translation tag makes problems? As in the code I have {_'journal_title'}

contributte:cache:generate -g option not work

If i use command php bin/console.php contributte:cache:generate -g di i get:

In CacheGenerateCommand.php line 63:
Cannot run undefined generator "di"

Configuration is still the same that works before updating.

I think that here should be $generatorName used as a key in array $generatorDefinitions. Is that correct or there is a better solution?

Missing docs

Hi,
just take a look on this, it looks cool and I want to test it, but I am missing the docs (/.docs folder).

Can you please commit it? It is just easier to install & configure, now I have to look to the code, which is perfectly fine, but slow.

Thank you

Added example to playground

Simple nette sandbox project with contributte/console and this console-extra.
Please drop unnecessary files, dependencies from composer, etc.

Missing default configuration

The default configuration is missing in the latest version 0.5.0.

Error log:

   E_NOTICE: Trying to get property 'generators' of non-object
   
   in src/DI/AdvancedCacheConsoleExtension.php(47) 
   in src/DI/ConsoleBridgesExtension.php(59) Contributte\Console\Extra\DI\AdvancedCacheConsoleExtension->loadConfiguration()
   in src/DI/Compiler.php(229) Contributte\Console\Extra\DI\ConsoleBridgesExtension->loadConfiguration()
   in src/DI/Compiler.php(204) Nette\DI\Compiler->processExtensions()
   in src/DI/ContainerLoader.php(119) Nette\DI\Compiler->compile()
   in src/DI/ContainerLoader.php(79) Nette\DI\ContainerLoader->generate()
   in src/DI/ContainerLoader.php(44) Nette\DI\ContainerLoader->loadFile()
   in src/Bootstrap/Configurator.php(242) Nette\DI\ContainerLoader->load()
   in src/Bootstrap/Configurator.php(221) Nette\Configurator->loadContainer()
   in iqrf-gateway-webapp/tests/bootstrap.php(41) Nette\Configurator->createContainer()
   in ServiceModule/Models/UnknownManagerTest.php(18) require()

Used configuration: https://gitlab.iqrf.org/open-source/iqrf-gateway-webapp/blob/f5a0f0d16237d40e3dc925331d287a4f93178c70/app/config/console.neon)

contributte:cache:generate: Service of type 'Symfony\Component\Console\Application' not found.

When running bin/console contributte:cache:generate, I get following error:

root@908b9b84ae4c:/var/www/html# bin/console contributte:cache:generate
Compiling Latte templates
All templates successfully compiled.
Compiling DI containers
Compiling container `debug`

In Autowiring.php line 53:
                                                                      
  Service of type 'Symfony\Component\Console\Application' not found.  
                                                                      

contributte:cache:generate [-l|--list] [-g|--generator GENERATOR]

This issue is replicable using https://github.com/contributte/webapp-skeleton

after I added

  • row $configurator->addServices(['configurator' => $configurator]); to app/bootstrap.php

  • to app/config/app/services.neon section

services:
	configurator:
		type: Nette\Configurator
		imported: true
  • to app/config/ext/contributte.neon.
contributte.console.extra:
	advancedCache:
		generators:
			latte: Contributte\Console\Extra\Cache\Generators\LatteTemplatesCacheGenerator(
				@Nette\Application\UI\ITemplateFactory,
				[%appDir%],
				[],
				::realpath(%appDir%/..)
			)
			di: Contributte\Console\Extra\Cache\Generators\DiContainersCacheGenerator(
				[
					debug: [debugMode: true, consoleMode: false],
					production: [debugMode: false, consoleMode: false],
					console: [debugMode: true, consoleMode: true]
				]
			)

I'm not sure why exactly it's happening, but it's happening me always and I can't figure out any fix.
Using version 0.6.0 of contributte/console-extra and 0.9.1 of contributte/console-extra

ScriptPath issue

Hi,

I have latest versions of contributte/console (0.7.1) and contributte/console-extra (dev-master) and these extensions are producing ScriptPath error:

  • console.latte
  • console.router

error message:

Screenshot 2019-09-27 at 13 51 19

I checked the UrlScript file and printed also the variables: $path is having the value, but $this->ScriptPath is null.

In config file I have just:

console:
    url: v73.seyvillas.local

Am I missing something in the config or it's a bug?

LocalFilesystemCleaner vs RobotLoader 3.4.0

There is an incompatibility with RobotLoader 3.4.0 when trying to clear its cache. (It works fine with version 3.3.2 & below).

Fatal error: Uncaught RuntimeException: Unable to create file '{_path_to_web_}/app/../temp/cache/nette.robotLoader/e6d54b90b1f4c8e8141ba9a16d30e092.php.lock'. fopen({_path_to_web_}/app/../temp/cache/nette.robotLoader/e6d54b90b1f4c8e8141ba9a16d30e092.php.lock): failed to open stream: No such file or directory in {_path_to_web_}/vendor/nette/robot-loader/src/RobotLoader/RobotLoader.php:524

Stack trace:
#0 {_path_to_web_}/vendor/nette/robot-loader/src/RobotLoader/RobotLoader.php(506): Nette\Loaders\RobotLoader->acquireLock('/home/users/dev...', 2)
#1 {_path_to_web_}/vendor/nette/robot-loader/src/RobotLoader/RobotLoader.php(84): Nette\Loaders\RobotLoader->saveCache()
#2 [internal function]: Nette\Loaders\RobotLoader->__destruct()
#3 {main} thrown in {_path_to_web_}/vendor/nette/robot-loader/src/RobotLoader/RobotLoader.php on line 524 

I think this is the commit part that is the culprit:

I'm not really sure what can be done about that since saving the cache in __destruct is a feature.

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.