File tree Expand file tree Collapse file tree 3 files changed +27
-13
lines changed
Expand file tree Collapse file tree 3 files changed +27
-13
lines changed Original file line number Diff line number Diff line change 11<?php
22
3- // phpcs:disable PSR1.Files.SideEffects
4-
5- \define ('PACKAGE_ID ' , 1 );
63require_once (__DIR__ . '/global.php ' );
4+
75use wcf \data \application \ApplicationList ;
8- use wcf \data \cronjob \ CronjobAction ;
6+ use wcf \data \user \ User ;
97use wcf \system \background \BackgroundQueueHandler ;
8+ use wcf \system \cronjob \CronjobScheduler ;
109use wcf \system \WCF ;
1110
1211if (!\defined ('OFFLINE ' ) || !OFFLINE ) {
1716 WCF ::loadRuntimeApplication ($ application ->packageID );
1817 }
1918
20- $ action = new CronjobAction ([], 'executeCronjobs ' );
21- $ action ->executeAction ();
19+ WCF ::getSession ()->changeUser (new User (null , [
20+ 'userID ' => 0 ,
21+ 'username ' => 'System ' ,
22+ ]), true );
23+ WCF ::getSession ()->disableUpdate ();
24+
25+ CronjobScheduler::getInstance ()->executeCronjobs ();
2226
2327 // send up to 5 outstanding mails
2428 $ limit = \min (5 , BackgroundQueueHandler::getInstance ()->getRunnableCount ());
Original file line number Diff line number Diff line change 22
33namespace wcf \action ;
44
5- use wcf \data \cronjob \CronjobAction ;
5+ use wcf \data \user \User ;
6+ use wcf \system \cronjob \CronjobScheduler ;
7+ use wcf \system \WCF ;
68
79/**
810 * executes cronjobs on page calls - or prevents execution
@@ -22,7 +24,12 @@ public function execute()
2224 {
2325 parent ::execute ();
2426
25- $ action = new CronjobAction ([], 'executeCronjobs ' );
26- $ action ->executeAction ();
27+ WCF ::getSession ()->changeUser (new User (null , [
28+ 'userID ' => 0 ,
29+ 'username ' => 'System ' ,
30+ ]), true );
31+ WCF ::getSession ()->disableUpdate ();
32+
33+ CronjobScheduler::getInstance ()->executeCronjobs ();
2734 }
2835}
Original file line number Diff line number Diff line change 44 <!-- de.mysterycode.wcf.cron -->
55 <packagename >External Cronjob Execution API</packagename >
66 <packagedescription >Disables automatic cronjob execution and implements a script callable via browser or shell.</packagedescription >
7- <version >1.1.4 </version >
8- <date >2023-03-31 </date >
7+ <version >1.1.5 </version >
8+ <date >2024-09-14 </date >
99 </packageinformation >
1010 <authorinformation >
1111 <author >Florian Gail, Morik</author >
1212 <authorurl >https://www.mysterycode.de</authorurl >
1313 </authorinformation >
1414 <requiredpackages >
15- <requiredpackage minversion =" 5.5.0 " >com.woltlab.wcf</requiredpackage >
15+ <requiredpackage minversion =" 6.0.17 " >com.woltlab.wcf</requiredpackage >
1616 </requiredpackages >
1717 <excludedpackages >
18- <excludedpackage version =" 6.1 .0 Alpha 1" >com.woltlab.wcf</excludedpackage >
18+ <excludedpackage version =" 6.2 .0 dev 1" >com.woltlab.wcf</excludedpackage >
1919 </excludedpackages >
2020 <instructions type =" install" >
2121 <instruction type =" file" />
2727 <instruction type =" file" />
2828 <instruction type =" language" />
2929 </instructions >
30+ <instructions type =" update" fromversion =" 1.1.4" >
31+ <instruction type =" file" />
32+ </instructions >
3033</package >
You can’t perform that action at this time.
0 commit comments