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. |
|
(Beispiel Datei-Icons)
|
Auf das Icon klicken um den Quellcode anzuzeigen |
queue.php
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 $config;
24
25 /**
26 * Constructor.
27 *
28 * @param string $phpbb_root_path The root path
29 * @param string $php_ext 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 (!class_exists('queue'))
47 {
48 include($this->phpbb_root_path . 'includes/functions_messenger.' . $this->php_ext);
49 }
50 $queue = new \queue();
51 $queue->process();
52 }
53
54 /**
55 * Returns whether this cron task can run, given current board configuration.
56 *
57 * Queue task is only run if the email queue (file) exists.
58 *
59 * @return bool
60 */
61 public function is_runnable()
62 {
63 return file_exists($this->phpbb_root_path . 'cache/queue.' . $this->php_ext);
64 }
65
66 /**
67 * Returns whether this cron task should run now, because enough time
68 * has passed since it was last run.
69 *
70 * The interval between queue runs is specified in board configuration.
71 *
72 * @return bool
73 */
74 public function should_run()
75 {
76 return $this->config['last_queue_run'] < time() - $this->config['queue_interval'];
77 }
78 }
79