Verzeichnisstruktur phpBB-3.3.15


Veröffentlicht
28.08.2024

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_database.php

Zuletzt modifiziert: 02.04.2025, 15:02 - Dateigröße: 1.38 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 database cron task.
18  */
19  class tidy_database extends \phpbb\cron\task\base
20  {
21      protected $phpbb_root_path;
22      protected $php_ext;
23      protected $config;
24   
25      /**
26      * Constructor.
27      *
28      * @param string $phpbb_root_path The root path
29      * @param string $php_ext The PHP file extension
30      * @param \phpbb\config\config $config The config
31      */
32      public function __construct($phpbb_root_path, $php_ext, \phpbb\config\config $config)
33      {
34          $this->phpbb_root_path = $phpbb_root_path;
35          $this->php_ext = $php_ext;
36          $this->config = $config;
37      }
38   
39      /**
40      * Runs this cron task.
41      *
42      * @return null
43      */
44      public function run()
45      {
46          if (!function_exists('tidy_database'))
47          {
48              include($this->phpbb_root_path . 'includes/functions_admin.' . $this->php_ext);
49          }
50          tidy_database();
51      }
52   
53      /**
54      * Returns whether this cron task should run now, because enough time
55      * has passed since it was last run.
56      *
57      * The interval between database tidying is specified in board
58      * configuration.
59      *
60      * @return bool
61      */
62      public function should_run()
63      {
64          return $this->config['database_last_gc'] < time() - $this->config['database_gc'];
65      }
66  }
67