self::$appTypes=OC_Appconfig::getValues(false,'types');
}
- //get it from info.xml if we haven't cached it
- if(!isset(self::$appTypes[$app])){
- $appData=self::getAppInfo($app);
- if(isset($appData['types'])){
- self::$appTypes[$app]=implode(',',$appData['types']);
- }else{
- self::$appTypes[$app]='';
- }
+ return explode(',',self::$appTypes[$app]);
+ }
- OC_Appconfig::setValue($app,'types',self::$appTypes[$app]);
+ /**
+ * read app types from info.xml and cache them in the database
+ */
+ public static function setAppTypes($app){
+ $appData=self::getAppInfo($app);
+
+ if(isset($appData['types'])){
+ $appTypes=implode(',',$appData['types']);
+ }else{
+ $appTypes='';
}
- return explode(',',self::$appTypes[$app]);
+ OC_Appconfig::setValue($app,'types',$appTypes);
}
/**
foreach($appData['public'] as $name=>$path){
OCP\CONFIG::setAppValue('core', 'public_'.$name, '/apps/'.$appid.'/'.$path);
}
+
+ self::setAppTypes($appid);
}
/**
foreach($info['public'] as $name=>$path){
OCP\CONFIG::setAppValue('core', 'public_'.$name, '/apps/'.$info['id'].'/'.$path);
}
+
+ OC_App::setAppTypes($info['id']);
+
return $info['id'];
}
foreach($info['public'] as $name=>$path){
OCP\CONFIG::setAppValue('core', 'public_'.$name, '/apps/'.$app.'/'.$path);
}
+
+ OC_App::setAppTypes($info['id']);
+
return $info;
}