Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVincent Petry <pvince81@owncloud.com>2013-12-16 20:22:44 +0400
committerVincent Petry <pvince81@owncloud.com>2013-12-20 20:16:57 +0400
commitc6377e9125ed2a1b508dd1d2e12db8a82934f648 (patch)
treeaab0af147b0d806c43dd3de9fc446bceca1f934c /lib/private/app.php
parentdc45141f4abfedb10d6f908143b7a75e1ada6406 (diff)
Fixed apps loading order
On SQLite the app order can be arbitrary and cause strange bugs. On MySQL, the app order seems to be always alphabetical. This fix enforces alphabetical order to make sure that all environments behave the same and to reduce bugs related to app loading order. Fixes #6442
Diffstat (limited to 'lib/private/app.php')
-rw-r--r--lib/private/app.php10
1 files changed, 6 insertions, 4 deletions
diff --git a/lib/private/app.php b/lib/private/app.php
index eca40a81cc1..34c00e97fb9 100644
--- a/lib/private/app.php
+++ b/lib/private/app.php
@@ -166,20 +166,22 @@ class OC_App{
* get all enabled apps
*/
private static $enabledAppsCache = array();
- public static function getEnabledApps() {
+ public static function getEnabledApps($forceRefresh = false) {
if(!OC_Config::getValue('installed', false)) {
return array();
}
- if(!empty(self::$enabledAppsCache)) {
+ if(!$forceRefresh && !empty(self::$enabledAppsCache)) {
return self::$enabledAppsCache;
}
$apps=array('files');
$sql = 'SELECT `appid` FROM `*PREFIX*appconfig`'
- .' WHERE `configkey` = \'enabled\' AND `configvalue`=\'yes\'';
+ . ' WHERE `configkey` = \'enabled\' AND `configvalue`=\'yes\''
+ . ' ORDER BY `appid`';
if (OC_Config::getValue( 'dbtype', 'sqlite' ) === 'oci') {
//FIXME oracle hack: need to explicitly cast CLOB to CHAR for comparison
$sql = 'SELECT `appid` FROM `*PREFIX*appconfig`'
- .' WHERE `configkey` = \'enabled\' AND to_char(`configvalue`)=\'yes\'';
+ . ' WHERE `configkey` = \'enabled\' AND to_char(`configvalue`)=\'yes\''
+ . ' ORDER BY `appid`';
}
$query = OC_DB::prepare( $sql );
$result=$query->execute();