Esempio n. 1
0
 }
 $request = \OC::$server->getRequest();
 $pathInfo = $request->getPathInfo();
 if ($pathInfo === false || $pathInfo === '') {
     throw new RemoteException('Path not found', OC_Response::STATUS_NOT_FOUND);
 }
 if (!($pos = strpos($pathInfo, '/', 1))) {
     $pos = strlen($pathInfo);
 }
 $service = substr($pathInfo, 1, $pos - 1);
 $file = \OC::$server->getConfig()->getAppValue('core', 'remote_' . $service);
 if (is_null($file)) {
     throw new RemoteException('Path not found', OC_Response::STATUS_NOT_FOUND);
 }
 // force language as given in the http request
 \OC_L10N::setLanguageFromRequest();
 $file = ltrim($file, '/');
 $parts = explode('/', $file, 2);
 $app = $parts[0];
 // Load all required applications
 \OC::$REQUESTEDAPP = $app;
 OC_App::loadApps(array('authentication'));
 OC_App::loadApps(array('filesystem', 'logging'));
 switch ($app) {
     case 'core':
         $file = OC::$SERVERROOT . '/' . $file;
         break;
     default:
         if (!\OC::$server->getAppManager()->isInstalled($app)) {
             throw new RemoteException('App not installed: ' . $app);
         }