@@ -29,27 +29,27 @@ |
||
29 | 29 | |
30 | 30 | try { |
31 | 31 | |
32 | - require_once __DIR__ . '/lib/base.php'; |
|
32 | + require_once __DIR__ . '/lib/base.php'; |
|
33 | 33 | |
34 | - $systemConfig = \OC::$server->getSystemConfig(); |
|
34 | + $systemConfig = \OC::$server->getSystemConfig(); |
|
35 | 35 | |
36 | - $installed = (bool) $systemConfig->getValue('installed', false); |
|
37 | - $maintenance = (bool) $systemConfig->getValue('maintenance', false); |
|
38 | - $values=array( |
|
39 | - 'installed'=>$installed, |
|
40 | - 'maintenance' => $maintenance, |
|
41 | - 'version'=>implode('.', \OCP\Util::getVersion()), |
|
42 | - 'versionstring'=>OC_Util::getVersionString(), |
|
43 | - 'edition'=> $installed ? OC_Util::getEditionString() : ''); |
|
44 | - if (OC::$CLI) { |
|
45 | - print_r($values); |
|
46 | - } else { |
|
47 | - header('Access-Control-Allow-Origin: *'); |
|
48 | - header('Content-Type: application/json'); |
|
49 | - echo json_encode($values); |
|
50 | - } |
|
36 | + $installed = (bool) $systemConfig->getValue('installed', false); |
|
37 | + $maintenance = (bool) $systemConfig->getValue('maintenance', false); |
|
38 | + $values=array( |
|
39 | + 'installed'=>$installed, |
|
40 | + 'maintenance' => $maintenance, |
|
41 | + 'version'=>implode('.', \OCP\Util::getVersion()), |
|
42 | + 'versionstring'=>OC_Util::getVersionString(), |
|
43 | + 'edition'=> $installed ? OC_Util::getEditionString() : ''); |
|
44 | + if (OC::$CLI) { |
|
45 | + print_r($values); |
|
46 | + } else { |
|
47 | + header('Access-Control-Allow-Origin: *'); |
|
48 | + header('Content-Type: application/json'); |
|
49 | + echo json_encode($values); |
|
50 | + } |
|
51 | 51 | |
52 | 52 | } catch (Exception $ex) { |
53 | - OC_Response::setStatus(OC_Response::STATUS_INTERNAL_SERVER_ERROR); |
|
54 | - \OCP\Util::writeLog('remote', $ex->getMessage(), \OCP\Util::FATAL); |
|
53 | + OC_Response::setStatus(OC_Response::STATUS_INTERNAL_SERVER_ERROR); |
|
54 | + \OCP\Util::writeLog('remote', $ex->getMessage(), \OCP\Util::FATAL); |
|
55 | 55 | } |
@@ -29,13 +29,13 @@ |
||
29 | 29 | |
30 | 30 | try { |
31 | 31 | |
32 | - require_once __DIR__ . '/lib/base.php'; |
|
32 | + require_once __DIR__.'/lib/base.php'; |
|
33 | 33 | |
34 | 34 | $systemConfig = \OC::$server->getSystemConfig(); |
35 | 35 | |
36 | 36 | $installed = (bool) $systemConfig->getValue('installed', false); |
37 | 37 | $maintenance = (bool) $systemConfig->getValue('maintenance', false); |
38 | - $values=array( |
|
38 | + $values = array( |
|
39 | 39 | 'installed'=>$installed, |
40 | 40 | 'maintenance' => $maintenance, |
41 | 41 | 'version'=>implode('.', \OCP\Util::getVersion()), |
@@ -27,61 +27,61 @@ |
||
27 | 27 | */ |
28 | 28 | try { |
29 | 29 | |
30 | - require_once __DIR__ . '/lib/base.php'; |
|
31 | - if (\OCP\Util::needUpgrade()) { |
|
32 | - // since the behavior of apps or remotes are unpredictable during |
|
33 | - // an upgrade, return a 503 directly |
|
34 | - OC_Response::setStatus(OC_Response::STATUS_SERVICE_UNAVAILABLE); |
|
35 | - OC_Template::printErrorPage('Service unavailable'); |
|
36 | - exit; |
|
37 | - } |
|
30 | + require_once __DIR__ . '/lib/base.php'; |
|
31 | + if (\OCP\Util::needUpgrade()) { |
|
32 | + // since the behavior of apps or remotes are unpredictable during |
|
33 | + // an upgrade, return a 503 directly |
|
34 | + OC_Response::setStatus(OC_Response::STATUS_SERVICE_UNAVAILABLE); |
|
35 | + OC_Template::printErrorPage('Service unavailable'); |
|
36 | + exit; |
|
37 | + } |
|
38 | 38 | |
39 | - OC::checkMaintenanceMode(); |
|
40 | - OC::checkSingleUserMode(true); |
|
41 | - $request = \OC::$server->getRequest(); |
|
42 | - $pathInfo = $request->getPathInfo(); |
|
39 | + OC::checkMaintenanceMode(); |
|
40 | + OC::checkSingleUserMode(true); |
|
41 | + $request = \OC::$server->getRequest(); |
|
42 | + $pathInfo = $request->getPathInfo(); |
|
43 | 43 | |
44 | - if (!$pathInfo && $request->getParam('service', '') === '') { |
|
45 | - header('HTTP/1.0 404 Not Found'); |
|
46 | - exit; |
|
47 | - } elseif ($request->getParam('service', '')) { |
|
48 | - $service = $request->getParam('service', ''); |
|
49 | - } else { |
|
50 | - $pathInfo = trim($pathInfo, '/'); |
|
51 | - list($service) = explode('/', $pathInfo); |
|
52 | - } |
|
53 | - $file = OCP\CONFIG::getAppValue('core', 'public_' . strip_tags($service)); |
|
54 | - if (is_null($file)) { |
|
55 | - header('HTTP/1.0 404 Not Found'); |
|
56 | - exit; |
|
57 | - } |
|
44 | + if (!$pathInfo && $request->getParam('service', '') === '') { |
|
45 | + header('HTTP/1.0 404 Not Found'); |
|
46 | + exit; |
|
47 | + } elseif ($request->getParam('service', '')) { |
|
48 | + $service = $request->getParam('service', ''); |
|
49 | + } else { |
|
50 | + $pathInfo = trim($pathInfo, '/'); |
|
51 | + list($service) = explode('/', $pathInfo); |
|
52 | + } |
|
53 | + $file = OCP\CONFIG::getAppValue('core', 'public_' . strip_tags($service)); |
|
54 | + if (is_null($file)) { |
|
55 | + header('HTTP/1.0 404 Not Found'); |
|
56 | + exit; |
|
57 | + } |
|
58 | 58 | |
59 | - $parts = explode('/', $file, 2); |
|
60 | - $app = $parts[0]; |
|
59 | + $parts = explode('/', $file, 2); |
|
60 | + $app = $parts[0]; |
|
61 | 61 | |
62 | - // Load all required applications |
|
63 | - \OC::$REQUESTEDAPP = $app; |
|
64 | - OC_App::loadApps(array('authentication')); |
|
65 | - OC_App::loadApps(array('filesystem', 'logging')); |
|
62 | + // Load all required applications |
|
63 | + \OC::$REQUESTEDAPP = $app; |
|
64 | + OC_App::loadApps(array('authentication')); |
|
65 | + OC_App::loadApps(array('filesystem', 'logging')); |
|
66 | 66 | |
67 | - if (!\OC::$server->getAppManager()->isInstalled($app)) { |
|
68 | - throw new Exception('App not installed: ' . $app); |
|
69 | - } |
|
70 | - OC_App::loadApp($app); |
|
71 | - OC_User::setIncognitoMode(true); |
|
67 | + if (!\OC::$server->getAppManager()->isInstalled($app)) { |
|
68 | + throw new Exception('App not installed: ' . $app); |
|
69 | + } |
|
70 | + OC_App::loadApp($app); |
|
71 | + OC_User::setIncognitoMode(true); |
|
72 | 72 | |
73 | - $baseuri = OC::$WEBROOT . '/public.php/' . $service . '/'; |
|
73 | + $baseuri = OC::$WEBROOT . '/public.php/' . $service . '/'; |
|
74 | 74 | |
75 | - require_once OC_App::getAppPath($app) . '/' . $parts[1]; |
|
75 | + require_once OC_App::getAppPath($app) . '/' . $parts[1]; |
|
76 | 76 | |
77 | 77 | } catch (\OC\ServiceUnavailableException $ex) { |
78 | - //show the user a detailed error page |
|
79 | - OC_Response::setStatus(OC_Response::STATUS_SERVICE_UNAVAILABLE); |
|
80 | - \OCP\Util::writeLog('remote', $ex->getMessage(), \OCP\Util::FATAL); |
|
81 | - OC_Template::printExceptionErrorPage($ex); |
|
78 | + //show the user a detailed error page |
|
79 | + OC_Response::setStatus(OC_Response::STATUS_SERVICE_UNAVAILABLE); |
|
80 | + \OCP\Util::writeLog('remote', $ex->getMessage(), \OCP\Util::FATAL); |
|
81 | + OC_Template::printExceptionErrorPage($ex); |
|
82 | 82 | } catch (Exception $ex) { |
83 | - //show the user a detailed error page |
|
84 | - OC_Response::setStatus(OC_Response::STATUS_INTERNAL_SERVER_ERROR); |
|
85 | - \OCP\Util::writeLog('remote', $ex->getMessage(), \OCP\Util::FATAL); |
|
86 | - OC_Template::printExceptionErrorPage($ex); |
|
83 | + //show the user a detailed error page |
|
84 | + OC_Response::setStatus(OC_Response::STATUS_INTERNAL_SERVER_ERROR); |
|
85 | + \OCP\Util::writeLog('remote', $ex->getMessage(), \OCP\Util::FATAL); |
|
86 | + OC_Template::printExceptionErrorPage($ex); |
|
87 | 87 | } |
@@ -27,7 +27,7 @@ discard block |
||
27 | 27 | */ |
28 | 28 | try { |
29 | 29 | |
30 | - require_once __DIR__ . '/lib/base.php'; |
|
30 | + require_once __DIR__.'/lib/base.php'; |
|
31 | 31 | if (\OCP\Util::needUpgrade()) { |
32 | 32 | // since the behavior of apps or remotes are unpredictable during |
33 | 33 | // an upgrade, return a 503 directly |
@@ -50,7 +50,7 @@ discard block |
||
50 | 50 | $pathInfo = trim($pathInfo, '/'); |
51 | 51 | list($service) = explode('/', $pathInfo); |
52 | 52 | } |
53 | - $file = OCP\CONFIG::getAppValue('core', 'public_' . strip_tags($service)); |
|
53 | + $file = OCP\CONFIG::getAppValue('core', 'public_'.strip_tags($service)); |
|
54 | 54 | if (is_null($file)) { |
55 | 55 | header('HTTP/1.0 404 Not Found'); |
56 | 56 | exit; |
@@ -65,14 +65,14 @@ discard block |
||
65 | 65 | OC_App::loadApps(array('filesystem', 'logging')); |
66 | 66 | |
67 | 67 | if (!\OC::$server->getAppManager()->isInstalled($app)) { |
68 | - throw new Exception('App not installed: ' . $app); |
|
68 | + throw new Exception('App not installed: '.$app); |
|
69 | 69 | } |
70 | 70 | OC_App::loadApp($app); |
71 | 71 | OC_User::setIncognitoMode(true); |
72 | 72 | |
73 | - $baseuri = OC::$WEBROOT . '/public.php/' . $service . '/'; |
|
73 | + $baseuri = OC::$WEBROOT.'/public.php/'.$service.'/'; |
|
74 | 74 | |
75 | - require_once OC_App::getAppPath($app) . '/' . $parts[1]; |
|
75 | + require_once OC_App::getAppPath($app).'/'.$parts[1]; |
|
76 | 76 | |
77 | 77 | } catch (\OC\ServiceUnavailableException $ex) { |
78 | 78 | //show the user a detailed error page |
@@ -44,100 +44,100 @@ |
||
44 | 44 | * @param Exception $e |
45 | 45 | */ |
46 | 46 | function handleException(Exception $e) { |
47 | - $request = \OC::$server->getRequest(); |
|
48 | - // in case the request content type is text/xml - we assume it's a WebDAV request |
|
49 | - $isXmlContentType = strpos($request->getHeader('Content-Type'), 'text/xml'); |
|
50 | - if ($isXmlContentType === 0) { |
|
51 | - // fire up a simple server to properly process the exception |
|
52 | - $server = new Server(); |
|
53 | - if (!($e instanceof RemoteException)) { |
|
54 | - // we shall not log on RemoteException |
|
55 | - $server->addPlugin(new ExceptionLoggerPlugin('webdav', \OC::$server->getLogger())); |
|
56 | - } |
|
57 | - $server->on('beforeMethod', function () use ($e) { |
|
58 | - if ($e instanceof RemoteException) { |
|
59 | - switch ($e->getCode()) { |
|
60 | - case OC_Response::STATUS_SERVICE_UNAVAILABLE: |
|
61 | - throw new ServiceUnavailable($e->getMessage()); |
|
62 | - case OC_Response::STATUS_NOT_FOUND: |
|
63 | - throw new \Sabre\DAV\Exception\NotFound($e->getMessage()); |
|
64 | - } |
|
65 | - } |
|
66 | - $class = get_class($e); |
|
67 | - $msg = $e->getMessage(); |
|
68 | - throw new ServiceUnavailable("$class: $msg"); |
|
69 | - }); |
|
70 | - $server->exec(); |
|
71 | - } else { |
|
72 | - $statusCode = OC_Response::STATUS_INTERNAL_SERVER_ERROR; |
|
73 | - if ($e instanceof \OC\ServiceUnavailableException ) { |
|
74 | - $statusCode = OC_Response::STATUS_SERVICE_UNAVAILABLE; |
|
75 | - } |
|
76 | - if ($e instanceof RemoteException) { |
|
77 | - // we shall not log on RemoteException |
|
78 | - OC_Response::setStatus($e->getCode()); |
|
79 | - OC_Template::printErrorPage($e->getMessage()); |
|
80 | - } else { |
|
81 | - \OCP\Util::writeLog('remote', $e->getMessage(), \OCP\Util::FATAL); |
|
82 | - OC_Response::setStatus($statusCode); |
|
83 | - OC_Template::printExceptionErrorPage($e); |
|
84 | - } |
|
85 | - } |
|
47 | + $request = \OC::$server->getRequest(); |
|
48 | + // in case the request content type is text/xml - we assume it's a WebDAV request |
|
49 | + $isXmlContentType = strpos($request->getHeader('Content-Type'), 'text/xml'); |
|
50 | + if ($isXmlContentType === 0) { |
|
51 | + // fire up a simple server to properly process the exception |
|
52 | + $server = new Server(); |
|
53 | + if (!($e instanceof RemoteException)) { |
|
54 | + // we shall not log on RemoteException |
|
55 | + $server->addPlugin(new ExceptionLoggerPlugin('webdav', \OC::$server->getLogger())); |
|
56 | + } |
|
57 | + $server->on('beforeMethod', function () use ($e) { |
|
58 | + if ($e instanceof RemoteException) { |
|
59 | + switch ($e->getCode()) { |
|
60 | + case OC_Response::STATUS_SERVICE_UNAVAILABLE: |
|
61 | + throw new ServiceUnavailable($e->getMessage()); |
|
62 | + case OC_Response::STATUS_NOT_FOUND: |
|
63 | + throw new \Sabre\DAV\Exception\NotFound($e->getMessage()); |
|
64 | + } |
|
65 | + } |
|
66 | + $class = get_class($e); |
|
67 | + $msg = $e->getMessage(); |
|
68 | + throw new ServiceUnavailable("$class: $msg"); |
|
69 | + }); |
|
70 | + $server->exec(); |
|
71 | + } else { |
|
72 | + $statusCode = OC_Response::STATUS_INTERNAL_SERVER_ERROR; |
|
73 | + if ($e instanceof \OC\ServiceUnavailableException ) { |
|
74 | + $statusCode = OC_Response::STATUS_SERVICE_UNAVAILABLE; |
|
75 | + } |
|
76 | + if ($e instanceof RemoteException) { |
|
77 | + // we shall not log on RemoteException |
|
78 | + OC_Response::setStatus($e->getCode()); |
|
79 | + OC_Template::printErrorPage($e->getMessage()); |
|
80 | + } else { |
|
81 | + \OCP\Util::writeLog('remote', $e->getMessage(), \OCP\Util::FATAL); |
|
82 | + OC_Response::setStatus($statusCode); |
|
83 | + OC_Template::printExceptionErrorPage($e); |
|
84 | + } |
|
85 | + } |
|
86 | 86 | } |
87 | 87 | |
88 | 88 | try { |
89 | - require_once __DIR__ . '/lib/base.php'; |
|
89 | + require_once __DIR__ . '/lib/base.php'; |
|
90 | 90 | |
91 | - if (\OCP\Util::needUpgrade()) { |
|
92 | - // since the behavior of apps or remotes are unpredictable during |
|
93 | - // an upgrade, return a 503 directly |
|
94 | - throw new RemoteException('Service unavailable', OC_Response::STATUS_SERVICE_UNAVAILABLE); |
|
95 | - } |
|
91 | + if (\OCP\Util::needUpgrade()) { |
|
92 | + // since the behavior of apps or remotes are unpredictable during |
|
93 | + // an upgrade, return a 503 directly |
|
94 | + throw new RemoteException('Service unavailable', OC_Response::STATUS_SERVICE_UNAVAILABLE); |
|
95 | + } |
|
96 | 96 | |
97 | - $request = \OC::$server->getRequest(); |
|
98 | - $pathInfo = $request->getPathInfo(); |
|
99 | - if ($pathInfo === false || $pathInfo === '') { |
|
100 | - throw new RemoteException('Path not found', OC_Response::STATUS_NOT_FOUND); |
|
101 | - } |
|
102 | - if (!$pos = strpos($pathInfo, '/', 1)) { |
|
103 | - $pos = strlen($pathInfo); |
|
104 | - } |
|
105 | - $service=substr($pathInfo, 1, $pos-1); |
|
97 | + $request = \OC::$server->getRequest(); |
|
98 | + $pathInfo = $request->getPathInfo(); |
|
99 | + if ($pathInfo === false || $pathInfo === '') { |
|
100 | + throw new RemoteException('Path not found', OC_Response::STATUS_NOT_FOUND); |
|
101 | + } |
|
102 | + if (!$pos = strpos($pathInfo, '/', 1)) { |
|
103 | + $pos = strlen($pathInfo); |
|
104 | + } |
|
105 | + $service=substr($pathInfo, 1, $pos-1); |
|
106 | 106 | |
107 | - $file = \OC::$server->getConfig()->getAppValue('core', 'remote_' . $service); |
|
107 | + $file = \OC::$server->getConfig()->getAppValue('core', 'remote_' . $service); |
|
108 | 108 | |
109 | - if(is_null($file)) { |
|
110 | - throw new RemoteException('Path not found', OC_Response::STATUS_NOT_FOUND); |
|
111 | - } |
|
109 | + if(is_null($file)) { |
|
110 | + throw new RemoteException('Path not found', OC_Response::STATUS_NOT_FOUND); |
|
111 | + } |
|
112 | 112 | |
113 | - // force language as given in the http request |
|
114 | - \OC::$server->getL10NFactory()->setLanguageFromRequest(); |
|
113 | + // force language as given in the http request |
|
114 | + \OC::$server->getL10NFactory()->setLanguageFromRequest(); |
|
115 | 115 | |
116 | - $file=ltrim($file, '/'); |
|
116 | + $file=ltrim($file, '/'); |
|
117 | 117 | |
118 | - $parts=explode('/', $file, 2); |
|
119 | - $app=$parts[0]; |
|
118 | + $parts=explode('/', $file, 2); |
|
119 | + $app=$parts[0]; |
|
120 | 120 | |
121 | - // Load all required applications |
|
122 | - \OC::$REQUESTEDAPP = $app; |
|
123 | - OC_App::loadApps(array('authentication')); |
|
124 | - OC_App::loadApps(array('filesystem', 'logging')); |
|
121 | + // Load all required applications |
|
122 | + \OC::$REQUESTEDAPP = $app; |
|
123 | + OC_App::loadApps(array('authentication')); |
|
124 | + OC_App::loadApps(array('filesystem', 'logging')); |
|
125 | 125 | |
126 | - switch ($app) { |
|
127 | - case 'core': |
|
128 | - $file = OC::$SERVERROOT .'/'. $file; |
|
129 | - break; |
|
130 | - default: |
|
131 | - if (!\OC::$server->getAppManager()->isInstalled($app)) { |
|
132 | - throw new RemoteException('App not installed: ' . $app); |
|
133 | - } |
|
134 | - OC_App::loadApp($app); |
|
135 | - $file = OC_App::getAppPath($app) .'/'. $parts[1]; |
|
136 | - break; |
|
137 | - } |
|
138 | - $baseuri = OC::$WEBROOT . '/remote.php/'.$service.'/'; |
|
139 | - require_once $file; |
|
126 | + switch ($app) { |
|
127 | + case 'core': |
|
128 | + $file = OC::$SERVERROOT .'/'. $file; |
|
129 | + break; |
|
130 | + default: |
|
131 | + if (!\OC::$server->getAppManager()->isInstalled($app)) { |
|
132 | + throw new RemoteException('App not installed: ' . $app); |
|
133 | + } |
|
134 | + OC_App::loadApp($app); |
|
135 | + $file = OC_App::getAppPath($app) .'/'. $parts[1]; |
|
136 | + break; |
|
137 | + } |
|
138 | + $baseuri = OC::$WEBROOT . '/remote.php/'.$service.'/'; |
|
139 | + require_once $file; |
|
140 | 140 | |
141 | 141 | } catch (Exception $ex) { |
142 | - handleException($ex); |
|
142 | + handleException($ex); |
|
143 | 143 | } |
@@ -54,7 +54,7 @@ discard block |
||
54 | 54 | // we shall not log on RemoteException |
55 | 55 | $server->addPlugin(new ExceptionLoggerPlugin('webdav', \OC::$server->getLogger())); |
56 | 56 | } |
57 | - $server->on('beforeMethod', function () use ($e) { |
|
57 | + $server->on('beforeMethod', function() use ($e) { |
|
58 | 58 | if ($e instanceof RemoteException) { |
59 | 59 | switch ($e->getCode()) { |
60 | 60 | case OC_Response::STATUS_SERVICE_UNAVAILABLE: |
@@ -70,7 +70,7 @@ discard block |
||
70 | 70 | $server->exec(); |
71 | 71 | } else { |
72 | 72 | $statusCode = OC_Response::STATUS_INTERNAL_SERVER_ERROR; |
73 | - if ($e instanceof \OC\ServiceUnavailableException ) { |
|
73 | + if ($e instanceof \OC\ServiceUnavailableException) { |
|
74 | 74 | $statusCode = OC_Response::STATUS_SERVICE_UNAVAILABLE; |
75 | 75 | } |
76 | 76 | if ($e instanceof RemoteException) { |
@@ -86,7 +86,7 @@ discard block |
||
86 | 86 | } |
87 | 87 | |
88 | 88 | try { |
89 | - require_once __DIR__ . '/lib/base.php'; |
|
89 | + require_once __DIR__.'/lib/base.php'; |
|
90 | 90 | |
91 | 91 | if (\OCP\Util::needUpgrade()) { |
92 | 92 | // since the behavior of apps or remotes are unpredictable during |
@@ -102,21 +102,21 @@ discard block |
||
102 | 102 | if (!$pos = strpos($pathInfo, '/', 1)) { |
103 | 103 | $pos = strlen($pathInfo); |
104 | 104 | } |
105 | - $service=substr($pathInfo, 1, $pos-1); |
|
105 | + $service = substr($pathInfo, 1, $pos - 1); |
|
106 | 106 | |
107 | - $file = \OC::$server->getConfig()->getAppValue('core', 'remote_' . $service); |
|
107 | + $file = \OC::$server->getConfig()->getAppValue('core', 'remote_'.$service); |
|
108 | 108 | |
109 | - if(is_null($file)) { |
|
109 | + if (is_null($file)) { |
|
110 | 110 | throw new RemoteException('Path not found', OC_Response::STATUS_NOT_FOUND); |
111 | 111 | } |
112 | 112 | |
113 | 113 | // force language as given in the http request |
114 | 114 | \OC::$server->getL10NFactory()->setLanguageFromRequest(); |
115 | 115 | |
116 | - $file=ltrim($file, '/'); |
|
116 | + $file = ltrim($file, '/'); |
|
117 | 117 | |
118 | - $parts=explode('/', $file, 2); |
|
119 | - $app=$parts[0]; |
|
118 | + $parts = explode('/', $file, 2); |
|
119 | + $app = $parts[0]; |
|
120 | 120 | |
121 | 121 | // Load all required applications |
122 | 122 | \OC::$REQUESTEDAPP = $app; |
@@ -125,17 +125,17 @@ discard block |
||
125 | 125 | |
126 | 126 | switch ($app) { |
127 | 127 | case 'core': |
128 | - $file = OC::$SERVERROOT .'/'. $file; |
|
128 | + $file = OC::$SERVERROOT.'/'.$file; |
|
129 | 129 | break; |
130 | 130 | default: |
131 | 131 | if (!\OC::$server->getAppManager()->isInstalled($app)) { |
132 | - throw new RemoteException('App not installed: ' . $app); |
|
132 | + throw new RemoteException('App not installed: '.$app); |
|
133 | 133 | } |
134 | 134 | OC_App::loadApp($app); |
135 | - $file = OC_App::getAppPath($app) .'/'. $parts[1]; |
|
135 | + $file = OC_App::getAppPath($app).'/'.$parts[1]; |
|
136 | 136 | break; |
137 | 137 | } |
138 | - $baseuri = OC::$WEBROOT . '/remote.php/'.$service.'/'; |
|
138 | + $baseuri = OC::$WEBROOT.'/remote.php/'.$service.'/'; |
|
139 | 139 | require_once $file; |
140 | 140 | |
141 | 141 | } catch (Exception $ex) { |
@@ -40,68 +40,68 @@ |
||
40 | 40 | */ |
41 | 41 | interface UserInterface { |
42 | 42 | |
43 | - /** |
|
44 | - * Check if backend implements actions |
|
45 | - * @param int $actions bitwise-or'ed actions |
|
46 | - * @return boolean |
|
47 | - * |
|
48 | - * Returns the supported actions as int to be |
|
49 | - * compared with \OC_User_Backend::CREATE_USER etc. |
|
50 | - * @since 4.5.0 |
|
51 | - */ |
|
52 | - public function implementsActions($actions); |
|
43 | + /** |
|
44 | + * Check if backend implements actions |
|
45 | + * @param int $actions bitwise-or'ed actions |
|
46 | + * @return boolean |
|
47 | + * |
|
48 | + * Returns the supported actions as int to be |
|
49 | + * compared with \OC_User_Backend::CREATE_USER etc. |
|
50 | + * @since 4.5.0 |
|
51 | + */ |
|
52 | + public function implementsActions($actions); |
|
53 | 53 | |
54 | - /** |
|
55 | - * delete a user |
|
56 | - * @param string $uid The username of the user to delete |
|
57 | - * @return bool |
|
58 | - * @since 4.5.0 |
|
59 | - */ |
|
60 | - public function deleteUser($uid); |
|
54 | + /** |
|
55 | + * delete a user |
|
56 | + * @param string $uid The username of the user to delete |
|
57 | + * @return bool |
|
58 | + * @since 4.5.0 |
|
59 | + */ |
|
60 | + public function deleteUser($uid); |
|
61 | 61 | |
62 | - /** |
|
63 | - * Get a list of all users |
|
64 | - * |
|
65 | - * @param string $search |
|
66 | - * @param null|int $limit |
|
67 | - * @param null|int $offset |
|
68 | - * @return string[] an array of all uids |
|
69 | - * @since 4.5.0 |
|
70 | - */ |
|
71 | - public function getUsers($search = '', $limit = null, $offset = null); |
|
62 | + /** |
|
63 | + * Get a list of all users |
|
64 | + * |
|
65 | + * @param string $search |
|
66 | + * @param null|int $limit |
|
67 | + * @param null|int $offset |
|
68 | + * @return string[] an array of all uids |
|
69 | + * @since 4.5.0 |
|
70 | + */ |
|
71 | + public function getUsers($search = '', $limit = null, $offset = null); |
|
72 | 72 | |
73 | - /** |
|
74 | - * check if a user exists |
|
75 | - * @param string $uid the username |
|
76 | - * @return boolean |
|
77 | - * @since 4.5.0 |
|
78 | - */ |
|
79 | - public function userExists($uid); |
|
73 | + /** |
|
74 | + * check if a user exists |
|
75 | + * @param string $uid the username |
|
76 | + * @return boolean |
|
77 | + * @since 4.5.0 |
|
78 | + */ |
|
79 | + public function userExists($uid); |
|
80 | 80 | |
81 | - /** |
|
82 | - * get display name of the user |
|
83 | - * @param string $uid user ID of the user |
|
84 | - * @return string display name |
|
85 | - * @since 4.5.0 |
|
86 | - */ |
|
87 | - public function getDisplayName($uid); |
|
81 | + /** |
|
82 | + * get display name of the user |
|
83 | + * @param string $uid user ID of the user |
|
84 | + * @return string display name |
|
85 | + * @since 4.5.0 |
|
86 | + */ |
|
87 | + public function getDisplayName($uid); |
|
88 | 88 | |
89 | - /** |
|
90 | - * Get a list of all display names and user ids. |
|
91 | - * |
|
92 | - * @param string $search |
|
93 | - * @param string|null $limit |
|
94 | - * @param string|null $offset |
|
95 | - * @return array an array of all displayNames (value) and the corresponding uids (key) |
|
96 | - * @since 4.5.0 |
|
97 | - */ |
|
98 | - public function getDisplayNames($search = '', $limit = null, $offset = null); |
|
89 | + /** |
|
90 | + * Get a list of all display names and user ids. |
|
91 | + * |
|
92 | + * @param string $search |
|
93 | + * @param string|null $limit |
|
94 | + * @param string|null $offset |
|
95 | + * @return array an array of all displayNames (value) and the corresponding uids (key) |
|
96 | + * @since 4.5.0 |
|
97 | + */ |
|
98 | + public function getDisplayNames($search = '', $limit = null, $offset = null); |
|
99 | 99 | |
100 | - /** |
|
101 | - * Check if a user list is available or not |
|
102 | - * @return boolean if users can be listed or not |
|
103 | - * @since 4.5.0 |
|
104 | - */ |
|
105 | - public function hasUserListings(); |
|
100 | + /** |
|
101 | + * Check if a user list is available or not |
|
102 | + * @return boolean if users can be listed or not |
|
103 | + * @since 4.5.0 |
|
104 | + */ |
|
105 | + public function hasUserListings(); |
|
106 | 106 | |
107 | 107 | } |
@@ -25,56 +25,56 @@ |
||
25 | 25 | * @since 8.2.0 |
26 | 26 | */ |
27 | 27 | interface IFactory { |
28 | - /** |
|
29 | - * Get a language instance |
|
30 | - * |
|
31 | - * @param string $app |
|
32 | - * @param string|null $lang |
|
33 | - * @return \OCP\IL10N |
|
34 | - * @since 8.2.0 |
|
35 | - */ |
|
36 | - public function get($app, $lang = null); |
|
28 | + /** |
|
29 | + * Get a language instance |
|
30 | + * |
|
31 | + * @param string $app |
|
32 | + * @param string|null $lang |
|
33 | + * @return \OCP\IL10N |
|
34 | + * @since 8.2.0 |
|
35 | + */ |
|
36 | + public function get($app, $lang = null); |
|
37 | 37 | |
38 | - /** |
|
39 | - * Find the best language |
|
40 | - * |
|
41 | - * @param string|null $app App id or null for core |
|
42 | - * @return string language If nothing works it returns 'en' |
|
43 | - * @since 9.0.0 |
|
44 | - */ |
|
45 | - public function findLanguage($app = null); |
|
38 | + /** |
|
39 | + * Find the best language |
|
40 | + * |
|
41 | + * @param string|null $app App id or null for core |
|
42 | + * @return string language If nothing works it returns 'en' |
|
43 | + * @since 9.0.0 |
|
44 | + */ |
|
45 | + public function findLanguage($app = null); |
|
46 | 46 | |
47 | - /** |
|
48 | - * Find all available languages for an app |
|
49 | - * |
|
50 | - * @param string|null $app App id or null for core |
|
51 | - * @return string[] an array of available languages |
|
52 | - * @since 9.0.0 |
|
53 | - */ |
|
54 | - public function findAvailableLanguages($app = null); |
|
47 | + /** |
|
48 | + * Find all available languages for an app |
|
49 | + * |
|
50 | + * @param string|null $app App id or null for core |
|
51 | + * @return string[] an array of available languages |
|
52 | + * @since 9.0.0 |
|
53 | + */ |
|
54 | + public function findAvailableLanguages($app = null); |
|
55 | 55 | |
56 | - /** |
|
57 | - * @param string|null $app App id or null for core |
|
58 | - * @param string $lang |
|
59 | - * @return bool |
|
60 | - * @since 9.0.0 |
|
61 | - */ |
|
62 | - public function languageExists($app, $lang); |
|
56 | + /** |
|
57 | + * @param string|null $app App id or null for core |
|
58 | + * @param string $lang |
|
59 | + * @return bool |
|
60 | + * @since 9.0.0 |
|
61 | + */ |
|
62 | + public function languageExists($app, $lang); |
|
63 | 63 | |
64 | - /** |
|
65 | - * @param string|null $app App id or null for core |
|
66 | - * @return string |
|
67 | - * @since 9.0.0 |
|
68 | - */ |
|
69 | - public function setLanguageFromRequest($app = null); |
|
64 | + /** |
|
65 | + * @param string|null $app App id or null for core |
|
66 | + * @return string |
|
67 | + * @since 9.0.0 |
|
68 | + */ |
|
69 | + public function setLanguageFromRequest($app = null); |
|
70 | 70 | |
71 | 71 | |
72 | - /** |
|
73 | - * Creates a function from the plural string |
|
74 | - * |
|
75 | - * @param string $string |
|
76 | - * @return string Unique function name |
|
77 | - * @since 9.0.0 |
|
78 | - */ |
|
79 | - public function createPluralFunction($string); |
|
72 | + /** |
|
73 | + * Creates a function from the plural string |
|
74 | + * |
|
75 | + * @param string $string |
|
76 | + * @return string Unique function name |
|
77 | + * @since 9.0.0 |
|
78 | + */ |
|
79 | + public function createPluralFunction($string); |
|
80 | 80 | } |
@@ -32,31 +32,31 @@ |
||
32 | 32 | */ |
33 | 33 | class LockedException extends \Exception { |
34 | 34 | |
35 | - /** |
|
36 | - * Locked path |
|
37 | - * |
|
38 | - * @var string |
|
39 | - */ |
|
40 | - private $path; |
|
35 | + /** |
|
36 | + * Locked path |
|
37 | + * |
|
38 | + * @var string |
|
39 | + */ |
|
40 | + private $path; |
|
41 | 41 | |
42 | - /** |
|
43 | - * LockedException constructor. |
|
44 | - * |
|
45 | - * @param string $path locked path |
|
46 | - * @param \Exception $previous previous exception for cascading |
|
47 | - * |
|
48 | - * @since 8.1.0 |
|
49 | - */ |
|
50 | - public function __construct($path, \Exception $previous = null) { |
|
51 | - parent::__construct('"' . $path . '" is locked', 0, $previous); |
|
52 | - $this->path = $path; |
|
53 | - } |
|
42 | + /** |
|
43 | + * LockedException constructor. |
|
44 | + * |
|
45 | + * @param string $path locked path |
|
46 | + * @param \Exception $previous previous exception for cascading |
|
47 | + * |
|
48 | + * @since 8.1.0 |
|
49 | + */ |
|
50 | + public function __construct($path, \Exception $previous = null) { |
|
51 | + parent::__construct('"' . $path . '" is locked', 0, $previous); |
|
52 | + $this->path = $path; |
|
53 | + } |
|
54 | 54 | |
55 | - /** |
|
56 | - * @return string |
|
57 | - * @since 8.1.0 |
|
58 | - */ |
|
59 | - public function getPath() { |
|
60 | - return $this->path; |
|
61 | - } |
|
55 | + /** |
|
56 | + * @return string |
|
57 | + * @since 8.1.0 |
|
58 | + */ |
|
59 | + public function getPath() { |
|
60 | + return $this->path; |
|
61 | + } |
|
62 | 62 | } |
@@ -48,7 +48,7 @@ |
||
48 | 48 | * @since 8.1.0 |
49 | 49 | */ |
50 | 50 | public function __construct($path, \Exception $previous = null) { |
51 | - parent::__construct('"' . $path . '" is locked', 0, $previous); |
|
51 | + parent::__construct('"'.$path.'" is locked', 0, $previous); |
|
52 | 52 | $this->path = $path; |
53 | 53 | } |
54 | 54 |
@@ -30,51 +30,51 @@ |
||
30 | 30 | * @since 8.1.0 |
31 | 31 | */ |
32 | 32 | interface ILockingProvider { |
33 | - /** |
|
34 | - * @since 8.1.0 |
|
35 | - */ |
|
36 | - const LOCK_SHARED = 1; |
|
37 | - /** |
|
38 | - * @since 8.1.0 |
|
39 | - */ |
|
40 | - const LOCK_EXCLUSIVE = 2; |
|
33 | + /** |
|
34 | + * @since 8.1.0 |
|
35 | + */ |
|
36 | + const LOCK_SHARED = 1; |
|
37 | + /** |
|
38 | + * @since 8.1.0 |
|
39 | + */ |
|
40 | + const LOCK_EXCLUSIVE = 2; |
|
41 | 41 | |
42 | - /** |
|
43 | - * @param string $path |
|
44 | - * @param int $type self::LOCK_SHARED or self::LOCK_EXCLUSIVE |
|
45 | - * @return bool |
|
46 | - * @since 8.1.0 |
|
47 | - */ |
|
48 | - public function isLocked($path, $type); |
|
42 | + /** |
|
43 | + * @param string $path |
|
44 | + * @param int $type self::LOCK_SHARED or self::LOCK_EXCLUSIVE |
|
45 | + * @return bool |
|
46 | + * @since 8.1.0 |
|
47 | + */ |
|
48 | + public function isLocked($path, $type); |
|
49 | 49 | |
50 | - /** |
|
51 | - * @param string $path |
|
52 | - * @param int $type self::LOCK_SHARED or self::LOCK_EXCLUSIVE |
|
53 | - * @throws \OCP\Lock\LockedException |
|
54 | - * @since 8.1.0 |
|
55 | - */ |
|
56 | - public function acquireLock($path, $type); |
|
50 | + /** |
|
51 | + * @param string $path |
|
52 | + * @param int $type self::LOCK_SHARED or self::LOCK_EXCLUSIVE |
|
53 | + * @throws \OCP\Lock\LockedException |
|
54 | + * @since 8.1.0 |
|
55 | + */ |
|
56 | + public function acquireLock($path, $type); |
|
57 | 57 | |
58 | - /** |
|
59 | - * @param string $path |
|
60 | - * @param int $type self::LOCK_SHARED or self::LOCK_EXCLUSIVE |
|
61 | - * @since 8.1.0 |
|
62 | - */ |
|
63 | - public function releaseLock($path, $type); |
|
58 | + /** |
|
59 | + * @param string $path |
|
60 | + * @param int $type self::LOCK_SHARED or self::LOCK_EXCLUSIVE |
|
61 | + * @since 8.1.0 |
|
62 | + */ |
|
63 | + public function releaseLock($path, $type); |
|
64 | 64 | |
65 | - /** |
|
66 | - * Change the type of an existing lock |
|
67 | - * |
|
68 | - * @param string $path |
|
69 | - * @param int $targetType self::LOCK_SHARED or self::LOCK_EXCLUSIVE |
|
70 | - * @throws \OCP\Lock\LockedException |
|
71 | - * @since 8.1.0 |
|
72 | - */ |
|
73 | - public function changeLock($path, $targetType); |
|
65 | + /** |
|
66 | + * Change the type of an existing lock |
|
67 | + * |
|
68 | + * @param string $path |
|
69 | + * @param int $targetType self::LOCK_SHARED or self::LOCK_EXCLUSIVE |
|
70 | + * @throws \OCP\Lock\LockedException |
|
71 | + * @since 8.1.0 |
|
72 | + */ |
|
73 | + public function changeLock($path, $targetType); |
|
74 | 74 | |
75 | - /** |
|
76 | - * release all lock acquired by this instance |
|
77 | - * @since 8.1.0 |
|
78 | - */ |
|
79 | - public function releaseAll(); |
|
75 | + /** |
|
76 | + * release all lock acquired by this instance |
|
77 | + * @since 8.1.0 |
|
78 | + */ |
|
79 | + public function releaseAll(); |
|
80 | 80 | } |
@@ -40,68 +40,68 @@ |
||
40 | 40 | */ |
41 | 41 | interface GroupInterface { |
42 | 42 | |
43 | - /** |
|
44 | - * Check if backend implements actions |
|
45 | - * @param int $actions bitwise-or'ed actions |
|
46 | - * @return boolean |
|
47 | - * @since 4.5.0 |
|
48 | - * |
|
49 | - * Returns the supported actions as int to be |
|
50 | - * compared with \OC_Group_Backend::CREATE_GROUP etc. |
|
51 | - */ |
|
52 | - public function implementsActions($actions); |
|
43 | + /** |
|
44 | + * Check if backend implements actions |
|
45 | + * @param int $actions bitwise-or'ed actions |
|
46 | + * @return boolean |
|
47 | + * @since 4.5.0 |
|
48 | + * |
|
49 | + * Returns the supported actions as int to be |
|
50 | + * compared with \OC_Group_Backend::CREATE_GROUP etc. |
|
51 | + */ |
|
52 | + public function implementsActions($actions); |
|
53 | 53 | |
54 | - /** |
|
55 | - * is user in group? |
|
56 | - * @param string $uid uid of the user |
|
57 | - * @param string $gid gid of the group |
|
58 | - * @return bool |
|
59 | - * @since 4.5.0 |
|
60 | - * |
|
61 | - * Checks whether the user is member of a group or not. |
|
62 | - */ |
|
63 | - public function inGroup($uid, $gid); |
|
54 | + /** |
|
55 | + * is user in group? |
|
56 | + * @param string $uid uid of the user |
|
57 | + * @param string $gid gid of the group |
|
58 | + * @return bool |
|
59 | + * @since 4.5.0 |
|
60 | + * |
|
61 | + * Checks whether the user is member of a group or not. |
|
62 | + */ |
|
63 | + public function inGroup($uid, $gid); |
|
64 | 64 | |
65 | - /** |
|
66 | - * Get all groups a user belongs to |
|
67 | - * @param string $uid Name of the user |
|
68 | - * @return array an array of group names |
|
69 | - * @since 4.5.0 |
|
70 | - * |
|
71 | - * This function fetches all groups a user belongs to. It does not check |
|
72 | - * if the user exists at all. |
|
73 | - */ |
|
74 | - public function getUserGroups($uid); |
|
65 | + /** |
|
66 | + * Get all groups a user belongs to |
|
67 | + * @param string $uid Name of the user |
|
68 | + * @return array an array of group names |
|
69 | + * @since 4.5.0 |
|
70 | + * |
|
71 | + * This function fetches all groups a user belongs to. It does not check |
|
72 | + * if the user exists at all. |
|
73 | + */ |
|
74 | + public function getUserGroups($uid); |
|
75 | 75 | |
76 | - /** |
|
77 | - * get a list of all groups |
|
78 | - * @param string $search |
|
79 | - * @param int $limit |
|
80 | - * @param int $offset |
|
81 | - * @return array an array of group names |
|
82 | - * @since 4.5.0 |
|
83 | - * |
|
84 | - * Returns a list with all groups |
|
85 | - */ |
|
86 | - public function getGroups($search = '', $limit = -1, $offset = 0); |
|
76 | + /** |
|
77 | + * get a list of all groups |
|
78 | + * @param string $search |
|
79 | + * @param int $limit |
|
80 | + * @param int $offset |
|
81 | + * @return array an array of group names |
|
82 | + * @since 4.5.0 |
|
83 | + * |
|
84 | + * Returns a list with all groups |
|
85 | + */ |
|
86 | + public function getGroups($search = '', $limit = -1, $offset = 0); |
|
87 | 87 | |
88 | - /** |
|
89 | - * check if a group exists |
|
90 | - * @param string $gid |
|
91 | - * @return bool |
|
92 | - * @since 4.5.0 |
|
93 | - */ |
|
94 | - public function groupExists($gid); |
|
88 | + /** |
|
89 | + * check if a group exists |
|
90 | + * @param string $gid |
|
91 | + * @return bool |
|
92 | + * @since 4.5.0 |
|
93 | + */ |
|
94 | + public function groupExists($gid); |
|
95 | 95 | |
96 | - /** |
|
97 | - * get a list of all users in a group |
|
98 | - * @param string $gid |
|
99 | - * @param string $search |
|
100 | - * @param int $limit |
|
101 | - * @param int $offset |
|
102 | - * @return array an array of user ids |
|
103 | - * @since 4.5.0 |
|
104 | - */ |
|
105 | - public function usersInGroup($gid, $search = '', $limit = -1, $offset = 0); |
|
96 | + /** |
|
97 | + * get a list of all users in a group |
|
98 | + * @param string $gid |
|
99 | + * @param string $search |
|
100 | + * @param int $limit |
|
101 | + * @param int $offset |
|
102 | + * @return array an array of user ids |
|
103 | + * @since 4.5.0 |
|
104 | + */ |
|
105 | + public function usersInGroup($gid, $search = '', $limit = -1, $offset = 0); |
|
106 | 106 | |
107 | 107 | } |
@@ -30,22 +30,22 @@ |
||
30 | 30 | * @since 7.0.0 |
31 | 31 | */ |
32 | 32 | interface ICacheFactory{ |
33 | - /** |
|
34 | - * Get a memory cache instance |
|
35 | - * |
|
36 | - * All entries added trough the cache instance will be namespaced by $prefix to prevent collisions between apps |
|
37 | - * |
|
38 | - * @param string $prefix |
|
39 | - * @return \OCP\ICache |
|
40 | - * @since 7.0.0 |
|
41 | - */ |
|
42 | - public function create($prefix = ''); |
|
33 | + /** |
|
34 | + * Get a memory cache instance |
|
35 | + * |
|
36 | + * All entries added trough the cache instance will be namespaced by $prefix to prevent collisions between apps |
|
37 | + * |
|
38 | + * @param string $prefix |
|
39 | + * @return \OCP\ICache |
|
40 | + * @since 7.0.0 |
|
41 | + */ |
|
42 | + public function create($prefix = ''); |
|
43 | 43 | |
44 | - /** |
|
45 | - * Check if any memory cache backend is available |
|
46 | - * |
|
47 | - * @return bool |
|
48 | - * @since 7.0.0 |
|
49 | - */ |
|
50 | - public function isAvailable(); |
|
44 | + /** |
|
45 | + * Check if any memory cache backend is available |
|
46 | + * |
|
47 | + * @return bool |
|
48 | + * @since 7.0.0 |
|
49 | + */ |
|
50 | + public function isAvailable(); |
|
51 | 51 | } |
@@ -29,7 +29,7 @@ |
||
29 | 29 | * @package OCP |
30 | 30 | * @since 7.0.0 |
31 | 31 | */ |
32 | -interface ICacheFactory{ |
|
32 | +interface ICacheFactory { |
|
33 | 33 | /** |
34 | 34 | * Get a memory cache instance |
35 | 35 | * |