forked from featherforums/feather
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMigratorManager.php
More file actions
77 lines (67 loc) · 1.35 KB
/
Copy pathMigratorManager.php
File metadata and controls
77 lines (67 loc) · 1.35 KB
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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
<?php namespace Feather\Migrator;
use Illuminate\Support\Manager;
class MigratorManager extends Manager {
/**
* Database connection instance.
*
* @var Illuminate\Database\Connection
*/
protected $connection;
/**
* Migrator is active.
*
* @var bool
*/
protected $active;
/**
* Create a new manager instance.
*
* @param Illuminate\Foundation\Application $app
* @param Illuminate\Database\Connection $connection
* @param bool $active
* @return void
*/
public function __construct($app, $connection, $active = true)
{
$this->app = $app;
$this->connection = $connection;
$this->active = $active;
}
/**
* Get the default migrator driver name.
*
* @return string
*/
protected function getDefaultDriver()
{
return $this->app['config']->get('feather::migrator.driver');
}
/**
* Call a custom driver creator.
*
* @param string $driver
* @return mixed
*/
protected function callCustomCreator($driver)
{
return $this->customCreators[$driver]($this->app, $this->connection);
}
/**
* Create a new flux driver instance.
*
* @return Feather\Migrator\Drivers\FluxDriver
*/
protected function createFluxDriver()
{
return new Drivers\FluxDriver($this->app);
}
/**
* Determine if the migrator is active.
*
* @return bool
*/
public function isActive()
{
return $this->active;
}
}