diff options
author | ArthurHoaro <arthur@hoa.ro> | 2018-03-13 18:02:49 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-03-13 18:02:49 +0100 |
commit | 4294bc7b98c8f45ceaac867cad3d5d35ee9eb096 (patch) | |
tree | d958d8d0cfab382250054cd610f0dd6f7880f67a /application/Updater.php | |
parent | 39ee93925b66b527c4386647001fadc898c52a2c (diff) | |
parent | 4ff3ed1c47365d5b28f70cb2921b0ac0075612c3 (diff) | |
download | Shaarli-4294bc7b98c8f45ceaac867cad3d5d35ee9eb096.tar.gz Shaarli-4294bc7b98c8f45ceaac867cad3d5d35ee9eb096.tar.zst Shaarli-4294bc7b98c8f45ceaac867cad3d5d35ee9eb096.zip |
Merge pull request #1096 from ArthurHoaro/feature/download-params
Make max download size and timeout configurable
Diffstat (limited to 'application/Updater.php')
-rw-r--r-- | application/Updater.php | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/application/Updater.php b/application/Updater.php index f07e7697..dece2c02 100644 --- a/application/Updater.php +++ b/application/Updater.php | |||
@@ -457,6 +457,32 @@ class Updater | |||
457 | } | 457 | } |
458 | return true; | 458 | return true; |
459 | } | 459 | } |
460 | |||
461 | /** | ||
462 | * Add download size and timeout to the configuration file | ||
463 | * | ||
464 | * @return bool true if the update is successful, false otherwise. | ||
465 | */ | ||
466 | public function updateMethodDownloadSizeAndTimeoutConf() | ||
467 | { | ||
468 | if ($this->conf->exists('general.download_max_size') | ||
469 | && $this->conf->exists('general.download_timeout') | ||
470 | ) { | ||
471 | return true; | ||
472 | } | ||
473 | |||
474 | if (! $this->conf->exists('general.download_max_size')) { | ||
475 | $this->conf->set('general.download_max_size', 1024*1024*4); | ||
476 | } | ||
477 | |||
478 | if (! $this->conf->exists('general.download_timeout')) { | ||
479 | $this->conf->set('general.download_timeout', 30); | ||
480 | } | ||
481 | |||
482 | $this->conf->write($this->isLoggedIn); | ||
483 | |||
484 | return true; | ||
485 | } | ||
460 | } | 486 | } |
461 | 487 | ||
462 | /** | 488 | /** |