-
Notifications
You must be signed in to change notification settings - Fork 11
/
phinx.php
35 lines (29 loc) · 861 Bytes
/
phinx.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
<?php
/**
* KK-Framework
* Author: kookxiang <[email protected]>
*/
if (PHP_SAPI != 'cli') {
exit('This file could not be access directly.');
}
define('ROOT_PATH', dirname(__FILE__) . DIRECTORY_SEPARATOR);
define('LIBRARY_PATH', ROOT_PATH . 'Library/');
define('DATA_PATH', ROOT_PATH . 'Data/');
@ini_set('display_errors', 'on');
require ROOT_PATH . 'Package/autoload.php';
Core\Error::registerHandler();
@include DATA_PATH . 'Config.php';
$statement = \Core\Database::getInstance()->query('select database()');
$statement->execute();
return array(
'paths' => array(
'migrations' => ROOT_PATH . 'Migrations',
),
'environments' => array(
'default_database' => 'current',
'current' => array(
'name' => $statement->fetchColumn(),
'connection' => \Core\Database::getInstance(),
),
),
);