Skip to content
This repository was archived by the owner on Feb 3, 2022. It is now read-only.

Commit aaeb9d1

Browse files
committed
Merge branch 'release/v1.3.2'
2 parents c58d8fe + b19c276 commit aaeb9d1

File tree

9 files changed

+153
-82
lines changed

9 files changed

+153
-82
lines changed

.travis.yml

Lines changed: 0 additions & 7 deletions
This file was deleted.

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ Working on Magento client sites typically requires a fresh copy of the productio
1717
Download the phar.
1818

1919
```
20-
wget https://github.com/meanbee/magedbm/releases/download/v.1.3.0/magedbm.phar
20+
wget https://s3-eu-west-1.amazonaws.com/magedbm-releases/magedbm.phar
2121
```
2222

2323
Make sure it's executable

src/Meanbee/Magedbm/Application.php

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,16 @@
77
use Meanbee\Magedbm\Command\ListCommand;
88
use Meanbee\Magedbm\Command\PutCommand;
99

10-
class Application extends \Symfony\Component\Console\Application {
10+
class Application extends \Symfony\Component\Console\Application
11+
{
1112

1213
const APP_NAME = "Magedbm";
1314
const APP_VERSION = "1.0.0";
1415

1516
protected $autoloader;
1617

17-
public function __construct($autoloader = null) {
18+
public function __construct($autoloader = null)
19+
{
1820
parent::__construct(self::APP_NAME, self::APP_VERSION);
1921

2022
if ($autoloader !== null) {
@@ -28,11 +30,13 @@ public function __construct($autoloader = null) {
2830
$this->add(new PutCommand());
2931
}
3032

31-
public function getAutoloader() {
33+
public function getAutoloader()
34+
{
3235
return $this->autoloader;
3336
}
3437

35-
public function setAutoloader($autoloader) {
38+
public function setAutoloader($autoloader)
39+
{
3640
$this->autoloader = $autoloader;
3741

3842
return $this;

src/Meanbee/Magedbm/Command/BaseCommand.php

Lines changed: 23 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,15 @@
99
use Symfony\Component\Console\Input\InputInterface;
1010
use Symfony\Component\Console\Output\OutputInterface;
1111

12-
class BaseCommand extends Command {
12+
class BaseCommand extends Command
13+
{
1314

14-
const AWS_DIR_PATH = '/.aws';
15-
const AWS_CREDENTIALS_PATH = '/.aws/credentials';
16-
const AWS_CONFIG_PATH = '/.aws/config';
17-
const APP_DIR_PATH = '/.magedbm';
18-
const APP_CONFIG_PATH = '/.magedbm/config';
19-
const TMP_PATH = '/tmp/magedbm';
15+
const AWS_DIR_PATH = '/.aws';
16+
const AWS_CREDENTIALS_PATH = '/.aws/credentials';
17+
const AWS_CONFIG_PATH = '/.aws/config';
18+
const APP_DIR_PATH = '/.magedbm';
19+
const APP_CONFIG_PATH = '/.magedbm/config';
20+
const TMP_PATH = '/tmp/magedbm';
2021

2122
/** @var InputInterface $input */
2223
protected $input;
@@ -38,7 +39,8 @@ class BaseCommand extends Command {
3839
*
3940
* @return $this
4041
*/
41-
public function setInput(InputInterface $input) {
42+
public function setInput(InputInterface $input)
43+
{
4244
$this->input = $input;
4345

4446
return $this;
@@ -49,7 +51,8 @@ public function setInput(InputInterface $input) {
4951
*
5052
* @return InputInterface
5153
*/
52-
public function getInput() {
54+
public function getInput()
55+
{
5356
return $this->input;
5457
}
5558

@@ -60,7 +63,8 @@ public function getInput() {
6063
*
6164
* @return $this
6265
*/
63-
public function setOutput(OutputInterface $output) {
66+
public function setOutput(OutputInterface $output)
67+
{
6468
$this->output = $output;
6569

6670
return $this;
@@ -71,7 +75,8 @@ public function setOutput(OutputInterface $output) {
7175
*
7276
* @return OutputInterface
7377
*/
74-
public function getOutput() {
78+
public function getOutput()
79+
{
7580
return $this->output;
7681
}
7782

@@ -114,7 +119,7 @@ public function getS3Client($region = null)
114119
try {
115120
// Upload to S3.
116121
$this->s3Client = S3Client::factory(array(
117-
'region' => $region
122+
'region' => $region
118123
));
119124
} catch (CredentialsException $e) {
120125
$this->getOutput()->writeln('<error>AWS credentials failed</error>');
@@ -137,7 +142,7 @@ public function getConfig(InputInterface $input)
137142
$config = $iniReader->readFile($this->getAppConfigPath());
138143
$this->config = $config['default'];
139144

140-
foreach($input->getOptions() as $option => $value) {
145+
foreach ($input->getOptions() as $option => $value) {
141146
if ($value) {
142147
$this->config[$option] = $value;
143148
}
@@ -152,10 +157,11 @@ public function getConfig(InputInterface $input)
152157
}
153158

154159
/**
155-
* @param InputInterface $input
160+
* @param InputInterface $input
156161
* @param OutputInterface $output
157162
*/
158-
protected function initialize(InputInterface $input, OutputInterface $output) {
163+
protected function initialize(InputInterface $input, OutputInterface $output)
164+
{
159165
parent::initialize($input, $output);
160166

161167
$this->setInput($input);
@@ -201,7 +207,8 @@ protected function getAwsConfigPath()
201207
/**
202208
* Check for AWS Credentials
203209
*/
204-
protected function validateConfiguration() {
210+
protected function validateConfiguration()
211+
{
205212
if ($this instanceof ConfigureCommand) {
206213
return true;
207214
}

src/Meanbee/Magedbm/Command/ConfigureCommand.php

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ protected function configure()
5454
/**
5555
* Execute the command.
5656
*
57-
* @param InputInterface $input
57+
* @param InputInterface $input
5858
* @param OutputInterface $output
5959
*
6060
* @throws \Exception
@@ -73,7 +73,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
7373
mkdir($this->getAwsDirPath());
7474
}
7575

76-
if(!is_writeable($this->getAwsDirPath())) {
76+
if (!is_writeable($this->getAwsDirPath())) {
7777
$this->getOutput()->writeln('<error>Unable to write AWS credentials. Please manually add to ~/.aws/credentials');
7878
exit;
7979
}
@@ -90,7 +90,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
9090
if ($input->getOption('key') && $input->getOption('secret')) {
9191
$credentials = array(
9292
'default' => array(
93-
'aws_access_key_id' => $input->getOption('key'),
93+
'aws_access_key_id' => $input->getOption('key'),
9494
'aws_secret_access_key' => $input->getOption('secret')
9595
)
9696
);
@@ -136,8 +136,9 @@ protected function execute(InputInterface $input, OutputInterface $output)
136136
public function isConfigured()
137137
{
138138
if (file_exists($this->getAwsCredentialsPath()) && file_exists($this->getAwsConfigPath()) &&
139-
file_exists($this->getAppConfigPath())) {
140-
return true;
139+
file_exists($this->getAppConfigPath())
140+
) {
141+
return true;
141142
}
142143

143144
return false;

src/Meanbee/Magedbm/Command/DeleteCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ protected function configure()
4646
/**
4747
* Execute the command.
4848
*
49-
* @param InputInterface $input
49+
* @param InputInterface $input
5050
* @param OutputInterface $output
5151
*
5252
* @throws \Exception

src/Meanbee/Magedbm/Command/GetCommand.php

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ protected function configure()
6363
/**
6464
* Execute the command.
6565
*
66-
* @param InputInterface $input
66+
* @param InputInterface $input
6767
* @param OutputInterface $output
6868
*
6969
* @throws \Exception
@@ -78,7 +78,8 @@ protected function execute(InputInterface $input, OutputInterface $output)
7878
$output,
7979
'<question>Are you sure you wish to overwrite local database [y/n]?</question>',
8080
false
81-
)) {
81+
)
82+
) {
8283
return;
8384
}
8485
}
@@ -151,7 +152,7 @@ protected function downloadBackup($file, $s3, $config, $input)
151152
try {
152153
$s3->getObject(array(
153154
'Bucket' => $config['bucket'],
154-
'Key' => $input->getArgument('name') . '/' . $file,
155+
'Key' => $input->getArgument('name') . '/' . $file,
155156
'SaveAs' => $this->getFilePath($file)
156157
));
157158
} catch (NoSuchKeyException $e) {
@@ -183,8 +184,8 @@ protected function backupImport($file, $input)
183184
}
184185

185186
$params = array(
186-
'filename' => $this->getFilePath($file),
187-
'--compression' => 'gzip',
187+
'filename' => $this->getFilePath($file),
188+
'--compression' => 'gzip',
188189
);
189190

190191
if ($input->getOption('drop-tables')) {

src/Meanbee/Magedbm/Command/ListCommand.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ protected function configure()
4242
/**
4343
* Execute the command.
4444
*
45-
* @param InputInterface $input
45+
* @param InputInterface $input
4646
* @param OutputInterface $output
4747
*
4848
* @throws \Exception
@@ -61,7 +61,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
6161

6262
foreach ($results as $item) {
6363
$itemKeyChunks = explode('/', $item['Key']);
64-
$this->getOutput()->writeln(sprintf('%s %dMB', array_pop($itemKeyChunks) , $item['Size'] / 1024 / 1024));
64+
$this->getOutput()->writeln(sprintf('%s %dMB', array_pop($itemKeyChunks), $item['Size'] / 1024 / 1024));
6565
}
6666

6767
if (!$results->count()) {

0 commit comments

Comments
 (0)