Skip to content

Commit

Permalink
0.1.5
Browse files Browse the repository at this point in the history
  • Loading branch information
gvozdb committed Jul 13, 2020
1 parent 728d9f2 commit f939caf
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 4 deletions.
8 changes: 6 additions & 2 deletions src/Backup.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@

class Backup
{
/** @var array $config */
/**
* @var array $config
*/
protected $config = [];

/**
Expand Down Expand Up @@ -38,10 +40,12 @@ public function run(array $users = [])
//
if ($dir = scandir($this->config['path']['users'])) {
foreach ($dir as $k) {
if (in_array($k, ['.', '..']) || (!empty($users) && !in_array($k, $users))) {
if (in_array($k, ['.', '..'], true) || (!empty($users) && !in_array($k, $users, true))) {
continue;
}

$path = $this->config['path']['users'] . $k;

$config = new Config\Load($path . '/dumper.yaml', [
'src' => $path,
'dest' => $this->config['path']['tmp'] . $prefix . 'www-' . $k,
Expand Down
6 changes: 6 additions & 0 deletions src/Compressor/AbstractCompressor.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,13 @@ protected function setFilePath($filepath)
$this->filepath = $filepath;
}

/**
* @return mixed
*/
abstract public function compress();

/**
* @return mixed
*/
abstract protected function excludePrepare();
}
4 changes: 2 additions & 2 deletions src/Compressor/Zip.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public function __construct(array $config = [])
}

/**
*
* @return mixed|void
*/
public function compress()
{
Expand All @@ -45,7 +45,7 @@ public function compress()
}

/**
*
* @return array|mixed|string
*/
protected function excludePrepare()
{
Expand Down
1 change: 1 addition & 0 deletions src/Config/Validate.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
class Validate
{
/**
* Validate constructor.
*/
public function __construct()
{
Expand Down
3 changes: 3 additions & 0 deletions src/Database/AbstractDatabase.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,5 +48,8 @@ protected function setFilePath($filepath)
$this->filepath = $filepath;
}

/**
* @return mixed
*/
abstract public function export();
}
1 change: 1 addition & 0 deletions src/Database/Mysql.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ public function __construct(array $config = [])
}

/**
* @return mixed|void
*/
public function export()
{
Expand Down
2 changes: 2 additions & 0 deletions src/Path/AbstractPath.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,8 @@ public function isEnabled()
* @param string $src
* @param string $dest
* @param array $exclude
*
* @throws \Exception
*/
protected function compress($src, $dest, array $exclude = [])
{
Expand Down

0 comments on commit f939caf

Please sign in to comment.