X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=bin%2Fworker.php;h=2b5915f471d4fc76b9fdfdee1bad2ff42318cea0;hb=5e3a55915d7fdd554d711b2b5b619552a492c090;hp=53033312769a41992a6ce1f2794bbfeadba249f6;hpb=80f1feabe5ecf9b09b76627ba4b114ae10ddcaf6;p=friendica.git diff --git a/bin/worker.php b/bin/worker.php index 5303331276..2b5915f471 100755 --- a/bin/worker.php +++ b/bin/worker.php @@ -7,11 +7,9 @@ use Friendica\App; use Friendica\Core\Config; -use Friendica\Core\Config\Cache; use Friendica\Core\Update; use Friendica\Core\Worker; use Friendica\Factory; -use Friendica\Util\BasePath; // Get options $shortopts = 'sn'; @@ -32,20 +30,10 @@ if (!file_exists("boot.php") && (sizeof($_SERVER["argv"]) != 0)) { require dirname(__DIR__) . '/vendor/autoload.php'; -$basedir = BasePath::create(dirname(__DIR__), $_SERVER); -$configLoader = new Cache\ConfigCacheLoader($basedir); -$configCache = Factory\ConfigFactory::createCache($configLoader); -Factory\DBFactory::init($configCache, $_SERVER); -$config = Factory\ConfigFactory::createConfig($configCache); -// needed to call PConfig::init() -Factory\ConfigFactory::createPConfig($configCache); -$logger = Factory\LoggerFactory::create('worker', $config); -$profiler = Factory\ProfilerFactory::create($logger, $config); - -$a = new App($config, $logger, $profiler); +$a = Factory\DependencyFactory::setUp('worker', dirname(__DIR__)); // Check the database structure and possibly fixes it -Update::check($a->getBasePath(), true); +Update::check($a->getBasePath(), true, $a->getMode()); // Quit when in maintenance if (!$a->getMode()->has(App\Mode::MAINTENANCEDISABLED)) {