Skip to content

Commit

Permalink
Merge pull request #18 from MatthiasDeWinter/master
Browse files Browse the repository at this point in the history
add only-db option
  • Loading branch information
freekmurze committed Mar 18, 2015
2 parents 6b555ff + 8b36be0 commit 6ac2c15
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions src/Commands/BackupCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
use Spatie\Backup\BackupHandlers\Database\DatabaseBackupHandler;
use Spatie\Backup\BackupHandlers\Files\FilesBackupHandler;
use Illuminate\Support\Facades\Storage;
use Symfony\Component\Console\Input\InputOption;
use ZipArchive;

class BackupCommand extends Command
Expand Down Expand Up @@ -73,6 +74,11 @@ protected function getAllFilesToBeBackedUp()
$this->comment('Database dumped');
}

if($this->option('only-db'))
{
return $files;
}

$this->comment('Determining which files should be backed up...');
$fileBackupHandler = app()->make(FilesBackupHandler::class)
->setIncludedFiles(config('laravel-backup.source.files.include'))
Expand Down Expand Up @@ -175,4 +181,16 @@ protected function getBackupDestinationFileName()
{
return config('laravel-backup.destination.path').'/'.date('YmdHis').'.zip';
}

/**
* Get the console command options.
*
* @return array
*/
protected function getOptions()
{
return [
['only-db', null, InputOption::VALUE_NONE, 'Only backup the database.'],
];
}
}

0 comments on commit 6ac2c15

Please sign in to comment.