From 81ac3d9c21c68ee9127164b6c366389ee0ccabd5 Mon Sep 17 00:00:00 2001 From: root Date: Wed, 5 Apr 2017 19:59:35 +0000 Subject: [PATCH] add Yii2 project type to dep init --- CHANGELOG.md | 1 + src/Console/InitCommand.php | 4 ++++ .../Template/Yii2AdvancedAppTemplate.php | 22 +++++++++++++++++++ .../Template/Yii2BasicAppTemplate.php | 22 +++++++++++++++++++ 4 files changed, 49 insertions(+) create mode 100644 src/Initializer/Template/Yii2AdvancedAppTemplate.php create mode 100644 src/Initializer/Template/Yii2BasicAppTemplate.php diff --git a/CHANGELOG.md b/CHANGELOG.md index 7bde1a59..ea7cd58c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,7 @@ [v4.3.0...master](https://github.com/deployphp/deployer/compare/v4.3.0...master) ### Added +- Added console init template for Yii2 basic and advanced receipe [#1146](https://github.com/deployphp/deployer/pull/1146) - Added `use_atomic_symlink` and `use_relative_symlink` option [14a8f8](https://github.com/deployphp/deployer/pull/1092/commits/14a8f8f9c4ebbc7da45c2b6b7c3c00a51b563ccf) - Added `Ssh\Client` [#1092](https://github.com/deployphp/deployer/pull/1092) - Added host ranges [#1092](https://github.com/deployphp/deployer/pull/1092) diff --git a/src/Console/InitCommand.php b/src/Console/InitCommand.php index 6374de26..e0422e32 100644 --- a/src/Console/InitCommand.php +++ b/src/Console/InitCommand.php @@ -15,6 +15,8 @@ use Deployer\Initializer\Template\DrupalTemplate; use Deployer\Initializer\Template\LaravelTemplate; use Deployer\Initializer\Template\SymfonyTemplate; use Deployer\Initializer\Template\YiiTemplate; +use Deployer\Initializer\Template\Yii2BasicAppTemplate; +use Deployer\Initializer\Template\Yii2AdvancedAppTemplate; use Deployer\Initializer\Template\ZendTemplate; use Symfony\Component\Console\Command\Command; use Symfony\Component\Console\Input\InputInterface; @@ -107,6 +109,8 @@ class InitCommand extends Command $initializer->addTemplate('Laravel', new LaravelTemplate()); $initializer->addTemplate('Symfony', new SymfonyTemplate()); $initializer->addTemplate('Yii', new YiiTemplate()); + $initializer->addTemplate('Yii2 Basic App', new Yii2BasicAppTemplate()); + $initializer->addTemplate('Yii2 Advanced App', new Yii2AdvancedAppTemplate()); $initializer->addTemplate('Zend Framework', new ZendTemplate()); $initializer->addTemplate('CakePHP', new CakeTemplate()); $initializer->addTemplate('CodeIgniter', new CodeIgniterTemplate()); diff --git a/src/Initializer/Template/Yii2AdvancedAppTemplate.php b/src/Initializer/Template/Yii2AdvancedAppTemplate.php new file mode 100644 index 00000000..573dbf85 --- /dev/null +++ b/src/Initializer/Template/Yii2AdvancedAppTemplate.php @@ -0,0 +1,22 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Deployer\Initializer\Template; + +/** + * Generate a Yii deployer configuration. + * + * @author Anton Medvedev + * @codeCoverageIgnore + */ +class Yii2AdvancedAppTemplate extends FrameworkTemplate +{ + protected function getRecipe() + { + return 'yii2-app-advanced'; + } +} diff --git a/src/Initializer/Template/Yii2BasicAppTemplate.php b/src/Initializer/Template/Yii2BasicAppTemplate.php new file mode 100644 index 00000000..53727378 --- /dev/null +++ b/src/Initializer/Template/Yii2BasicAppTemplate.php @@ -0,0 +1,22 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Deployer\Initializer\Template; + +/** + * Generate a Yii2 app basic deployer configuration. + * + * @author Anton Medvedev + * @codeCoverageIgnore + */ +class Yii2BasicAppTemplate extends FrameworkTemplate +{ + protected function getRecipe() + { + return 'yii2-app-basic'; + } +}