diff --git a/App/Config.php b/App/Config.php index 60156ff..3d9cf42 100644 --- a/App/Config.php +++ b/App/Config.php @@ -12,7 +12,7 @@ class Config * Database host * @var string */ - const DB_HOST = '117.50.176.114'; + const DB_HOST = '117.50.187.222'; /** * Database name * @var string @@ -29,7 +29,7 @@ class Config * Database password * @var string */ - const DB_PASSWORD = '12345678'; + const DB_PASSWORD = 'zhengcaiyu123'; /** * Show or hide error messages on screen * @var boolean diff --git a/Core/Model.php b/Core/Model.php index 6903190..7e30198 100644 --- a/Core/Model.php +++ b/Core/Model.php @@ -57,7 +57,7 @@ abstract class Model if ($db === null) { $dsn = ""; if($_SERVER['HTTP_HOST'] == '127.0.0.1') - $dsn = 'mysql:host=117.50.176.114' . ';dbname=' . Config::DB_NAME . ';charset=utf8'; + $dsn = 'mysql:host=117.50.187.222' . ';dbname=' . Config::DB_NAME . ';charset=utf8'; else $dsn = 'mysql:host=127.0.0.1' . ';dbname=' . Config::DB_NAME . ';charset=utf8'; try { diff --git a/composer.json b/composer.json index eab8423..74603f3 100644 --- a/composer.json +++ b/composer.json @@ -1,6 +1,6 @@ { "require": { - "twig/twig": "~2.0", + "twig/twig": "~3.0", "propel/propel": "~2.0@dev", "erusev/parsedown": "^1.7", "benjaminhoegh/parsedown-toc": "^1.4" @@ -23,6 +23,6 @@ ] }, "require-dev": { - "contributte/nextras-orm-generator": "^0.2.0" } + } diff --git a/deploy.bat b/deploy.bat index 482a299..403a69a 100644 --- a/deploy.bat +++ b/deploy.bat @@ -1,8 +1,7 @@ rm ../code.tar.gz del ../code.tar.gz tar.exe -czf ../code.tar.gz ./* -scp -i ./id_rsa ../code.tar.gz ubuntu@117.50.176.114:/home/ubuntu/ -ssh -t -i ./id_rsa ubuntu@117.50.176.114 sudo tar -zxvf /home/ubuntu/code.tar.gz -C /var/www/html/api/ -ssh -t -i ./id_rsa ubuntu@117.50.176.114 sudo rm /home/ubuntu/code.tar.gz - +scp -i ./id_rsa_s ../code.tar.gz ubuntu@117.50.187.222:/home/ubuntu/ +ssh -t -i ./id_rsa_s ubuntu@117.50.187.222 sudo tar -zxvf /home/ubuntu/code.tar.gz -C /var/www/html/api/ +ssh -t -i ./id_rsa_s ubuntu@117.50.187.222 sudo rm /home/ubuntu/code.tar.gz diff --git a/public/index.php b/public/index.php index be33544..384b04b 100644 --- a/public/index.php +++ b/public/index.php @@ -49,7 +49,6 @@ if($_SERVER['HTTP_HOST'] == '117.50.176.114'){ } - try{ //for prefight request if($_SERVER['REQUEST_METHOD'] == 'OPTIONS'){ @@ -60,7 +59,6 @@ try{ //print ""; return; }else{ - //print_r($_SERVER['REQUEST_URI'],\App\Config::ROUTE_PREFIX_DEV); $router->dispatch($_SERVER['REQUEST_URI']); } }catch (Exception $exception){