Verzeichnisstruktur phpBB-3.2.0


Veröffentlicht
06.01.2017

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

queue.php

Zuletzt modifiziert: 09.10.2024, 12:55 - Dateigröße: 1.82 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  * Queue cron task. Sends email and jabber messages queued by other scripts.
 18  */
 19  class queue extends \phpbb\cron\task\base
 20  {
 21      protected $phpbb_root_path;
 22      protected $php_ext;
 23      protected $cache_dir;
 24      protected $config;
 25   
 26      /**
 27       * Constructor.
 28       *
 29       * @param string $phpbb_root_path The root path
 30       * @param string $php_ext PHP file extension
 31       * @param \phpbb\config\config $config The config
 32       * @param string $cache_dir phpBB cache directory
 33       */
 34      public function __construct($phpbb_root_path, $php_ext, \phpbb\config\config $config, $cache_dir)
 35      {
 36          $this->phpbb_root_path = $phpbb_root_path;
 37          $this->php_ext = $php_ext;
 38          $this->config = $config;
 39          $this->cache_dir = $cache_dir;
 40      }
 41   
 42      /**
 43      * Runs this cron task.
 44      *
 45      * @return null
 46      */
 47      public function run()
 48      {
 49          if (!class_exists('queue'))
 50          {
 51              include($this->phpbb_root_path . 'includes/functions_messenger.' . $this->php_ext);
 52          }
 53          $queue = new \queue();
 54          $queue->process();
 55      }
 56   
 57      /**
 58      * Returns whether this cron task can run, given current board configuration.
 59      *
 60      * Queue task is only run if the email queue (file) exists.
 61      *
 62      * @return bool
 63      */
 64      public function is_runnable()
 65      {
 66          return file_exists($this->cache_dir . 'queue.' . $this->php_ext);
 67      }
 68   
 69      /**
 70      * Returns whether this cron task should run now, because enough time
 71      * has passed since it was last run.
 72      *
 73      * The interval between queue runs is specified in board configuration.
 74      *
 75      * @return bool
 76      */
 77      public function should_run()
 78      {
 79          return $this->config['last_queue_run'] < time() - $this->config['queue_interval'];
 80      }
 81  }
 82