Skip to content

Commit

Permalink
Resolved #8, More flexible __construct
Browse files Browse the repository at this point in the history
  • Loading branch information
dusta authored Sep 25, 2018
1 parent 069865b commit d06cefa
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions src/Storage.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,17 +44,21 @@ class Storage
*
* @param \Dframe\FileStorage\Drivers\DatabaseDriverInterface $driver
*/
public function __construct($driver = null)
public function __construct($driver = null, $config = null, $router = true)
{
$this->driver = $driver;

//Default
//$configFileStorage = Config::load('config', 'app/Libs/Plugins/fileStorage');
$configFileStorage = Config::load('fileStorage');
if (is_null($config)) {
$configFileStorage = Config::load('fileStorage');
$adapters = $configFileStorage->get('adapters', []);
} else {
$adapters = $config['adapters'];
}

$adapters = $configFileStorage->get('adapters', []);
$this->manager = new MountManager($adapters);
$this->router = new Router();
if ($router === true) {
$this->router = new Router();
}
}

/**
Expand Down

0 comments on commit d06cefa

Please sign in to comment.