]> git.mxchange.org Git - friendica.git/blobdiff - bin/auth_ejabberd.php
Merge pull request #7806 from tobiasd/20191102-csvexport
[friendica.git] / bin / auth_ejabberd.php
index 6c078e2249dbb016cfa038a10ffafac7035093e3..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,11 +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']]);
 
-$oAuth = new ExAuth();
+BaseObject::setDependencyInjection($dice);
 
-$oAuth->readStdin();
\ No newline at end of file
+$appMode = $dice->create(Mode::class);
+
+if ($appMode->isNormal()) {
+       $oAuth = new ExAuth();
+       $oAuth->readStdin();
+}