|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
/** |
|
4
|
|
|
* KNUT7 K7F (https://marciozebedeu.com/) |
|
5
|
|
|
* KNUT7 K7F (tm) : Rapid Development Framework (https://marciozebedeu.com/) |
|
6
|
|
|
* |
|
7
|
|
|
* Licensed under The MIT License |
|
8
|
|
|
* For full copyright and license information, please see the LICENSE.txt |
|
9
|
|
|
* Redistributions of files must retain the above copyright notice. |
|
10
|
|
|
* |
|
11
|
|
|
* @link https://github.com/knut7/framework/ for the canonical source repository |
|
12
|
|
|
* @copyright (c) 2015. KNUT7 Software Technologies AO Inc. (https://marciozebedeu.com/) |
|
13
|
|
|
* @license https://marciozebedeu.com/license/new-bsd New BSD License |
|
14
|
|
|
* @author Marcio Zebedeu - [email protected] |
|
15
|
|
|
* @version 1.0.2 |
|
16
|
|
|
*/ |
|
17
|
|
|
|
|
18
|
|
|
namespace Ballybran\Database\Drives; |
|
19
|
|
|
|
|
20
|
|
|
use Ballybran\Database\DBconnection; |
|
21
|
|
|
use Ballybran\Helpers\vardump\Vardump; |
|
|
|
|
|
|
22
|
|
|
use PDO; |
|
23
|
|
|
use function var_dump; |
|
24
|
|
|
|
|
25
|
|
|
class AbstractDatabasePDOO |
|
26
|
|
|
{ |
|
27
|
|
|
|
|
28
|
|
|
public $conn; |
|
29
|
|
|
public $stmt; |
|
30
|
|
|
/** |
|
31
|
|
|
* @var array |
|
32
|
|
|
*/ |
|
33
|
|
|
private $param; |
|
|
|
|
|
|
34
|
|
|
private $_instances; |
|
35
|
|
|
private $params; |
|
36
|
|
|
|
|
37
|
|
|
/** |
|
38
|
|
|
* DatabasePDOO constructor. |
|
39
|
|
|
* @param array $param |
|
40
|
|
|
*/ |
|
41
|
|
|
public function __construct($params) |
|
42
|
|
|
{ |
|
43
|
|
|
$this->params = $params; |
|
44
|
|
|
|
|
45
|
|
|
try { |
|
46
|
|
|
|
|
47
|
|
|
|
|
48
|
|
|
$this->_instances = new PDO("mysql:host=localhost;port=8889;dbname=apweb", "root", "root"); |
|
49
|
|
|
|
|
50
|
|
|
$attributes = array( |
|
51
|
|
|
"AUTOCOMMIT", "ERRMODE", "CASE", "CLIENT_VERSION", "CONNECTION_STATUS", |
|
52
|
|
|
"ORACLE_NULLS", "PERSISTENT", "SERVER_INFO", "SERVER_VERSION" |
|
53
|
|
|
); |
|
54
|
|
|
foreach ($attributes as $value) { |
|
55
|
|
|
$this->_instances->getAttribute(constant("PDO::ATTR_$value")) . "\n"; |
|
56
|
|
|
} |
|
57
|
|
|
} catch (\PDOException $exc) { |
|
58
|
|
|
throw new \Exception('Failed to connect to database. Reason: ' . $exc->getMessage()); |
|
59
|
|
|
} |
|
60
|
|
|
|
|
61
|
|
|
return $this->_instances; |
|
62
|
|
|
} |
|
63
|
|
|
|
|
64
|
|
|
public function select($select) |
|
65
|
|
|
{ |
|
66
|
|
|
|
|
67
|
|
|
|
|
68
|
|
|
$stmt = $this->_instances->prepare("SELECT * FROM $select"); |
|
69
|
|
|
$stmt->execute(); |
|
70
|
|
|
$stmt->fetchAll(\PDO::FETCH_ASSOC); |
|
71
|
|
|
|
|
72
|
|
|
|
|
73
|
|
|
return $this; |
|
74
|
|
|
|
|
75
|
|
|
} |
|
76
|
|
|
|
|
77
|
|
|
public function table($table) |
|
78
|
|
|
{ |
|
79
|
|
|
echo "$table"; |
|
80
|
|
|
return $this; |
|
81
|
|
|
} |
|
82
|
|
|
|
|
83
|
|
|
public function Backup($localation) |
|
|
|
|
|
|
84
|
|
|
{ |
|
85
|
|
|
|
|
86
|
|
|
} |
|
87
|
|
|
|
|
88
|
|
|
} |
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