If you use the Zend Framework CLI interface much you probably find yourself expecting tab-completion to work. Well, with this bash completion script it will. Just add the following line to your .bashrc or .bash_profile:
source path/to/zf.bash
Next time you load the terminal, you can type “zf c” and hit TAB twice to see a list of available commands (change, configure and create” or type “zf cr” and hit TAB to have “create” automatically inserted for you. The script works for both action names and provider names (but not for anything past that). Eventually I want the script to dynamically load the available commands (so that it works with custom providers and future versions of ZF without updates) but I couldn’t get that working for this version so I just hard coded them.
There’s also a version that completes commands from the Galahad Framework Extension if you’re testing that out…
Zend Framework CLI Bash Completion Script [1.71 kB]Enjoy!
Related posts:
- Better Zend Framework Documentation If you’ve every tried to navigate the Zend Framework documentation’s...
- Zend Framework URI validator & filter For the last couple of months I’ve been incorporating portions...
- Zend Framework: Using separate layouts per module Someone was recently asking on ZFTalk about how to use...
- Review: Zend Framework 1.8 Web Application Development At the beginning of February PACKT Publishing sent me a...
- PHP Modeling (in Zend Framework) I’ve been thinking a lot about Modeling in a MVC...
Pingback: Zend Framework in Action » Chris Morell: Zend Framework Bash Completion Script
Pingback: Zend Framework News » Blog Archive » Autovervollständigung für Zend_Tool
Pingback: Podpowiadanie komend Zend Framework w bashu