summaryrefslogtreecommitdiff
path: root/oh-my-zsh/plugins/symfony2
diff options
context:
space:
mode:
Diffstat (limited to 'oh-my-zsh/plugins/symfony2')
-rw-r--r--oh-my-zsh/plugins/symfony2/README.md28
-rw-r--r--oh-my-zsh/plugins/symfony2/symfony2.plugin.zsh34
2 files changed, 62 insertions, 0 deletions
diff --git a/oh-my-zsh/plugins/symfony2/README.md b/oh-my-zsh/plugins/symfony2/README.md
new file mode 100644
index 0000000..7623347
--- /dev/null
+++ b/oh-my-zsh/plugins/symfony2/README.md
@@ -0,0 +1,28 @@
+# Symfony2
+
+This plugin provides completion for [Symfony 2](https://symfony.com/), as well as aliases for frequent Symfony commands.
+
+To use it add symfony2 to the plugins array in your zshrc file.
+
+```bash
+plugins=(... symfony2)
+```
+
+## Aliases
+
+| Alias | Command | Description |
+|---------------|------------------------------|-------------------------------|
+| `sf` | php app/console | Start the symfony console |
+| `sfcl` | sf cache:clear | Clear the cache |
+| `sfsr` | sf server:run | Run the dev server |
+| `sfcw` | sf cache:warmup | Use the Bundles warmer |
+| `sfroute` | sf debug:router | Show the different routes |
+| `sfcontainer` | sf debug:container | List the different services |
+| `sfgb` | sf generate:bundle | Generate a bundle |
+| `sfgc` | sf generate:controller | Generate a controller |
+| `sfgcom` | sf generate:command | Generate a command |
+| `sfge` | sf doctrine:generate:entity | Generate an entity |
+| `sfsu` | sf doctrine:schema:update | Update the schema in Database |
+| `sfdc` | sf doctrine:database:create | Create the Database |
+| `sfdev` | sf --env=dev | Update environment to `dev` |
+| `sfprod` | sf --env=prod | Update environment to `prod` |
diff --git a/oh-my-zsh/plugins/symfony2/symfony2.plugin.zsh b/oh-my-zsh/plugins/symfony2/symfony2.plugin.zsh
new file mode 100644
index 0000000..e23809d
--- /dev/null
+++ b/oh-my-zsh/plugins/symfony2/symfony2.plugin.zsh
@@ -0,0 +1,34 @@
+# Symfony2 basic command completion
+
+_symfony_console () {
+ echo "php $(find . -maxdepth 2 -mindepth 1 -name 'console' -type f | head -n 1)"
+}
+
+_symfony2_get_command_list () {
+ `_symfony_console` --no-ansi --no-debug | sed "1,/Available commands/d" | awk '/^ ?[^ ]+ / { print $1 }'
+}
+
+_symfony2 () {
+ compadd `_symfony2_get_command_list`
+}
+
+compdef _symfony2 '`_symfony_console`'
+compdef _symfony2 'app/console'
+compdef _symfony2 'bin/console'
+compdef _symfony2 sf
+
+#Alias
+alias sf='`_symfony_console`'
+alias sfcl='sf cache:clear'
+alias sfsr='sf server:run -vvv'
+alias sfcw='sf cache:warmup'
+alias sfroute='sf debug:router'
+alias sfcontainer='sf debug:container'
+alias sfgb='sf generate:bundle'
+alias sfgc='sf generate:controller'
+alias sfgcom='sf generate:command'
+alias sfge='sf doctrine:generate:entity'
+alias sfsu='sf doctrine:schema:update'
+alias sfdc='sf doctrine:database:create'
+alias sfdev='sf --env=dev'
+alias sfprod='sf --env=prod'