public function __construct(Runner $runner)
 {
     // Register an rsync source backup scheme
     Factory::register('source', 'rsync', RsyncSource::class);
     // Load the configuration values
     $this->config = config('backups/' . $this->identifier);
     $this->runner = $runner;
     parent::__construct();
 }
 /**
  * Creates a phpbu configuration.
  *
  * @return \phpbu\App\Configuration
  */
 protected function createConfiguration()
 {
     // check if a phpbu xml/json config file is configured
     $phpbuConfigFile = $this->configProxy->get('phpbu.phpbu');
     if (!empty($phpbuConfigFile)) {
         // load xml or json configurations
         $configLoader = PhpbuConfigLoaderFactory::createLoader($phpbuConfigFile);
         $configuration = $configLoader->getConfiguration();
     } else {
         $this->validateConfig();
         // no phpbu config so translate the laravel settings
         $translator = new Translator();
         $configuration = $translator->translate($this->configProxy);
         // in laravel mode we sync everything using the Laravel Filesystems
         PhpbuFactory::register('sync', 'laravel-storage', '\\phpbu\\Laravel\\Backup\\Sync\\LaravelStorage');
     }
     return $configuration;
 }
Exemple #3
0
 /**
  * Tests Factory::register
  *
  * @depends testRegisterExistingCheck
  */
 public function testRegisterExistingCheckForce()
 {
     Factory::register('check', 'sizemin', '\\phpbu\\App\\phpbuAppFactoryTestCheck', true);
     $factory = new Factory();
     $dummy = $factory->create('check', 'sizemin');
     $this->assertEquals(get_class($dummy), 'phpbu\\App\\phpbuAppFactoryTestCheck', 'Factory should create dummy object');
 }
 public function register()
 {
     // Allow PHPBU to use our defined Laravel filesystems
     Factory::register('sync', 'laravel-storage', LaravelStorage::class, true);
 }