From 45cff7b7378ff351158d9d93b879dcfc156171aa Mon Sep 17 00:00:00 2001 From: Bart Visscher Date: Fri, 17 Feb 2012 21:59:43 +0100 Subject: [PATCH] Move storing "last updated at" time to the app config This way the config.php file is not changed every time you go to the personal page. Step to make it possible to have a read-only config.php most of the time --- lib/setup.php | 5 +++-- lib/updater.php | 6 +++--- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/lib/setup.php b/lib/setup.php index eb32e84713..3e46a3dcc9 100644 --- a/lib/setup.php +++ b/lib/setup.php @@ -77,8 +77,6 @@ class OC_Setup { OC_Config::setValue('datadirectory', $datadir); OC_Config::setValue('dbtype', $dbtype); OC_Config::setValue('version',implode('.',OC_Util::getVersion())); - OC_Config::setValue('installedat',microtime(true)); - OC_Config::setValue('lastupdatedat',microtime(true)); if($dbtype == 'mysql') { $dbuser = $options['dbuser']; $dbpass = $options['dbpass']; @@ -224,6 +222,9 @@ class OC_Setup { } if(count($error) == 0) { + OC_Appconfig::setValue('core', 'installedat',microtime(true)); + OC_Appconfig::setValue('core', 'lastupdatedat',microtime(true)); + //create the user and group OC_User::createUser($username, $password); OC_Group::createGroup('admin'); diff --git a/lib/updater.php b/lib/updater.php index cc4a460253..57623797ae 100644 --- a/lib/updater.php +++ b/lib/updater.php @@ -29,12 +29,12 @@ class OC_Updater{ * Check if a new version is available */ public static function check(){ - OC_Config::setValue('lastupdatedat',microtime(true)); + OC_Appconfig::setValue('core', 'lastupdatedat',microtime(true)); $updaterurl='http://apps.owncloud.com/updater.php'; $version=OC_Util::getVersion(); - $version['installed']=OC_Config::getValue( "installedat"); - $version['updated']=OC_Config::getValue( "lastupdatedat"); + $version['installed']=OC_Config::getValue('installedat'); + $version['updated']=OC_Appconfig::getValue('core', 'lastupdatedat', OC_Config::getValue( 'lastupdatedat')); $version['updatechannel']='stable'; $versionstring=implode('x',$version);