summaryrefslogtreecommitdiffstats
path: root/lib/installer.php
diff options
context:
space:
mode:
authorRobin Appelman <icewind1991@gmail.com>2011-08-22 14:17:38 +0200
committerRobin Appelman <icewind1991@gmail.com>2011-08-22 14:17:38 +0200
commitaf3080402b06e86213c19e99c904b650d074f041 (patch)
treec387ff4468ced4d462ce15c7effd6550f9e31cd0 /lib/installer.php
parentc9a11d0aab4d10f6dfe79d080a8851ee6d86e219 (diff)
downloadnextcloud-server-af3080402b06e86213c19e99c904b650d074f041.tar.gz
nextcloud-server-af3080402b06e86213c19e99c904b650d074f041.zip
fix installing shipped apps
Diffstat (limited to 'lib/installer.php')
-rw-r--r--lib/installer.php31
1 files changed, 20 insertions, 11 deletions
diff --git a/lib/installer.php b/lib/installer.php
index e25f9d9c4ce..e6810a267db 100644
--- a/lib/installer.php
+++ b/lib/installer.php
@@ -252,17 +252,7 @@ class OC_Installer{
if( substr( $filename, 0, 1 ) != '.' and is_dir("$SERVERROOT/apps/$filename") ){
if( file_exists( "$SERVERROOT/apps/$filename/appinfo/app.php" )){
if(!OC_Installer::isInstalled($filename)){
- //install the database
- if(is_file("$SERVERROOT/apps/$filename/appinfo/database.xml")){
- OC_DB::createDbFromStructure("$SERVERROOT/apps/$filename/appinfo/database.xml");
- }
-
- //run appinfo/install.php
- if(is_file("$SERVERROOT/apps/$filename/appinfo/install.php")){
- include("$SERVERROOT/apps/$filename/appinfo/install.php");
- }
- $info=OC_App::getAppInfo("$SERVERROOT/apps/$filename/appinfo/info.xml");
- OC_Appconfig::setValue($filename,'installed_version',$info['version']);
+ OC_Installer::installShippedApp($filename);
if( $enabled ){
OC_Appconfig::setValue($filename,'enabled','yes');
}else{
@@ -274,4 +264,23 @@ class OC_Installer{
}
closedir( $dir );
}
+
+ /**
+ * install an app already placed in the app folder
+ * @param string $app id of the app to install
+ * @return bool
+ */
+ public static function installShippedApp($app){
+ //install the database
+ if(is_file(OC::$SERVERROOT."/apps/$app/appinfo/database.xml")){
+ OC_DB::createDbFromStructure(OC::$SERVERROOT."/apps/$app/appinfo/database.xml");
+ }
+
+ //run appinfo/install.php
+ if(is_file(OC::$SERVERROOT."/apps/$app/appinfo/install.php")){
+ include(OC::$SERVERROOT."/apps/$app/appinfo/install.php");
+ }
+ $info=OC_App::getAppInfo(OC::$SERVERROOT."/apps/$app/appinfo/info.xml");
+ OC_Appconfig::setValue($app,'installed_version',$info['version']);
+ }
}