X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=bin%2Fauth_ejabberd.php;h=5ccdd0174bb5068cea5d3716ca5903e6241e4825;hb=d0068170db2624f14aed6b5d801c948cdf5cbc90;hp=8a5c43c6dfb0ec274f251d415844679f800e47c6;hpb=5e6e1a80250a9b03a0689bbda92a6a66140cc669;p=friendica.git diff --git a/bin/auth_ejabberd.php b/bin/auth_ejabberd.php index 8a5c43c6df..5ccdd0174b 100755 --- a/bin/auth_ejabberd.php +++ b/bin/auth_ejabberd.php @@ -32,11 +32,11 @@ * */ -use Friendica\App; -use Friendica\Core\Config; -use Friendica\Factory; -use Friendica\Util\BasePath; +use Dice\Dice; +use Friendica\App\Mode; +use Friendica\BaseObject; use Friendica\Util\ExAuth; +use Psr\Log\LoggerInterface; if (sizeof($_SERVER["argv"]) == 0) { die(); @@ -54,15 +54,14 @@ chdir($directory); require dirname(__DIR__) . '/vendor/autoload.php'; -$basedir = BasePath::create(dirname(__DIR__), $_SERVER); -$configLoader = new Config\ConfigCacheLoader($basedir); -$config = Factory\ConfigFactory::createCache($configLoader); -$logger = Factory\LoggerFactory::create('auth_ejabberd', $config); -$profiler = Factory\ProfilerFactory::create($config); +$dice = (new Dice())->addRules(include __DIR__ . '/../static/dependencies.config.php'); +$dice = $dice->addRule(LoggerInterface::class,['constructParams' => ['auth_ejabberd']]); -$a = new App($config, $logger, $profiler); +BaseObject::setDependencyInjection($dice); -if ($a->getMode()->isNormal()) { +$appMode = $dice->create(Mode::class); + +if ($appMode->isNormal()) { $oAuth = new ExAuth(); $oAuth->readStdin(); }