$pServ->loadPluginsRegistry(AJXP_INSTALL_PATH . "/plugins", $confPlugin); ConfService::start(); $confStorageDriver = ConfService::getConfStorageImpl(); require_once $confStorageDriver->getUserClassFileName(); session_name("AjaXplorer"); session_start(); AuthService::$useSession = false; AuthService::logUser(AJXP_API_USER, "", true); $authDriver = ConfService::getAuthDriverImpl(); $uri = $_SERVER["REQUEST_URI"]; $scriptUri = ltrim(dirname($_SERVER["SCRIPT_NAME"]), '/') . "/api/"; $uri = substr($uri, strlen($scriptUri)); $uri = explode("/", $uri); // GET REPO ID $repoID = array_shift($uri); // GET ACTION NAME $action = array_shift($uri); $path = "/" . implode("/", $uri); $repo =& ConfService::findRepositoryByIdOrAlias($repoID); if ($repo == null) { die("Cannot find repository with ID " . $repoID); } ConfService::switchRootDir($repo->getId()); // DRIVERS BELOW NEED IDENTIFICATION CHECK if (!AuthService::usersEnabled() || ConfService::getCoreConf("ALLOW_GUEST_BROWSING", "auth") || AuthService::getLoggedUser() != null) { $confDriver = ConfService::getConfStorageImpl(); $Driver = ConfService::loadDriverForRepository($repo); } AJXP_PluginsService::getInstance()->initActivePlugins(); AJXP_Controller::findRestActionAndApply($action, $path);