]> git.mxchange.org Git - friendica.git/blobdiff - bin/auth_ejabberd.php
Improved RegExp
[friendica.git] / bin / auth_ejabberd.php
index ba3a9b8dd15b73b556edc34ef29470411896caa8..5ccdd0174bb5068cea5d3716ca5903e6241e4825 100755 (executable)
  *
  */
 
-use Friendica\Factory;
+use Dice\Dice;
+use Friendica\App\Mode;
+use Friendica\BaseObject;
 use Friendica\Util\ExAuth;
+use Psr\Log\LoggerInterface;
 
 if (sizeof($_SERVER["argv"]) == 0) {
        die();
@@ -51,12 +54,14 @@ chdir($directory);
 
 require dirname(__DIR__) . '/vendor/autoload.php';
 
-$dice = new \Dice\Dice();
-$dice = $dice->addRules(include __DIR__ . '/../static/dependencies.config.php');
+$dice = (new Dice())->addRules(include __DIR__ . '/../static/dependencies.config.php');
+$dice = $dice->addRule(LoggerInterface::class,['constructParams' => ['auth_ejabberd']]);
 
-$a = Factory\DependencyFactory::setUp('auth_ejabbered', $dice);
+BaseObject::setDependencyInjection($dice);
 
-if ($a->getMode()->isNormal()) {
+$appMode = $dice->create(Mode::class);
+
+if ($appMode->isNormal()) {
        $oAuth = new ExAuth();
        $oAuth->readStdin();
 }