-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmanager.php
39 lines (33 loc) · 988 Bytes
/
manager.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
36
37
38
39
<?php
/**
* File to assist the developers to manager your database
*
* @category Manager
* @package DJORM
* @author André Ramos <[email protected]>
* @license http://www.gnu.org/copyleft/gpl.html GPL
* @link https://github.com/andrelramos/djorm-php
*
*/
require 'vendor/autoload.php';
require 'settings.php';
use DJORM\Connection as Conn;
use MODELS;
//Get args and transform to $_GET array
parse_str(implode('&', array_slice($argv, 1)), $_GET);
if( isset($_GET['migrate']) ) {
migrate();
}
function db_connect() {
$pdo = new PDO('mysql:host=localhost;dbname='.DB, USER_DB, PASSWORD_DB, array(PDO::MYSQL_ATTR_INIT_COMMAND => "SET NAMES utf8"));
Conn::dbConn($pdo);
}
/* functions */
function migrate() {
echo " __________________________ \n";
echo "| |\n";
echo "| RUN MIGRATE... |\n";
echo "| WAIT PLS |\n";
echo "|__________________________|\n\n\n";
db_connect();
}