-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
igor
committed
Oct 18, 2017
1 parent
0cf59cd
commit 0cd6fbf
Showing
6 changed files
with
166 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<?php | ||
/** | ||
* @author Igor Nikolaev <[email protected]> | ||
* @copyright Copyright (c) 2017, Darvin Studio | ||
* @link https://www.darvin-studio.ru | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
namespace Darvin\DatabaserBundle; | ||
|
||
use Symfony\Component\HttpKernel\Bundle\Bundle; | ||
|
||
/** | ||
* Databaser bundle | ||
*/ | ||
class DarvinDatabaserBundle extends Bundle | ||
{ | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
<?php | ||
/** | ||
* @author Igor Nikolaev <[email protected]> | ||
* @copyright Copyright (c) 2017, Darvin Studio | ||
* @link https://www.darvin-studio.ru | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
namespace Darvin\DatabaserBundle\DependencyInjection; | ||
|
||
use Symfony\Component\Config\Definition\Builder\TreeBuilder; | ||
use Symfony\Component\Config\Definition\ConfigurationInterface; | ||
|
||
/** | ||
* This is the class that validates and merges configuration from your app/config files. | ||
* | ||
* To learn more see {@link http://symfony.com/doc/current/cookbook/bundles/configuration.html} | ||
*/ | ||
class Configuration implements ConfigurationInterface | ||
{ | ||
/** | ||
* {@inheritdoc} | ||
*/ | ||
public function getConfigTreeBuilder() | ||
{ | ||
$treeBuilder = new TreeBuilder(); | ||
// $rootNode = $treeBuilder->root('darvin_databaser'); | ||
|
||
// Here you should define the parameters that are allowed to | ||
// configure your bundle. See the documentation linked above for | ||
// more information on that topic. | ||
|
||
return $treeBuilder; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
<?php | ||
/** | ||
* @author Igor Nikolaev <[email protected]> | ||
* @copyright Copyright (c) 2017, Darvin Studio | ||
* @link https://www.darvin-studio.ru | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
namespace Darvin\DatabaserBundle\DependencyInjection; | ||
|
||
use Symfony\Component\Config\FileLocator; | ||
use Symfony\Component\DependencyInjection\ContainerBuilder; | ||
use Symfony\Component\DependencyInjection\Loader; | ||
use Symfony\Component\HttpKernel\DependencyInjection\Extension; | ||
|
||
/** | ||
* This is the class that loads and manages your bundle configuration. | ||
* | ||
* @link http://symfony.com/doc/current/cookbook/bundles/extension.html | ||
*/ | ||
class DarvinDatabaserExtension extends Extension | ||
{ | ||
/** | ||
* {@inheritdoc} | ||
*/ | ||
public function load(array $configs, ContainerBuilder $container) | ||
{ | ||
// $configuration = new Configuration(); | ||
// $config = $this->processConfiguration($configuration, $configs); | ||
|
||
$loader = new Loader\YamlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config')); | ||
$loader->load('command.yml'); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
DarvinDatabaserBundle | ||
===================== | ||
This bundle integrates "darvinstudio/databaser" with Symfony. | ||
|
||
## Usage | ||
|
||
### Pull database | ||
|
||
```shell | ||
$ /usr/bin/env php bin/console databaser:pull [-k|--key [KEY]] [-p|--password] [-P|--port [PORT]] <user@host> <project_path_remote> [<project_path_local>] | ||
``` | ||
Examples: | ||
```shell | ||
$ /usr/bin/env php bin/console databaser:pull [email protected] www/example.com | ||
$ /usr/bin/env php bin/console databaser:pull -P 123 [email protected] /var/www/example.com | ||
``` | ||
### Push database | ||
```shell | ||
$ /usr/bin/env php bin/console databaser:push [-k|--key [KEY]] [-p|--password] [-P|--port [PORT]] <user@host> <project_path_remote> [<project_path_local>] | ||
``` | ||
Examples: | ||
```shell | ||
$ /usr/bin/env php bin/console databaser:push [email protected] www/example.com | ||
$ /usr/bin/env php bin/console databaser:push -P 123 [email protected] /var/www/example.com | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
parameters: | ||
darvin_databaser.command.pull.class: Darvin\Databaser\Command\PullCommand | ||
darvin_databaser.command.pull.name: "databaser:pull" | ||
|
||
darvin_databaser.command.push.class: Darvin\Databaser\Command\PushCommand | ||
darvin_databaser.command.push.name: "databaser:push" | ||
|
||
services: | ||
darvin_databaser.command.pull: | ||
class: "%darvin_databaser.command.pull.class%" | ||
arguments: | ||
- "%darvin_databaser.command.pull.name%" | ||
tags: | ||
- { name: console.command } | ||
|
||
darvin_databaser.command.push: | ||
class: "%darvin_databaser.command.push.class%" | ||
arguments: | ||
- "%darvin_databaser.command.push.name%" | ||
tags: | ||
- { name: console.command } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
{ | ||
"name": "darvinstudio/darvin-databaser-bundle", | ||
"description": "This bundle integrates 'darvinstudio/databaser' with Symfony.", | ||
"keywords": ["database"], | ||
"type": "symfony-bundle", | ||
"license": "MIT", | ||
"authors": [ | ||
{ | ||
"name": "Darvin Studio", | ||
"email": "[email protected]", | ||
"homepage": "https://www.darvin-studio.ru" | ||
} | ||
], | ||
"require": { | ||
"darvinstudio/darvin-databaser": "*" | ||
}, | ||
"autoload": { | ||
"psr-4": { "Darvin\\DatabaserBundle\\": "" } | ||
} | ||
} |