dev-master
9999999-dev https://github.com/0s1r1s/DevShortcutsBundleBundle for symfony2 console command shortcuts.
MIT
The Requires
- php >=5.3.2
- symfony/framework-bundle ~2.1
by Laurin Wandzioch
development shortcuts console command
Wallogit.com
2017 © Pedro Peláez
Bundle for symfony2 console command shortcuts.
DevShortcutsBundle is a symfony2 bundle that allows you to run often used console commands with shortcuts. During development you always need to clear caches, reset the database, dump/watch the assets etc. With the DevShortcutsBundle you can easily run this commands faster., (*1)
composer require 0s1r1s/dev-shortcuts-bundle
Register the bundle:, (*2)
<?php
// app/AppKernel.php
public function registerBundles()
{
$bundles = array(
// ...
new Osiris\Bundle\DevShortcutsBundle\OsirisDevShortcutsBundle(),
);
// ...
}
If you want to use the "d" shortcut you need to set the path to your data fixtures in your config.yml:, (*3)
# app/config/config.yml
osiris_dev_shortcuts:
path_to_fixtures: "./src/Path/ToYourBundle/DataFixtures"
E.g. the normal command to watch the assets, (*4)
php app/console assetic:dump --watch
Same command with DevShortcutsBundle would be:, (*5)
php app/console dev aw or sf dev aw
sf is an alias for php app/console. This alias needs to be configured by you. If you are using a linux distribution just edit .bash_aliases in you home folder or create it if it doesn't exist.
You only need to add a line as the following:, (*6)
alias sf="php app/console"
Or if you want the alias to point to a specific project:, (*7)
alias sf="php /path/to/your/symfony-project/app/console"
For Windows it's different. Plain DOS doesn't have support for aliases. You can use 4dos / 4nt, Cygwin or something similar to setup aliases., (*8)
The full list of Shortcuts you can use:, (*9)
| Shortcut | Original command | Usage |
|---|---|---|
| cc | cache:clear | Clear cache |
| ai | assets:install | Install assets |
| ad | assetic:dump | Dump assets |
| aw | assetic:dump --watch | Watch assets |
| a | Install & dump assets (ai + ad combination) | |
| dd | doctrine:database:drop --force | Drop database |
| dc | doctrine:database:create | Create database |
| sd | doctrine:schema:drop --force | Drop database schema |
| sc | doctrine:schema:create | Create database schema |
| dform | doctrine:fixtures:load --fixtures=./src/BundlePath/DataFixtures/ORM | Load ORM DataFixtures |
| dfenv | doctrine:fixtures:load --append --fixtures=./src/BundleName/DataFixtures/dev | Load environment related DataFixtures |
| d | Reloads the database: Drop database scheme, create scheme, load orm + env data fixtures (sd, sc, dform, dfenv shortcut combination) | |
You can also use sf dev --help to get the full list of commands., (*10)
Bundle for symfony2 console command shortcuts.
MIT
development shortcuts console command