1111namespace Joomla \Plugin \System \Debug ;
1212
1313use DebugBar \HttpDriverInterface ;
14- use Joomla \Application \SessionAwareWebApplicationInterface ;
1514use Joomla \Application \WebApplicationInterface ;
1615use Joomla \CMS \Application \CMSApplicationInterface ;
17- use Joomla \CMS \Session \Session ;
1816
1917// phpcs:disable PSR1.Files.SideEffects
2018\defined ('_JEXEC ' ) or die;
@@ -34,13 +32,6 @@ final class JoomlaHttpDriver implements HttpDriverInterface
3432 */
3533 private $ app ;
3634
37- /**
38- * @var Session
39- *
40- * @since 4.1.5
41- */
42- private $ session ;
43-
4435 /**
4536 * @var array
4637 *
@@ -58,10 +49,6 @@ final class JoomlaHttpDriver implements HttpDriverInterface
5849 public function __construct (CMSApplicationInterface $ app )
5950 {
6051 $ this ->app = $ app ;
61-
62- if ($ app instanceof SessionAwareWebApplicationInterface) {
63- $ this ->session = $ app ->getSession ();
64- }
6552 }
6653
6754 /**
@@ -89,7 +76,7 @@ public function setHeaders(array $headers)
8976 */
9077 public function isSessionStarted ()
9178 {
92- return $ this -> session ? $ this -> session -> isStarted () : true ;
79+ return true ;
9380 }
9481
9582 /**
@@ -102,11 +89,7 @@ public function isSessionStarted()
10289 */
10390 public function setSessionValue ($ name , $ value )
10491 {
105- if ($ this ->session ) {
106- $ this ->session ->set ($ name , $ value );
107- } else {
108- $ this ->dummySession [$ name ] = $ value ;
109- }
92+ $ this ->dummySession [$ name ] = $ value ;
11093 }
11194
11295 /**
@@ -120,7 +103,7 @@ public function setSessionValue($name, $value)
120103 */
121104 public function hasSessionValue ($ name )
122105 {
123- return $ this -> session ? $ this -> session -> has ( $ name ) : array_key_exists ($ name , $ this ->dummySession );
106+ return array_key_exists ($ name , $ this ->dummySession );
124107 }
125108
126109 /**
@@ -134,10 +117,6 @@ public function hasSessionValue($name)
134117 */
135118 public function getSessionValue ($ name )
136119 {
137- if ($ this ->session ) {
138- return $ this ->session ->get ($ name );
139- }
140-
141120 return $ this ->dummySession [$ name ] ?? null ;
142121 }
143122
@@ -150,10 +129,6 @@ public function getSessionValue($name)
150129 */
151130 public function deleteSessionValue ($ name )
152131 {
153- if ($ this ->session ) {
154- $ this ->session ->remove ($ name );
155- } else {
156- unset($ this ->dummySession [$ name ]);
157- }
132+ unset($ this ->dummySession [$ name ]);
158133 }
159134}
0 commit comments