mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 11:28:25 +00:00
Updating session helper constructor to fix failing tests in Controller::render() integration tests.
This commit is contained in:
parent
62d646d168
commit
bd89ef533b
1 changed files with 13 additions and 0 deletions
|
@ -31,6 +31,19 @@ if (!class_exists('CakeSession')) {
|
||||||
*/
|
*/
|
||||||
class SessionHelper extends AppHelper {
|
class SessionHelper extends AppHelper {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Constructor. Starts the session if it has not already been started
|
||||||
|
*
|
||||||
|
* @param View $view View instance for this helper
|
||||||
|
* @param array $settings Settings for the helper.
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function __construct(View $view, $settings = array()) {
|
||||||
|
parent::__construct($view, $settings);
|
||||||
|
if (!CakeSession::started()) {
|
||||||
|
CakeSession::start();
|
||||||
|
}
|
||||||
|
}
|
||||||
/**
|
/**
|
||||||
* Used to read a session values set in a controller for a key or return values for all keys.
|
* Used to read a session values set in a controller for a key or return values for all keys.
|
||||||
*
|
*
|
||||||
|
|
Loading…
Reference in a new issue