1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
declare(strict_types=1); |
4
|
|
|
namespace Scrawler\Arca; |
5
|
|
|
|
6
|
|
|
use \Doctrine\DBAL\Connection as DBALConnection; |
|
|
|
|
7
|
|
|
use Doctrine\DBAL\Platforms\AbstractPlatform; |
8
|
|
|
use \Doctrine\DBAL\Schema\AbstractSchemaManager; |
|
|
|
|
9
|
|
|
use \Scrawler\Arca\Manager\RecordManager; |
|
|
|
|
10
|
|
|
use \Scrawler\Arca\Manager\TableManager; |
|
|
|
|
11
|
|
|
use \Scrawler\Arca\Manager\ModelManager; |
|
|
|
|
12
|
|
|
use Ramsey\Uuid\Uuid; |
13
|
|
|
|
14
|
|
|
|
15
|
|
|
class Connection{ |
16
|
|
|
|
17
|
|
|
private DBALConnection $connection; |
18
|
|
|
private AbstractSchemaManager $SchemaManager; |
19
|
|
|
private AbstractPlatform $platform; |
20
|
|
|
private RecordManager $RecordManager; |
21
|
|
|
private TableManager $TableManager; |
22
|
|
|
private ModelManager $ModelManager; |
23
|
|
|
private bool $isUsingUUID; |
24
|
|
|
private string $connectionId; |
25
|
|
|
|
26
|
|
|
public function __construct(array $connectionParams) |
27
|
|
|
{ |
28
|
|
|
$this->connectionId = UUID::uuid4()->toString(); |
29
|
|
|
if(isset($connectionParams['useUUID']) && $connectionParams['useUUID']){ |
30
|
|
|
$this->isUsingUUID = true; |
31
|
|
|
}else{ |
32
|
|
|
$this->isUsingUUID = false; |
33
|
|
|
} |
34
|
|
|
unset($connectionParams['useUUID']); |
35
|
|
|
$this->connection = \Doctrine\DBAL\DriverManager::getConnection($connectionParams); |
36
|
|
|
$this->SchemaManager = $this->connection->createSchemaManager(); |
37
|
|
|
$this->platform = $this->connection->getDatabasePlatform(); |
38
|
|
|
$this->ModelManager = new ModelManager(); |
39
|
|
|
$this->RecordManager = new RecordManager($this->connection,$this->ModelManager,$this->isUsingUUID); |
40
|
|
|
$this->TableManager = new TableManager($this->connection,$this->isUsingUUID); |
41
|
|
|
$this->ModelManager->setConnection($this); |
42
|
|
|
} |
43
|
|
|
|
44
|
|
|
public function getSchemaManager(){ |
45
|
|
|
return $this->SchemaManager; |
46
|
|
|
} |
47
|
|
|
|
48
|
|
|
public function getPlatform(){ |
49
|
|
|
return $this->platform; |
50
|
|
|
} |
51
|
|
|
|
52
|
|
|
public function isUsingUUID(){ |
53
|
|
|
return $this->isUsingUUID; |
54
|
|
|
} |
55
|
|
|
|
56
|
|
|
public function getRecordManager(){ |
57
|
|
|
return $this->RecordManager; |
58
|
|
|
} |
59
|
|
|
|
60
|
|
|
public function getTableManager(){ |
61
|
|
|
return $this->TableManager; |
62
|
|
|
} |
63
|
|
|
|
64
|
|
|
public function getModelManager(){ |
65
|
|
|
return $this->ModelManager; |
66
|
|
|
} |
67
|
|
|
|
68
|
|
|
public function getConnectionId(){ |
69
|
|
|
return $this->connectionId; |
70
|
|
|
} |
71
|
|
|
|
72
|
|
|
function __call($method, $args) { |
|
|
|
|
73
|
|
|
return call_user_func_array(array($this->connection, $method), $args); |
74
|
|
|
} |
75
|
|
|
|
76
|
|
|
|
77
|
|
|
} |
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