Passed
Branch master (49f250)
by Brayan
01:58
created

Database::motor_oracle()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 12
Code Lines 7

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 7
nc 1
nop 1
dl 0
loc 12
rs 9.4285
c 0
b 0
f 0
1
<?php
2
3
/*
4
 * This file is part of the Ocrend Framewok 3 package.
5
 *
6
 * (c) Ocrend Software <[email protected]>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace Ocrend\Kernel\Database;
13
use  Ocrend\Kernel\Database\Drivers\Mysql\Mysql;
14
use  Ocrend\Kernel\Database\Drivers\Sqlite\Sqlite;
15
16
/**
17
 * Clase para conectar todos los modelos del sistema y compartir la configuración.
18
 * Inicializa elementos escenciales como la conexión con la base de datos.
19
 *
20
 * @author Brayan Narváez <[email protected]>
21
 */
22
class Database {
23
    
24
    /**
25
     * Resuelve el controlador de base de datos solicitado
26
     * 
27
     * @param string $motor: Motor a conectar
28
     * 
29
     * @return Driver
30
     */
31
    public static function resolveDriver(string $motor) : Driver {
32
        global $config;
33
34
        if($motor == 'mysql') {
35
            return new Mysql;
36
        } 
37
38
        return new Sqlite;
39
    }
40
}