]> 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 10b9d874f1f1825b7a242c107728bd9d218df2ba..5ccdd0174bb5068cea5d3716ca5903e6241e4825 100755 (executable)
  *
  */
 
-use Friendica\App;
-use Friendica\Core\Config;
+use Dice\Dice;
+use Friendica\App\Mode;
+use Friendica\BaseObject;
 use Friendica\Util\ExAuth;
+use Psr\Log\LoggerInterface;
 
 if (sizeof($_SERVER["argv"]) == 0) {
        die();
@@ -50,15 +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']]);
 
-@include ".htconfig.php";
-dba::connect($db_host, $db_user, $db_pass, $db_data);
-unset($db_host, $db_user, $db_pass, $db_data);
+BaseObject::setDependencyInjection($dice);
 
-$oAuth = new ExAuth();
+$appMode = $dice->create(Mode::class);
 
-$oAuth->readStdin();
\ No newline at end of file
+if ($appMode->isNormal()) {
+       $oAuth = new ExAuth();
+       $oAuth->readStdin();
+}