1
我遇到了一個問題,指定要在config/app.php中的自定義會話處理程序中使用的不同數據源。下面是相關位:CakePHP 3.2 - 爲會話處理程序指定不同的數據源
配置/ app.php
<?php
return [
... ,
'Datasources' => [
'default' => [...],
'test' => [...],
'session' => [...]
],
'Session' => [
'defaults' => 'database',
'ini' => ['session.cookie_domain' => '.example.com'],
'handler' => [
'engine' => 'CustomSessionHandler', // file and class name of custom handler
'model' => 'sessions' // table name
]
]
];
CustomSessionHandler.php
是默認DatabaseSession.php
與查詢大樓內的定製的副本,與我們現有的sessions
表模式工作。
現在,它試圖使用「默認」數據源,正如你可能猜到的,我試圖讓它使用'會話'數據源。但是我找不到任何有關如何做到這一點的信息。
任何援助非常感謝!