]> git.mxchange.org Git - friendica.git/commitdiff
Move daemon code into anonymous function
authorArt4 <art4@wlabs.de>
Thu, 26 Dec 2024 09:30:44 +0000 (09:30 +0000)
committerArt4 <art4@wlabs.de>
Thu, 26 Dec 2024 09:30:44 +0000 (09:30 +0000)
bin/daemon.php

index caa32f123db89bbf4c3d8b0c1f0b863390025642..40297b358910432480a5a3e6528d95714a296a3a 100755 (executable)
@@ -37,6 +37,7 @@ require dirname(__DIR__) . '/vendor/autoload.php';
 
 $dice = (new Dice())->addRules(require(dirname(__DIR__) . '/static/dependencies.config.php'));
 
+(function (Dice $dice, array $options): void {
 /** @var \Friendica\Core\Addon\Capability\ICanLoadAddons $addonLoader */
 $addonLoader = $dice->create(\Friendica\Core\Addon\Capability\ICanLoadAddons::class);
 $dice = $dice->addRules($addonLoader->getActiveAddonConfig('dependencies'));
@@ -230,6 +231,7 @@ while (true) {
                Logger::info('Worker jobs are calling to be forked.', ['pid' => $pid]);
        }
 }
+})($dice, $options);
 
 function shutdown() {
        posix_kill(posix_getpid(), SIGTERM);