fix patho connection

master
Manop Kongoon 2025-12-19 13:15:41 +07:00
parent c601a69987
commit ad0090fd13
2 changed files with 17 additions and 1 deletions

View File

@ -13,7 +13,7 @@ class SiteController extends Controller
return [ return [
[ [
'class' => 'yii\filters\ContentNegotiator', 'class' => 'yii\filters\ContentNegotiator',
'only' => ['docs', 'index'], 'only' => ['docs', 'index', 'test-db'],
'formats' => [ 'formats' => [
'application/json' => Response::FORMAT_HTML, '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 '<pre>';
var_dump($users);
die();
}
} }

View File

@ -17,6 +17,14 @@ return [
'charset' => 'utf8', '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' => [ 'mailer' => [
'class' => 'yii\swiftmailer\Mailer', 'class' => 'yii\swiftmailer\Mailer',
'viewPath' => '@common/mail', 'viewPath' => '@common/mail',