Skip to content
This repository has been archived by the owner on Aug 20, 2021. It is now read-only.

Commit

Permalink
adds compatibility with the BsbFlysystem Manager
Browse files Browse the repository at this point in the history
  • Loading branch information
basz committed May 15, 2016
1 parent 96cf37d commit b6a4888
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,8 @@ return [
/*
* Container service name of the Flysystem filesystem used to persisted dumps
*
* @since 0.2.0 this may also be the name of a filesystem as it has been registered to the BsbFlysystem Manager
*/
// 'filesystem' => 'Container/Name/Of/FilesystemService',
Expand Down
3 changes: 2 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@
"zendframework/zend-stratigility": "^1.0"
},
"suggest": {
"bushbaby/doctrine-managerregistry-servicemanager": ""
"bushbaby/flysystem": "Zend Framework 2 module bridge for flysystem filesystem",
"bushbaby/doctrine-managerregistry-servicemanager": "An implementation of Doctrine's ManagerRegistry for the ZendFramework ServiceManager"
},
"require-dev": {
"phpunit/phpunit": "^4.0",
Expand Down
7 changes: 6 additions & 1 deletion src/Container/MysqlBackupServiceFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

namespace BsbFlysystemMysqlBackup\Container;

use BsbFlysystem\Service\FilesystemManager;
use BsbFlysystemMysqlBackup\Option\MysqlDumperOptions;
use BsbFlysystemMysqlBackup\Option\StorageOptions;
use BsbFlysystemMysqlBackup\Service\MysqlBackupService;
Expand Down Expand Up @@ -29,7 +30,11 @@ public function __invoke(ContainerInterface $container)
$dumperOptions = $container->get(MysqlDumperOptions::class);

/** @var Filesystem $filesystem */
$filesystem = $container->get($storageOptions->getFilesystem());
if ($container->has(FilesystemManager::class)) {
$filesystem = $container->get(FilesystemManager::class)->get($storageOptions->getFilesystem());
} else {
$filesystem = $container->get($storageOptions->getFilesystem());
}

return new MysqlBackupService($dumper, $filesystem, $storageOptions, $dumperOptions);
}
Expand Down

0 comments on commit b6a4888

Please sign in to comment.