Comments (17)
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.
remove send-mail file: when Tracy sends me email with error, i fix it and want to remove this file
from console.
Is it really more convinient to run a command, if you can just delete the file in your file manager?
from console.
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.
Enter/leave maintenance mode.
from console.
@vojtech-dobes good idea!
@snake-aas I'm really not sure it's that beneficial.
from console.
What about command for warming up cache?
from console.
@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.
By warming up cache I mean two main things:
- Build RobotLoader cache
- 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.
@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.
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.
@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.
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.
@juniwalk I don't think this package should contain commands for doctrine
from console.
@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.
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:
- app needs to expecting temp directory from external source (IMO not really good way)
- chroot child process to another directory (http://php.net/manual/en/function.chroot.php, works only on unix systems)
from 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.
from console.
Related Issues (20)
- Symfony\Component\Console\Helper\DialogHelper is deprecated HOT 1
- Compatibility with Symfony/Console 2.6 HOT 3
- LogicException An option named "debug-mode" already exists. HOT 4
- Kdyby\Console requires app router to be a RouteList instance HOT 4
- Dvě aplikace s jedním vendor HOT 7
- DI injection for commands? HOT 7
- Add CoC Document HOT 3
- Command cannot depend on other command HOT 2
- Container is not available in Command::configure HOT 7
- Shouldn't we run the Nette\Application\Application onShutdown event? HOT 5
- Please configure the Doctrine extensions using the section 'doctrine:' HOT 2
- Check argv before constructing ArgvInput HOT 6
- Argument 1 passed to Symfony\Component\Console\Application::renderException() must be an instance of Exception, instance of TypeError given HOT 3
- Bad absolute path when not in a domain root HOT 2
- %wwwDir% HOT 1
- Release new version HOT 8
- kdyby/console failed to update, invalid composer.json data
- [Semantical Error] The annotation "@phpcsSuppress" in class KdybyModule\CliPresenter was never imported. HOT 7
- Errors during console presenter/application startup get silenced
- CliRouter is child of CliRouter is child of ... HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from console.