X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=application%2FUpdater.php;h=6fbe3e000f6577d884a136cce911a05bdf424c4b;hb=8b5b7dcc831a0ff1c660a0c0bca5d3cec376a5fc;hp=f07e76978f170f7c8839f399c9d9c93e319d6384;hpb=a381c373b30ed04001ea31ff5c38e077edacaf18;p=github%2Fshaarli%2FShaarli.git diff --git a/application/Updater.php b/application/Updater.php index f07e7697..6fbe3e00 100644 --- a/application/Updater.php +++ b/application/Updater.php @@ -457,6 +457,44 @@ class Updater } return true; } + + /** + * Add download size and timeout to the configuration file + * + * @return bool true if the update is successful, false otherwise. + */ + public function updateMethodDownloadSizeAndTimeoutConf() + { + if ($this->conf->exists('general.download_max_size') + && $this->conf->exists('general.download_timeout') + ) { + return true; + } + + if (! $this->conf->exists('general.download_max_size')) { + $this->conf->set('general.download_max_size', 1024*1024*4); + } + + if (! $this->conf->exists('general.download_timeout')) { + $this->conf->set('general.download_timeout', 30); + } + + $this->conf->write($this->isLoggedIn); + return true; + } + + /** + * * Move thumbnails management to WebThumbnailer, coming with new settings. + */ + public function updateMethodWebThumbnailer() + { + $this->conf->set('thumbnails.enabled', $this->conf->get('thumbnail.enable_thumbnails', true)); + $this->conf->set('thumbnails.width', 125); + $this->conf->set('thumbnails.height', 90); + $this->conf->remove('thumbnail'); + $this->conf->write(true); + return true; + } } /**