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. |
|
(Beispiel Datei-Icons)
|
Auf das Icon klicken um den Quellcode anzuzeigen |
viglink.php
01 <?php
02 /**
03 *
04 * VigLink extension for the phpBB Forum Software package.
05 *
06 * @copyright (c) 2016 phpBB Limited <https://www.phpbb.com>
07 * @license GNU General Public License, version 2 (GPL-2.0)
08 *
09 */
10
11 namespace phpbb\viglink\cron;
12
13 /**
14 * Viglink cron task.
15 */
16 class viglink extends \phpbb\cron\task\base
17 {
18 /** @var \phpbb\config\config $config Config object */
19 protected $config;
20
21 /** @var \phpbb\viglink\acp\viglink_helper $helper Viglink helper object */
22 protected $helper;
23
24 /**
25 * Constructor
26 *
27 * @param \phpbb\config\config $config Config object
28 * @param \phpbb\viglink\acp\viglink_helper $viglink_helper Viglink helper object
29 * @access public
30 */
31 public function __construct(\phpbb\config\config $config, \phpbb\viglink\acp\viglink_helper $viglink_helper)
32 {
33 $this->config = $config;
34 $this->helper = $viglink_helper;
35 }
36
37 /**
38 * {@inheritDoc}
39 */
40 public function run()
41 {
42 try
43 {
44 $this->helper->set_viglink_services(true);
45 }
46 catch (\RuntimeException $e)
47 {
48 $this->helper->log_viglink_error($e->getMessage());
49 }
50 }
51
52 /**
53 * {@inheritDoc}
54 */
55 public function is_runnable()
56 {
57 return (bool) $this->config['viglink_enabled'];
58 }
59
60 /**
61 * {@inheritDoc}
62 */
63 public function should_run()
64 {
65 return $this->config['viglink_last_gc'] < strtotime('24 hours ago');
66 }
67 }
68