]> source.dussan.org Git - nextcloud-server.git/commitdiff
selective app loading for remote/public
authorRobin Appelman <icewind@owncloud.com>
Sun, 13 May 2012 22:28:22 +0000 (00:28 +0200)
committerRobin Appelman <icewind@owncloud.com>
Sun, 13 May 2012 22:28:28 +0000 (00:28 +0200)
apps/calendar/appinfo/remote.php
apps/contacts/appinfo/remote.php
apps/files/appinfo/info.xml
apps/files/appinfo/remote.php
apps/files_sharing/get.php
apps/media/remote.php
lib/app.php
public.php
remote.php

index 7ff6a2fbbe2b3cbc00111bac59adb9d7f8258dbe..0673c36540faba168f4db6a36cd731f8246f2885 100755 (executable)
@@ -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();
index 67006b77f97c1c3c4ddfe85e6e9d21eb434b9409..9a34ecd4a4c66a3ef4347a064d4474da7e858f6d 100755 (executable)
 
 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();
index 76a06a0cb4bd8179cdc8921b6d4e43317e2bc2d8..92d0a50814eb040d355ea3ea41a619e6fed2abdc 100644 (file)
@@ -8,6 +8,9 @@
        <require>2</require>
        <standalone/>
        <default_enable/>
+       <types>
+               <filesystem/>
+       </types>
        <remote>
                <files>appinfo/remote.php</files>
                <webdav>appinfo/remote.php</webdav>
index 465e0c0a93556d7ff6035a5d0ba2324951dc533e..b66843556bb694e267ae69eed2c0be54a298895b 100644 (file)
@@ -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();
index caf25d00cfdecfc1a3c7c6537f2b2412a9d24f68..e326a170075881dd66a77b6bce23e6265a436e6f 100755 (executable)
@@ -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';
 
index 8a88c2b51ae93ede1b9f06f05c57817f621a1b9b..01add42b31545610031007f953cb859ccbd2844d 100644 (file)
@@ -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
index bc4f9c87e96759a8300127bd7950b3d976b20204..04fa0ff495d4fdc919f3baa8372862a44ea38d6e 100644 (file)
@@ -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);
                        }
                }
 
@@ -77,6 +75,16 @@ class OC_App{
                return true;
        }
 
+       /**
+        * 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
@@ -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]);
index 27a75adec9319275b84f6642c76e9522f5760acf..f974e1c50d2329b7a8ea702552d181935561fa57 100644 (file)
@@ -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);
index e93c2bf5c842560486c33e8b2f728d3685f7a362..44b85f762f58d11b57e343c55300e6975274ea96 100644 (file)
@@ -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