/** * @return void */ private function validateArguments() { $root = $this->filesystems->getConfig($this->option('source'), 'root'); $this->info('Just to be sure...'); $this->info(sprintf('Do you want to restore the backup <comment>%s</comment> from <comment>%s</comment> to database <comment>%s</comment> and decompress it from <comment>%s</comment>?', $root . $this->option('sourcePath'), $this->option('source'), $this->option('database'), $this->option('compression'))); $this->line(''); $confirmation = $this->confirm('Are these correct? [Y/n]'); if (!$confirmation) { $this->reaskArguments(); } }
/** * Register the filesystem provider. * * @return void */ private function registerFilesystemProvider() { $this->app->bind('BigName\\BackupManager\\Filesystems\\FilesystemProvider', function ($app) { $provider = new Filesystems\FilesystemProvider(new Config($app['config']['backup-manager::storage'])); $provider->add(new Filesystems\Awss3Filesystem()); $provider->add(new Filesystems\DropboxFilesystem()); $provider->add(new Filesystems\FtpFilesystem()); $provider->add(new Filesystems\LocalFilesystem()); $provider->add(new Filesystems\RackspaceFilesystem()); $provider->add(new Filesystems\SftpFilesystem()); return $provider; }); }
/** * @throws \BigName\BackupManager\Config\ConfigFieldNotFound * @throws \BigName\BackupManager\Config\ConfigNotFoundForConnection * @return void */ private function validateArguments() { $root = $this->filesystems->getConfig($this->option('destination'), 'root'); $this->info('Just to be sure...'); $this->info(sprintf('Do you want to create a backup of <comment>%s</comment>, store it on <comment>%s</comment> at <comment>%s</comment> and compress it to <comment>%s</comment>?', $this->option('database'), $this->option('destination'), $root . $this->option('destinationPath'), $this->option('compression'))); $this->line(''); $confirmation = $this->confirm('Are these correct? [Y/n]'); if (!$confirmation) { $this->reaskArguments(); } }
/** * @return void */ private function validateArguments() { $root = $this->filesystems->getConfig($this->option('source'), 'root'); $this->info('Just to be sure...'); $this->info(sprintf('Do you want to list files from <comment>%s</comment> on <comment>%s</comment>?', $root . $this->option('path'), $this->option('source'))); $this->line(''); $confirmation = $this->confirm('Are these correct? [Y/n]'); if (!$confirmation) { $this->reaskArguments(); } }
/** * @param $name * @throws \BigName\BackupManager\Config\ConfigFieldNotFound * @throws \BigName\BackupManager\Config\ConfigNotFoundForConnection * @return string */ protected function getRootPath($name) { $path = $this->filesystems->getConfig($name, 'root'); return preg_replace('/\\/$/', '', $path); }
<?php // path to composer autoloader require '../../vendor/autoload.php'; use BigName\BackupManager\Config\Config; use BigName\BackupManager\Filesystems; use BigName\BackupManager\Databases; use BigName\BackupManager\Compressors; use BigName\BackupManager\Manager; // build providers $filesystems = new Filesystems\FilesystemProvider(Config::fromPhpFile('config/storage.php')); $filesystems->add(new Filesystems\Awss3Filesystem()); $filesystems->add(new Filesystems\DropboxFilesystem()); $filesystems->add(new Filesystems\FtpFilesystem()); $filesystems->add(new Filesystems\LocalFilesystem()); $filesystems->add(new Filesystems\RackspaceFilesystem()); $filesystems->add(new Filesystems\SftpFilesystem()); $databases = new Databases\DatabaseProvider(Config::fromPhpFile('config/database.php')); $databases->add(new Databases\MysqlDatabase()); $databases->add(new Databases\PostgresqlDatabase()); $compressors = new Compressors\CompressorProvider(); $compressors->add(new Compressors\GzipCompressor()); $compressors->add(new Compressors\NullCompressor()); // build manager return new Manager($filesystems, $databases, $compressors);