/
Manager.php
56 lines (43 loc) · 1.35 KB
/
Manager.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
<?php
namespace Concrete\Core\Support;
use Illuminate\Contracts\Container\Container;
class Manager extends \Illuminate\Support\Manager
{
protected $defaultDriver;
/**
* @var Container
*/
protected $app;
public function __construct(Container $container)
{
parent::__construct($container);
$this->app = $container;
}
protected function createDriver($driver)
{
// Note –this overrides the laravel createDriver because we do Concrete
// camelcasing magic.
$method = 'create'.camelcase($driver).'Driver';
// We'll check to see if a creator method exists for the given driver. If not we
// will check for a custom driver creator, which allows developers to create
// drivers using their own customized driver creator Closure to create it.
if (isset($this->customCreators[$driver])) {
return $this->callCustomCreator($driver);
} elseif (method_exists($this, $method)) {
return $this->$method();
}
throw new \InvalidArgumentException("Driver [$driver] not supported.");
}
/**
* Get the default driver name.
*
* @return string
*/
public function getDefaultDriver()
{
if ($this->defaultDriver) {
return $this->defaultDriver;
}
return null;
}
}