public static function checkKey($key = null, $file = null) { if (Config::validate() && !empty($key) && !empty($file)) { $config = Config::getFile($file); if (!empty($config[$key])) { return true; } } return false; }
protected function execute(InputInterface $input, OutputInterface $output) { // Database data. $databases = Config::getFile('database'); foreach ($databases as $profile => $data) { $dbs[] = [$profile, $data['type'], $data['database'], $data['user'], $data['host'], $data['port']]; } // Output table. $table = new Table($output); $table->setHeaders(['Profile', 'Type', 'Database', 'Username', 'Server', 'Port'])->setRows($dbs); $table->render(); }
public function __construct() { // Filesystems $storage_config = Config::getFile('storage'); $this->filesystems = new Filesystems\FilesystemProvider(new BackupManagerConfig($storage_config)); $this->filesystems->add(new Filesystems\LocalFilesystem()); $this->filesystems->add(new Filesystems\Awss3Filesystem()); $this->filesystems->add(new Filesystems\DropboxFilesystem()); $this->filesystems->add(new OVH()); // Databases $db_config = Config::getFile('database'); $this->databases = new Databases\DatabaseProvider(new BackupManagerConfig($db_config)); $this->databases->add(new Databases\MysqlDatabase()); $this->databases->add(new Databases\PostgresqlDatabase()); // Compressors $this->compressors = new Compressors\CompressorProvider(); $this->compressors->add(new Compressors\GzipCompressor()); $this->compressors->add(new Compressors\NullCompressor()); $this->compressors->add(new SevenZip()); $this->compressors->add(new SevenZipNull()); $this->compressors->add(new SevenZipUltra()); // Shell processor. $this->shellProcessor = $this->getShellProcessor(); }