diff options
author | Robin Appelman <icewind@owncloud.com> | 2012-05-14 00:28:22 +0200 |
---|---|---|
committer | Robin Appelman <icewind@owncloud.com> | 2012-05-14 00:28:28 +0200 |
commit | e7c106d91e9970b95061eaa2812a0d0c5be72526 (patch) | |
tree | 174f7c63e504da6a5364bdad03514f8ce3e76972 | |
parent | 0fb90fa87568fc12e1f05d45c53ef9cf88991ba6 (diff) | |
download | nextcloud-server-e7c106d91e9970b95061eaa2812a0d0c5be72526.tar.gz nextcloud-server-e7c106d91e9970b95061eaa2812a0d0c5be72526.zip |
selective app loading for remote/public
-rwxr-xr-x | apps/calendar/appinfo/remote.php | 4 | ||||
-rwxr-xr-x | apps/contacts/appinfo/remote.php | 4 | ||||
-rw-r--r-- | apps/files/appinfo/info.xml | 3 | ||||
-rw-r--r-- | apps/files/appinfo/remote.php | 1 | ||||
-rwxr-xr-x | apps/files_sharing/get.php | 4 | ||||
-rw-r--r-- | apps/media/remote.php | 6 | ||||
-rw-r--r-- | lib/app.php | 16 | ||||
-rw-r--r-- | public.php | 9 | ||||
-rw-r--r-- | remote.php | 7 |
9 files changed, 46 insertions, 8 deletions
diff --git a/apps/calendar/appinfo/remote.php b/apps/calendar/appinfo/remote.php index 7ff6a2fbbe2..0673c36540f 100755 --- a/apps/calendar/appinfo/remote.php +++ b/apps/calendar/appinfo/remote.php @@ -7,6 +7,10 @@ */ OCP\App::checkAppEnabled('calendar'); +// only need authentication apps +$RUNTIME_APPTYPES=array('authentication'); +OC_App::loadApps($RUNTIME_APPTYPES); + // Backends $authBackend = new OC_Connector_Sabre_Auth(); $principalBackend = new OC_Connector_Sabre_Principal(); diff --git a/apps/contacts/appinfo/remote.php b/apps/contacts/appinfo/remote.php index 67006b77f97..9a34ecd4a4c 100755 --- a/apps/contacts/appinfo/remote.php +++ b/apps/contacts/appinfo/remote.php @@ -22,6 +22,10 @@ OCP\App::checkAppEnabled('contacts'); +// only need authentication apps +$RUNTIME_APPTYPES=array('authentication'); +OC_App::loadApps($RUNTIME_APPTYPES); + // Backends $authBackend = new OC_Connector_Sabre_Auth(); $principalBackend = new OC_Connector_Sabre_Principal(); diff --git a/apps/files/appinfo/info.xml b/apps/files/appinfo/info.xml index 76a06a0cb4b..92d0a50814e 100644 --- a/apps/files/appinfo/info.xml +++ b/apps/files/appinfo/info.xml @@ -8,6 +8,9 @@ <require>2</require> <standalone/> <default_enable/> + <types> + <filesystem/> + </types> <remote> <files>appinfo/remote.php</files> <webdav>appinfo/remote.php</webdav> diff --git a/apps/files/appinfo/remote.php b/apps/files/appinfo/remote.php index 465e0c0a935..b66843556bb 100644 --- a/apps/files/appinfo/remote.php +++ b/apps/files/appinfo/remote.php @@ -24,6 +24,7 @@ */ // only need filesystem apps $RUNTIME_APPTYPES=array('filesystem','authentication'); +OC_App::loadApps($RUNTIME_APPTYPES); // Backends $authBackend = new OC_Connector_Sabre_Auth(); diff --git a/apps/files_sharing/get.php b/apps/files_sharing/get.php index caf25d00cfd..e326a170075 100755 --- a/apps/files_sharing/get.php +++ b/apps/files_sharing/get.php @@ -1,6 +1,10 @@ <?php $RUNTIME_NOSETUPFS=true; //don't setup the fs yet +// only need authentication apps +$RUNTIME_APPTYPES=array('authentication'); +OC_App::loadApps($RUNTIME_APPTYPES); + OCP\JSON::checkAppEnabled('files_sharing'); require_once 'lib_share.php'; diff --git a/apps/media/remote.php b/apps/media/remote.php index 8a88c2b51ae..01add42b315 100644 --- a/apps/media/remote.php +++ b/apps/media/remote.php @@ -1,7 +1,11 @@ <?php + +// only need filesystem apps +$RUNTIME_APPTYPES=array('filesystem','authentication'); +OC_App::loadApps($RUNTIME_APPTYPES); + if($path_info == '/ampache' || $path_info == '/ampache/'){ require_once(OC::$APPSROOT . '/apps/media/index.php'); }else{ require_once(OC::$APPSROOT . '/apps/media/server/xml.server.php'); } -?>
\ No newline at end of file diff --git a/lib/app.php b/lib/app.php index bc4f9c87e96..04fa0ff495d 100644 --- a/lib/app.php +++ b/lib/app.php @@ -65,9 +65,7 @@ class OC_App{ $apps = self::getEnabledApps(); foreach( $apps as $app ){ if((is_null($types) or self::isType($app,$types))){ - if(is_file(OC::$APPSROOT.'/apps/'.$app.'/appinfo/app.php')){ - require( $app.'/appinfo/app.php' ); - } + self::loadApp($app); } } @@ -78,6 +76,16 @@ class OC_App{ } /** + * load a single app + * @param string app + */ + public static function loadApp($app){ + if(is_file(OC::$APPSROOT.'/apps/'.$app.'/appinfo/app.php')){ + require_once( $app.'/appinfo/app.php' ); + } + } + + /** * check if an app is of a sepcific type * @param string $app * @param string/array $types @@ -115,7 +123,7 @@ class OC_App{ self::$appTypes[$app]=''; } - OC_Appconfig::setValue($app,'types',implode(',',self::$appTypes[$app])); + OC_Appconfig::setValue($app,'types',self::$appTypes[$app]); } return explode(',',self::$appTypes[$app]); diff --git a/public.php b/public.php index 27a75adec93..f974e1c50d2 100644 --- a/public.php +++ b/public.php @@ -1,10 +1,15 @@ <?php $RUNTIME_NOSETUPFS = true; -//$RUNTIME_NOAPPS = TRUE; +$RUNTIME_NOAPPS = TRUE; require_once('lib/base.php'); $file = OCP\CONFIG::getAppValue('core', 'public_' . strip_tags($_GET['service'])); if(is_null($file)){ header('HTTP/1.0 404 Not Found'); exit; } -require_once(OC::$APPSROOT . $file);
\ No newline at end of file + +$parts=explode('/',$file); +$app=$parts[2]; +OC_App::loadApp($app); + +require_once(OC::$APPSROOT . $file); diff --git a/remote.php b/remote.php index e93c2bf5c84..44b85f762f5 100644 --- a/remote.php +++ b/remote.php @@ -1,6 +1,6 @@ <?php $RUNTIME_NOSETUPFS = true; -//$RUNTIME_NOAPPS = TRUE; +$RUNTIME_NOAPPS = TRUE; require_once('lib/base.php'); if (array_key_exists('PATH_INFO', $_SERVER)){ $path_info = $_SERVER['PATH_INFO']; @@ -16,5 +16,10 @@ if(is_null($file)){ header('HTTP/1.0 404 Not Found'); exit; } + +$parts=explode('/',$file); +$app=$parts[2]; +OC_App::loadApp($app); + $baseuri = OC::$WEBROOT . '/remote.php/'.$service.'/'; require_once(OC::$APPSROOT . $file);
\ No newline at end of file |