Closed fprochazka closed 7 years ago
remove send-mail file: when Tracy sends me email with error, i fix it and want to remove this file
Is it really more convinient to run a command, if you can just delete the file in your file manager?
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
Enter/leave maintenance mode.
@vojtech-dobes good idea!
@snake-aas I'm really not sure it's that beneficial.
What about command for warming up cache?
@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.
By warming up cache I mean two main things:
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.
@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.
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.
@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.
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.
@juniwalk I don't think this package should contain commands for doctrine
@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.
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:
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 https://github.com/contributte/console/issues/3, he promised not to make it tightly coupled with contributte/console :)
For the record, we have made it. There is a new package contributte/console-extra with few useful Nette-based commands.
Check it out.
email-sent
and create timestamp directory and move all current log files there)What else do you have in mind?