/** * Get the profile registry. * * @param array $config * * @return \Zenstruck\Backup\ProfileRegistry */ protected function getProfileRegistry(array $config) : ProfileRegistry { $registry = new ProfileRegistry(); foreach (array_get($config, 'profiles') as $name => $profile) { $profile = $this->builder->create($name, array_get($profile, 'scratch_dir', storage_path('backups')), array_get($profile, 'processor'), array_get($profile, 'namer'), array_get($profile, 'sources'), array_get($profile, 'destinations')); $registry->add($profile); } return $registry; }
/** * Execute the backup. * * @param bool $clear * * @return void */ public function run(bool $clear = false) { $profile = $this->registry->get($this->getProfile()); $this->executor->backup($profile, $clear); }