Verzeichnisstruktur phpBB-3.1.0


Veröffentlicht
27.10.2014

So funktioniert es


Auf das letzte Element klicken. Dies geht jeweils ein Schritt zurück

Auf das Icon klicken, dies öffnet das Verzeichnis. Nochmal klicken schließt das Verzeichnis.
Auf den Verzeichnisnamen klicken, dies zeigt nur das Verzeichnis mit Inhalt an

      (Beispiel Datei-Icons)

Auf das Icon klicken um den Quellcode anzuzeigen

tidy_sessions.php

Zuletzt modifiziert: 09.10.2024, 12:55 - Dateigröße: 1.11 KiB


 01  <?php
 02  /**
 03  *
 04  * This file is part of the phpBB Forum Software package.
 05  *
 06  * @copyright (c) phpBB Limited <https://www.phpbb.com>
 07  * @license GNU General Public License, version 2 (GPL-2.0)
 08  *
 09  * For full copyright and license information, please see
 10  * the docs/CREDITS.txt file.
 11  *
 12  */
 13   
 14  namespace phpbb\cron\task\core;
 15   
 16  /**
 17  * Tidy sessions cron task.
 18  */
 19  class tidy_sessions extends \phpbb\cron\task\base
 20  {
 21      protected $config;
 22      protected $user;
 23   
 24      /**
 25      * Constructor.
 26      *
 27      * @param \phpbb\config\config $config The config
 28      * @param \phpbb\user $user The user
 29      */
 30      public function __construct(\phpbb\config\config $config, \phpbb\user $user)
 31      {
 32          $this->config = $config;
 33          $this->user = $user;
 34      }
 35   
 36      /**
 37      * Runs this cron task.
 38      *
 39      * @return null
 40      */
 41      public function run()
 42      {
 43          $this->user->session_gc();
 44      }
 45   
 46      /**
 47      * Returns whether this cron task should run now, because enough time
 48      * has passed since it was last run.
 49      *
 50      * The interval between session tidying is specified in board
 51      * configuration.
 52      *
 53      * @return bool
 54      */
 55      public function should_run()
 56      {
 57          return $this->config['session_last_gc'] < time() - $this->config['session_gc'];
 58      }
 59  }
 60