diff options
author | Robin Appelman <icewind1991@gmail.com> | 2011-06-01 15:05:48 +0200 |
---|---|---|
committer | Robin Appelman <icewind1991@gmail.com> | 2011-06-01 15:05:48 +0200 |
commit | c1d02fd1664ef0450779bcb03e849aea74bbf28d (patch) | |
tree | 846079fe0d00da6eef1eb4da5745425656771cdd /lib | |
parent | 72815bc5538c4736577a21e722bc46303ee11e16 (diff) | |
download | nextcloud-server-c1d02fd1664ef0450779bcb03e849aea74bbf28d.tar.gz nextcloud-server-c1d02fd1664ef0450779bcb03e849aea74bbf28d.zip |
install apps that are shipped with owncloud the first time they are loaded
Diffstat (limited to 'lib')
-rw-r--r-- | lib/app.php | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/lib/app.php b/lib/app.php index cec7468c8e7..a56e0c2f9e6 100644 --- a/lib/app.php +++ b/lib/app.php @@ -61,6 +61,19 @@ class OC_APP{ while( false !== ( $filename = readdir( $dir ))){ if( substr( $filename, 0, 1 ) != '.' ){ if( file_exists( "$SERVERROOT/apps/$filename/appinfo/app.php" )){ + if(OC_APPCONFIG::getValue($filename,'installed_version',0)==0){ //check if the plugin is fully installed + //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=self::getAppInfo("$SERVERROOT/apps/$filename/appinfo/info.xml"); + OC_APPCONFIG::setValue($filename,'installed_version',$info['version']); + } require( "apps/$filename/appinfo/app.php" ); } } |