@@ -32,19 +32,19 @@ class listener implements EventSubscriberInterface
3232 private $ time_now ;
3333
3434 /**
35- * Constructor.
36- *
37- * Essentially just saves the phpBB globals into local, protected variables.
38- *
39- * @param \phpbb\template\template $template Template object.
40- * @param \phpbb\user $user User object.
41- * @param \phpbb\request\request $request Request object.
42- * @param \phpbb\config\config $config Config object.
43- * @return \gwynethllewelyn\postlocalstorage\event\listener
44- * @access public
45- * @since 1.2.0
46- */
47- public function __construct (\phpbb \template \template $ template , \phpbb \user $ user , \phpbb \request \request $ request ,\phpbb \config \config $ config )
35+ * Constructor.
36+ *
37+ * Essentially just saves the phpBB globals into local, protected variables.
38+ *
39+ * @param \phpbb\template\template $template Template object.
40+ * @param \phpbb\user $user User object.
41+ * @param \phpbb\request\request $request Request object.
42+ * @param \phpbb\config\config $config Config object.
43+ * @return \gwynethllewelyn\postlocalstorage\event\listener
44+ * @access public
45+ * @since 1.2.0
46+ */
47+ public function __construct (\phpbb \template \template $ template , \phpbb \user $ user , \phpbb \request \request $ request , \phpbb \config \config $ config )
4848 {
4949 $ this ->template = $ template ;
5050 $ this ->user = $ user ;
@@ -53,7 +53,6 @@ public function __construct(\phpbb\template\template $template, \phpbb\user $use
5353 $ this ->time_now = time (); // assign current time.
5454 }
5555
56-
5756 /**
5857 * Assign functions defined in this class to event listeners in the core.
5958 *
@@ -63,7 +62,7 @@ static public function getSubscribedEvents()
6362 {
6463 // error_log('[phpBB3 postlocalstorage] my getSubscribedEvents was called!');
6564 return [
66- 'core.modify_submit_post_data ' => 'check_expiry_time ' ,
65+ 'core.modify_submit_post_data ' => 'check_expiry_time ' ,
6766 'core.posting_modify_template_vars ' => 'check_expiry_time ' ,
6867 ];
6968 }
@@ -75,8 +74,7 @@ static public function getSubscribedEvents()
7574 */
7675 public function check_expiry_time ($ event )
7776 {
78- // error_log('[phpBB3 postlocalstorage] Dumping \$event in check_expiry_time()' + print_r($event, true));
79- error_log ('[phpBB3 postlocalstorage] checking for expiry time... ' );
77+ error_log ('[phpBB3 postlocalstorage] checking for expiry time... ' . $ event ->getMessage ());
8078
8179 try
8280 {
@@ -95,12 +93,17 @@ public function check_expiry_time($event)
9593 }
9694 $ session_expiry_time = $ this ->time_now + $ session_length ;
9795
98- error_log ('[phpBB3 postlocalstorage] check_expiry_time: $this->time_now is ' . $ this ->time_now
99- . ' $session_length is ' . $ session_length
100- . '; Total is: ' . $ session_expiry_time );
96+ error_log (
97+ '[phpBB3 postlocalstorage] check_expiry_time: $this->time_now is '
98+ . $ this ->time_now
99+ . ' $session_length is '
100+ . $ session_length
101+ . '; Total is: '
102+ . $ session_expiry_time
103+ );
101104
102105 $ this ->template ->assign_vars (array (
103106 'EXPIRY_TIME ' => $ session_expiry_time ,
104107 ));
105108 }
106- }
109+ }
0 commit comments