dev-master
9999999-devConfigure PHPStorm project (including Symfony2 plugin)
MIT
The Requires
- php >=5.4.0
- symfony/console ~2.6
- symfony/finder ~2.6
by Gunther Konig
symfony2 phpstorm configurator
Configure PHPStorm project (including Symfony2 plugin)
A tool to help configuring phpstorm projects (add excluded folders, enable symfony2 plugin, etc.), (*1)
$ composer global require gk/phpstorm-configurator:dev-master
make sure you have ~/.composer/vendor/bin
in your PATH
, (*2)
export PATH="$PATH:$HOME/.composer/vendor/bin"
phpstorm-configurator configure
Configures the currently working directory as a PHPStorm project. (The simple usage is useless, you'd better use pstorm .
), (*3)
phpstorm-configurator configure --exclude app/cache -exclude app/logs
or, using the shorthand options, (*4)
phpstorm-configurator configure -x app/cache -x app/logs
phpstorm-configurator configure --plugin symfony2
or, using the shorthand options, (*5)
phpstorm-configurator configure -p symfony2
This marks app/cache
and app/logs
as excluded and enables the Symfony2 plugin, (*6)
If you want to finetune the configuration of the project:, (*7)
#!/usr/bin/env php <?php require_once $_SERVER['HOME'] . "/.composer/vendor/autoload.php"; $projectDir = getcwd(); $configurator = new \Gk\PHPStormConfigurator\ProjectConfigurator($projectDir); /** * Exclude some folders */ $imlPlugin = $configurator->getPlugin('iml'); $imlPlugin ->addExcludeFolder('app/cache') ->addExcludeFolder('app/logs') ; /** * Configure the Symfony2 plugin (http://symfony2-plugin.espend.de/). * This also excludes the app/cache and app/logs directories */ $symfony2Plugin = $configurator->getPlugin('symfony2'); $symfony2Plugin ->addOption("directoryToApp", "app") ->addOption("pathToUrlGenerator", "app/cache/dev/adminDevUrlGenerator.php") ->addOption("pathToTranslation", "app/cache/dev/translations") ->addContainerFile("app/cache/dev/adminDevDebugProjectContainer.xml") ; /** * Add some files/directories to the default favorite list. * The directories must be traversed recursively, for each child PHPStorm requires an entry in workspace.xml * Adding directories with a large number of children can slow down your script. */ $workspacePlugin = $configurator->getPlugin('workspace'); $workspacePlugin ->addToFavorites($projectDir . '/dir1') ->addToFavorites($projectDir . '/file2') ; $configurator->writeConfig();
Configure PHPStorm project (including Symfony2 plugin)
MIT
symfony2 phpstorm configurator