|
1
|
|
|
<?php |
|
2
|
|
|
/** |
|
3
|
|
|
* This file is part of the O2System Framework package. |
|
4
|
|
|
* |
|
5
|
|
|
* For the full copyright and license information, please view the LICENSE |
|
6
|
|
|
* file that was distributed with this source code. |
|
7
|
|
|
* |
|
8
|
|
|
* @author Steeve Andrian Salim |
|
9
|
|
|
* @copyright Copyright (c) Steeve Andrian Salim |
|
10
|
|
|
*/ |
|
11
|
|
|
// ------------------------------------------------------------------------ |
|
12
|
|
|
|
|
13
|
|
|
namespace O2System\Framework\Models\Sql; |
|
14
|
|
|
|
|
15
|
|
|
// ------------------------------------------------------------------------ |
|
16
|
|
|
|
|
17
|
|
|
/** |
|
18
|
|
|
* Class Migration |
|
19
|
|
|
* @package O2System\Framework\Models\Sql |
|
20
|
|
|
*/ |
|
21
|
|
|
class Migration |
|
22
|
|
|
{ |
|
23
|
|
|
/** |
|
24
|
|
|
* Model::$db |
|
25
|
|
|
* |
|
26
|
|
|
* Database connection instance. |
|
27
|
|
|
* |
|
28
|
|
|
* @var \O2System\Database\Sql\Abstracts\AbstractConnection |
|
29
|
|
|
*/ |
|
30
|
|
|
public $db; |
|
31
|
|
|
|
|
32
|
|
|
/** |
|
33
|
|
|
* Model::$qb |
|
34
|
|
|
* |
|
35
|
|
|
* Database query builder instance. |
|
36
|
|
|
* |
|
37
|
|
|
* @var \O2System\Database\Sql\Abstracts\AbstractQueryBuilder |
|
38
|
|
|
*/ |
|
39
|
|
|
public $qb; |
|
40
|
|
|
|
|
41
|
|
|
// ------------------------------------------------------------------------ |
|
42
|
|
|
|
|
43
|
|
|
/** |
|
44
|
|
|
* Model::$forge |
|
45
|
|
|
* |
|
46
|
|
|
* Database forge instance. |
|
47
|
|
|
* |
|
48
|
|
|
* @var \O2System\Database\Sql\Abstracts\AbstractForge |
|
|
|
|
|
|
49
|
|
|
*/ |
|
50
|
|
|
public $forge; |
|
51
|
|
|
|
|
52
|
|
|
// ------------------------------------------------------------------------ |
|
53
|
|
|
|
|
54
|
|
|
/** |
|
55
|
|
|
* Migration::__construct |
|
56
|
|
|
*/ |
|
57
|
|
|
public function __construct() |
|
58
|
|
|
{ |
|
59
|
|
|
// Set database connection |
|
60
|
|
|
if (method_exists(database(), 'loadConnection')) { |
|
61
|
|
|
if ($this->db = database()->loadConnection('default')) { |
|
62
|
|
|
$this->qb = $this->db->getQueryBuilder(); |
|
63
|
|
|
$this->forge = $this->db->getForge(); |
|
64
|
|
|
} |
|
65
|
|
|
} |
|
66
|
|
|
} |
|
67
|
|
|
|
|
68
|
|
|
// ------------------------------------------------------------------------ |
|
69
|
|
|
|
|
70
|
|
|
/** |
|
71
|
|
|
* Migration::__call |
|
72
|
|
|
* |
|
73
|
|
|
* @param string $method |
|
74
|
|
|
* @param array $arguments |
|
75
|
|
|
* |
|
76
|
|
|
* @return mixed |
|
77
|
|
|
*/ |
|
78
|
|
|
public function __call($method, array $arguments = []) |
|
79
|
|
|
{ |
|
80
|
|
|
if (method_exists($this, $method)) { |
|
81
|
|
|
return call_user_func_array([&$this, $method], $arguments); |
|
82
|
|
|
} elseif (method_exists($this->db, $method)) { |
|
83
|
|
|
return call_user_func_array([&$this->db, $method], $arguments); |
|
84
|
|
|
} elseif (method_exists($this->forge, $method)) { |
|
85
|
|
|
return call_user_func_array([&$this->forge, $method], $arguments); |
|
86
|
|
|
} |
|
87
|
|
|
|
|
88
|
|
|
return false; |
|
89
|
|
|
} |
|
90
|
|
|
} |
The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g.
excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths