Esempio n. 1
0
 /**
  * Execute the backup.
  *
  * @param  \phpbu\App\Configuration\Backup $conf
  * @param  \phpbu\App\Backup\Target        $target
  * @throws \Exception
  */
 protected function executeSource(Configuration\Backup $conf, Target $target)
 {
     $this->result->backupStart($conf);
     $source = $this->factory->createSource($conf->getSource()->type, $conf->getSource()->options);
     $runner = $this->factory->createRunner('source');
     $runner->run($source, $target, $this->result);
     $this->result->backupEnd($conf);
 }
Esempio n. 2
0
 /**
  * Execute the backup.
  *
  * @param  \phpbu\App\Configuration\Backup $conf
  * @param  \phpbu\App\Backup\Target        $target
  * @throws \Exception
  */
 protected function executeSource(Configuration\Backup $conf, Target $target)
 {
     $this->result->backupStart($conf);
     /* @var \phpbu\App\Runner\Source $runner */
     $source = $this->factory->createSource($conf->getSource()->type, $conf->getSource()->options);
     $runner = $this->factory->createRunner('source');
     $runner->run($source, $target, $this->result, $this->configuration->isSimulation());
     $this->result->backupEnd($conf);
 }
Esempio n. 3
0
 /**
  * Tests Factory::createSource
  *
  * @expectedException \phpbu\App\Exception
  */
 public function testCreateSourceThatIsNone()
 {
     Factory::register('source', 'nothing', '\\phpbu\\App\\phpbuAppFactoryTestNothing', true);
     $factory = new Factory();
     $factory->createSource('nothing');
     $this->assertFalse(true, 'Exception should be thrown');
 }