summaryrefslogtreecommitdiffstats
path: root/lib/app.php
diff options
context:
space:
mode:
authorRobin Appelman <icewind@owncloud.com>2012-03-30 14:00:24 +0200
committerRobin Appelman <icewind@owncloud.com>2012-03-30 14:08:18 +0200
commita07c6b1a2ea66f00b3e85d480703ca06a4b241be (patch)
tree314ef5f5b2b1c9fd09587081e456bec264e25caa /lib/app.php
parent7bc9fa765c75846e5a293ea534505d3722d612f5 (diff)
downloadnextcloud-server-a07c6b1a2ea66f00b3e85d480703ca06a4b241be.tar.gz
nextcloud-server-a07c6b1a2ea66f00b3e85d480703ca06a4b241be.zip
optimizations for loadApps
Diffstat (limited to 'lib/app.php')
-rwxr-xr-xlib/app.php21
1 files changed, 16 insertions, 5 deletions
diff --git a/lib/app.php b/lib/app.php
index 5ee9a0e5654..fa0a1d22d15 100755
--- a/lib/app.php
+++ b/lib/app.php
@@ -55,12 +55,10 @@ class OC_App{
}
// The rest comes here
- $apps = OC_Appconfig::getApps();
+ $apps = self::getEnabledApps();
foreach( $apps as $app ){
- if( self::isEnabled( $app )){
- if(is_file(OC::$APPSROOT.'/apps/'.$app.'/appinfo/app.php')){
- require( $app.'/appinfo/app.php' );
- }
+ if(is_file(OC::$APPSROOT.'/apps/'.$app.'/appinfo/app.php')){
+ require( $app.'/appinfo/app.php' );
}
}
@@ -71,6 +69,19 @@ class OC_App{
}
/**
+ * get all enabled apps
+ */
+ public static function getEnabledApps(){
+ $apps=array();
+ $query = OC_DB::prepare( 'SELECT appid FROM *PREFIX*appconfig WHERE configkey = "enabled" AND configvalue="yes"' );
+ $query->execute();
+ while($row=$query->fetchRow()){
+ $apps[]=$row['appid'];
+ }
+ return $apps;
+ }
+
+ /**
* @brief checks whether or not an app is enabled
* @param $app app
* @returns true/false