Skip to content
Snippets Groups Projects
Commit e7c106d9 authored by Robin Appelman's avatar Robin Appelman
Browse files

selective app loading for remote/public

parent 0fb90fa8
No related branches found
No related tags found
No related merge requests found
...@@ -7,6 +7,10 @@ ...@@ -7,6 +7,10 @@
*/ */
OCP\App::checkAppEnabled('calendar'); OCP\App::checkAppEnabled('calendar');
// only need authentication apps
$RUNTIME_APPTYPES=array('authentication');
OC_App::loadApps($RUNTIME_APPTYPES);
// Backends // Backends
$authBackend = new OC_Connector_Sabre_Auth(); $authBackend = new OC_Connector_Sabre_Auth();
$principalBackend = new OC_Connector_Sabre_Principal(); $principalBackend = new OC_Connector_Sabre_Principal();
......
...@@ -22,6 +22,10 @@ ...@@ -22,6 +22,10 @@
OCP\App::checkAppEnabled('contacts'); OCP\App::checkAppEnabled('contacts');
// only need authentication apps
$RUNTIME_APPTYPES=array('authentication');
OC_App::loadApps($RUNTIME_APPTYPES);
// Backends // Backends
$authBackend = new OC_Connector_Sabre_Auth(); $authBackend = new OC_Connector_Sabre_Auth();
$principalBackend = new OC_Connector_Sabre_Principal(); $principalBackend = new OC_Connector_Sabre_Principal();
......
...@@ -8,6 +8,9 @@ ...@@ -8,6 +8,9 @@
<require>2</require> <require>2</require>
<standalone/> <standalone/>
<default_enable/> <default_enable/>
<types>
<filesystem/>
</types>
<remote> <remote>
<files>appinfo/remote.php</files> <files>appinfo/remote.php</files>
<webdav>appinfo/remote.php</webdav> <webdav>appinfo/remote.php</webdav>
......
...@@ -24,6 +24,7 @@ ...@@ -24,6 +24,7 @@
*/ */
// only need filesystem apps // only need filesystem apps
$RUNTIME_APPTYPES=array('filesystem','authentication'); $RUNTIME_APPTYPES=array('filesystem','authentication');
OC_App::loadApps($RUNTIME_APPTYPES);
// Backends // Backends
$authBackend = new OC_Connector_Sabre_Auth(); $authBackend = new OC_Connector_Sabre_Auth();
......
<?php <?php
$RUNTIME_NOSETUPFS=true; //don't setup the fs yet $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'); OCP\JSON::checkAppEnabled('files_sharing');
require_once 'lib_share.php'; require_once 'lib_share.php';
......
<?php <?php
// only need filesystem apps
$RUNTIME_APPTYPES=array('filesystem','authentication');
OC_App::loadApps($RUNTIME_APPTYPES);
if($path_info == '/ampache' || $path_info == '/ampache/'){ if($path_info == '/ampache' || $path_info == '/ampache/'){
require_once(OC::$APPSROOT . '/apps/media/index.php'); require_once(OC::$APPSROOT . '/apps/media/index.php');
}else{ }else{
require_once(OC::$APPSROOT . '/apps/media/server/xml.server.php'); require_once(OC::$APPSROOT . '/apps/media/server/xml.server.php');
} }
?>
\ No newline at end of file
...@@ -65,9 +65,7 @@ class OC_App{ ...@@ -65,9 +65,7 @@ class OC_App{
$apps = self::getEnabledApps(); $apps = self::getEnabledApps();
foreach( $apps as $app ){ foreach( $apps as $app ){
if((is_null($types) or self::isType($app,$types))){ if((is_null($types) or self::isType($app,$types))){
if(is_file(OC::$APPSROOT.'/apps/'.$app.'/appinfo/app.php')){ self::loadApp($app);
require( $app.'/appinfo/app.php' );
}
} }
} }
...@@ -77,6 +75,16 @@ class OC_App{ ...@@ -77,6 +75,16 @@ class OC_App{
return true; 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 * check if an app is of a sepcific type
* @param string $app * @param string $app
...@@ -115,7 +123,7 @@ class OC_App{ ...@@ -115,7 +123,7 @@ class OC_App{
self::$appTypes[$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]); return explode(',',self::$appTypes[$app]);
......
<?php <?php
$RUNTIME_NOSETUPFS = true; $RUNTIME_NOSETUPFS = true;
//$RUNTIME_NOAPPS = TRUE; $RUNTIME_NOAPPS = TRUE;
require_once('lib/base.php'); require_once('lib/base.php');
$file = OCP\CONFIG::getAppValue('core', 'public_' . strip_tags($_GET['service'])); $file = OCP\CONFIG::getAppValue('core', 'public_' . strip_tags($_GET['service']));
if(is_null($file)){ if(is_null($file)){
header('HTTP/1.0 404 Not Found'); header('HTTP/1.0 404 Not Found');
exit; 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);
<?php <?php
$RUNTIME_NOSETUPFS = true; $RUNTIME_NOSETUPFS = true;
//$RUNTIME_NOAPPS = TRUE; $RUNTIME_NOAPPS = TRUE;
require_once('lib/base.php'); require_once('lib/base.php');
if (array_key_exists('PATH_INFO', $_SERVER)){ if (array_key_exists('PATH_INFO', $_SERVER)){
$path_info = $_SERVER['PATH_INFO']; $path_info = $_SERVER['PATH_INFO'];
...@@ -16,5 +16,10 @@ if(is_null($file)){ ...@@ -16,5 +16,10 @@ if(is_null($file)){
header('HTTP/1.0 404 Not Found'); header('HTTP/1.0 404 Not Found');
exit; exit;
} }
$parts=explode('/',$file);
$app=$parts[2];
OC_App::loadApp($app);
$baseuri = OC::$WEBROOT . '/remote.php/'.$service.'/'; $baseuri = OC::$WEBROOT . '/remote.php/'.$service.'/';
require_once(OC::$APPSROOT . $file); require_once(OC::$APPSROOT . $file);
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment