diff --git a/api/controllers/SiteController.php b/api/controllers/SiteController.php index b81f269c..4de85e7a 100755 --- a/api/controllers/SiteController.php +++ b/api/controllers/SiteController.php @@ -13,7 +13,7 @@ class SiteController extends Controller return [ [ 'class' => 'yii\filters\ContentNegotiator', - 'only' => ['docs', 'index'], + 'only' => ['docs', 'index', 'test-db'], 'formats' => [ 'application/json' => Response::FORMAT_HTML, ], @@ -77,4 +77,12 @@ class SiteController extends Controller ]; } } + + public function actionTestPatho() + { + $users = Yii::$app->patho->createCommand('SELECT * FROM user')->queryAll(); + echo '
';
+ var_dump($users);
+ die();
+ }
}
\ No newline at end of file
diff --git a/common/config/main-local.php b/common/config/main-local.php
index c0b40ce6..1c1926b3 100755
--- a/common/config/main-local.php
+++ b/common/config/main-local.php
@@ -17,6 +17,14 @@ return [
'charset' => 'utf8',
],
+ 'patho' => [
+ 'class' => \yii\db\Connection::class,
+ 'dsn' => 'mysql:host=172.16.0.7;dbname=prolab_main', //161.82.188.168
+ 'username' => 'apiuser',
+ 'password' => 'Aa157344121165',
+ 'charset' => 'utf8',
+ ],
+
'mailer' => [
'class' => 'yii\swiftmailer\Mailer',
'viewPath' => '@common/mail',