Disable UI when web updater is disabled in config.php#331
Disable UI when web updater is disabled in config.php#331ChristophWurst merged 3 commits intomasterfrom
Conversation
|
Isn't that code also used in the phar? |
I've checked box.json and it uses updater.php as entry point which itself is based on So from my understanding this change is not needed, but I could still do it just to stay on the safe side. |
|
I've now added a CLI check |
|
For some reason (#313) index.php and master/lib/Updater.php needs to contain the same code. At least to have a green ci. |
index.php
Outdated
| require_once $configFileName; | ||
| $this->configValues = $CONFIG; | ||
|
|
||
| if (php_sapi_name() !== 'cli' && $this->configValues['upgrade.disable-web'] ?? false) { |
There was a problem hiding this comment.
| if (php_sapi_name() !== 'cli' && $this->configValues['upgrade.disable-web'] ?? false) { | |
| if (PHP_SAPI !== 'cli' && ($this->configValues['upgrade.disable-web'] ?? false)) { |
There was a problem hiding this comment.
not sure... my PHP expertise level is inferior compared to @kesselb and @nickvergessen, so not sure which to pick.
battle of the experts ? 😄
There was a problem hiding this comment.
It's your choice ;) I would prefer to wrap the second part because it's easier to understand.
There was a problem hiding this comment.
ah of course. I meant the sapi thing
There was a problem hiding this comment.
Some years ago I read an article comparing function call vs reading a constant in PHP. Constant was a bit faster and that's what I do since then: Use the constant if possible. That might be outdated nowadays.
There was a problem hiding this comment.
|
I've aligned the classes now, let's see... |
|
I've raised #332 for the CI issues as there seems to be multiple topics |
Signed-off-by: Vincent Petry <vincent@nextcloud.com>
Signed-off-by: Vincent Petry <vincent@nextcloud.com>
Signed-off-by: Vincent Petry <vincent@nextcloud.com>
550edca to
b53b4e3
Compare
|
rebased for CI |
|
CI is green now |
|
@kesselb can you merge ? thanks |
|
Thank you @PVince81, @nickvergessen and @kesselb for digging through the updater code 👍 |
|
/backport to stable19 |
|
/backport to stable20 |
|
/backport to stable21 |
For #281