2022-07-01 09:18:23 +00:00
|
|
|
<?php
|
|
|
|
|
2022-11-03 14:22:36 +00:00
|
|
|
use Opf\ScimServer;
|
2022-07-01 09:18:23 +00:00
|
|
|
|
2022-11-03 14:22:36 +00:00
|
|
|
require __DIR__ . '/../vendor/autoload.php';
|
2022-07-01 09:18:23 +00:00
|
|
|
|
2022-11-03 14:22:36 +00:00
|
|
|
// Obtain the root of the project
|
|
|
|
$scimServerPhpRoot = dirname(__DIR__);
|
2022-07-01 09:18:23 +00:00
|
|
|
|
2022-11-03 14:22:36 +00:00
|
|
|
// Create a new ScimServer instance and give it the project root
|
|
|
|
$scimServer = new ScimServer($scimServerPhpRoot);
|
2022-07-01 09:18:23 +00:00
|
|
|
|
2022-11-03 14:22:36 +00:00
|
|
|
// Take the config file path and pass it to the scimServer instance
|
|
|
|
$configFilePath = __DIR__ . '/../config/config.php';
|
|
|
|
$scimServer->setConfig($configFilePath);
|
2022-07-01 09:18:23 +00:00
|
|
|
|
2022-11-03 14:22:36 +00:00
|
|
|
// Obtain custom dependencies (if any) and pass them to the scimServer instance
|
|
|
|
$dependencies = require __DIR__ . '/../src/Dependencies/mock-dependencies.php';
|
|
|
|
$scimServer->setDependencies($dependencies);
|
2022-07-01 09:18:23 +00:00
|
|
|
|
2022-11-03 14:22:36 +00:00
|
|
|
// Set the Authentication Middleware configured in the dependencies files above to the scimServer instance
|
|
|
|
//$scimServerPhpAuthMiddleware = 'AuthMiddleware';
|
|
|
|
//$scimServer->setMiddleware(array($scimServerPhpAuthMiddleware));
|
2022-07-01 09:18:23 +00:00
|
|
|
|
2022-11-03 14:22:36 +00:00
|
|
|
// Start the scimServer
|
|
|
|
$scimServer->run();
|