]> git.mxchange.org Git - friendica.git/blobdiff - bin/auth_ejabberd.php
Pinned items are always at the top
[friendica.git] / bin / auth_ejabberd.php
index 7ad28c96f5660c3c8da843c91c97b3b308404426..5ccdd0174bb5068cea5d3716ca5903e6241e4825 100755 (executable)
  *
  */
 
-use Friendica\App;
+use Dice\Dice;
+use Friendica\App\Mode;
+use Friendica\BaseObject;
 use Friendica\Util\ExAuth;
+use Psr\Log\LoggerInterface;
 
 if (sizeof($_SERVER["argv"]) == 0) {
        die();
@@ -49,12 +52,16 @@ $directory = realpath($directory . DIRECTORY_SEPARATOR . "..");
 
 chdir($directory);
 
-require_once "boot.php";
-require_once "include/dba.php";
+require dirname(__DIR__) . '/vendor/autoload.php';
 
-$a = new App(dirname(__DIR__));
+$dice = (new Dice())->addRules(include __DIR__ . '/../static/dependencies.config.php');
+$dice = $dice->addRule(LoggerInterface::class,['constructParams' => ['auth_ejabberd']]);
 
-if ($a->mode === App::MODE_NORMAL) {
+BaseObject::setDependencyInjection($dice);
+
+$appMode = $dice->create(Mode::class);
+
+if ($appMode->isNormal()) {
        $oAuth = new ExAuth();
        $oAuth->readStdin();
-}
\ No newline at end of file
+}