1

I've installed MediaWiki and am trying to achieve single sign-on, so that when my users sign into their accounts on my Yii2 system, they can also be signed in to the wiki.

So I want to 'Yii-fy' the wiki so I can fiddle about with the auth code.

With this in mind, I've followed the Yii docs and entered the following in the entry page of the wiki, which is in the 'web/wiki' directory:

require(__DIR__ . '/../../vendor/yiisoft/yii2/Yii.php');
$yiiConfig = require(__DIR__ . '/../../config/web.php');
new yii\web\Application($yiiConfig); // Do NOT call run() here

The paths are fine for those files, but then I'm getting:

Previous exception:
exception 'ReflectionException' with message 'Class dektrium\\user\\Module     
does not exist'

My web.php has 'user' as follows:

'user' => [
    'class' => 'dektrium\user\Module',
    'enableRegistration' => false,
],

How can I fix this?

Gary Fox
  • 31
  • 2

1 Answers1

0

Your autoloader must know how to find this class. If you're using composer, add the following in composer.json:

{
   "autoload": {
      "psr-4": {
        "dektrium\\": "[path to dektrium folder]",
      }
    },
}

So, run the composer update to also update the autoloader and get the class registered.

If you are not using composer, you will have to manually register the class in your autoloader.

Jacobson
  • 674
  • 5
  • 10