Completed
Push — master ( b6977a...72c194 )
by Christopher
12:58
created

Connection::connectMySQL()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 4
rs 10
cc 1
eloc 1
nc 1
nop 0
1
<?php
2
3
namespace Ganga\Potato;
4
5
use SQLite3;
6
7
/**
8
 * Class to define connection to sqlite database;
9
 */
10
class Connection
11
{
12
    protected static $conn;
13
14
    /**
15
     * Constructor
16
     * Declare an instance of SQLite class
17
     */
18
    public function __construct($dbFile)
19
    {
20
        self::$conn = new SQLite3($dbFile);
21
    }
22
23
    /**
24
     * Get an instance of the db connection
25
     * @return SQLite3 connection
26
     */
27
    public static function db()
28
    {
29
        if (!Self::$conn) {
30
            // Throw connection error
31
            return Self::$conn->lastErrorMsg();
32
        } else {
33
            return Self::$conn;
34
        }
35
    }
36
37
    public function connectMySQL()
38
    {
39
40
    }
41
42
    public function conncetSQLite()
43
    {
44
45
    }
46
47
    public function connectPostrges()
48
    {
49
        
50
    }
51
}
52