Giter VIP home page Giter VIP logo

Comments (17)

fprochazka avatar fprochazka commented on August 22, 2024 2

Well, I don't wanna do this now and definitely not as a part of this repository. If anything, they should be in separate package, independent of Kdyby/Console.

Thank you all for your feedback! I really appreciate it!

If you wanna help, go check out this issue @f3l1x opened contributte/console#3, he promised not to make it tightly coupled with contributte/console :)

from console.

grossmannmartin avatar grossmannmartin commented on August 22, 2024

remove send-mail file: when Tracy sends me email with error, i fix it and want to remove this file

from console.

fprochazka avatar fprochazka commented on August 22, 2024

Is it really more convinient to run a command, if you can just delete the file in your file manager?

from console.

grossmannmartin avatar grossmannmartin commented on August 22, 2024

Assuming that i'm on a production server.
Everytime I type rm, I check it ten times. Run MC find file and delete is slow... so for me yes it is more convenient and cannot make mistake

from console.

vojtech-dobes avatar vojtech-dobes commented on August 22, 2024

Enter/leave maintenance mode.

from console.

fprochazka avatar fprochazka commented on August 22, 2024

@vojtech-dobes good idea!

@snake-aas I'm really not sure it's that beneficial.

from console.

JanTvrdik avatar JanTvrdik commented on August 22, 2024

What about command for warming up cache?

from console.

fprochazka avatar fprochazka commented on August 22, 2024

@JanTvrdik you mean for compiling the application? That might require quite some effort, becase you cannot do that directly from console, but have to send a http request - and for that you have to know the url... and you can already just type the website to your browser, or call curl... I don't see how we could possibly do that to make it easier that current ways.

from console.

JanTvrdik avatar JanTvrdik commented on August 22, 2024

By warming up cache I mean two main things:

  1. Build RobotLoader cache
  2. Compile all Latte templates

This is something you should always do when deploying application before you switch from old version to the new one. Therefore you can't access the application via HTTP request and console is all you have.

from console.

fprochazka avatar fprochazka commented on August 22, 2024

@JanTvrdik good point. But I see a little problem here. How do I compile templates, if I don't know all the macros? There can be different macro set for every single template.

from console.

JanTvrdik avatar JanTvrdik commented on August 22, 2024

I've seen the problem too and was hoping that you'll find a solution =) For most websites it would be enough to use default template from DI container.

from console.

juniwalk avatar juniwalk commented on August 22, 2024

@fprochazka This is what I use in cli-config.php for Doctrine commands:

// Load Nette DI container instance and get EntityManager
$di = include __DIR__.'/../app/bootstrap.php';
$em = $di->getByType('Kdyby\Doctrine\EntityManager');

Which warms up cache, atleast for Doctrine, would it help if you get Application service and run it in the command? So you would not need to know the Url of the site?

Just correct me if I am wrong, my knowledge of Nette is not that great yet.

from console.

juniwalk avatar juniwalk commented on August 22, 2024

Also add command to fix permissions, this is something I use a lot!

I have created tiny CLI application juniwalk/darwin to do just that, but it still needs some work on that fix command - viz juniwalk/darwin#1.

//EDIT: I could modify my command, fix the issue and send pull to kdyby/console if you'd like.

from console.

fprochazka avatar fprochazka commented on August 22, 2024

@juniwalk I don't think this package should contain commands for doctrine

from console.

juniwalk avatar juniwalk commented on August 22, 2024

@fprochazka that was just example, you would put code from index.php there, meaning:

// Load Nette DI container instance and run Application service
$dic = include __DIR__.'/../app/bootstrap.php';
$dic->getByType('Nette\Application\Application')->run();

Thats for the cache warm up.
//EDIT: IF that is usable for the task.

from console.

Buri avatar Buri commented on August 22, 2024

Regarding generation of container, easiest would be to spawn child process and run it with different temp folder. Nette will automatically generate the container and you could then run latte or do a dummy request to presenter in console. When cache is warmed up, just rename old folder, rename new folder and then delete the old folder.

Changing temp folder can be bit tricky, because by default its hardcoded in most examples. Options are:

from console.

f3l1x avatar f3l1x commented on August 22, 2024

For the record, we have made it. There is a new package contributte/console-extra with few useful Nette-based commands.

Check it out.

from console.

Related Issues (20)

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.