-
Notifications
You must be signed in to change notification settings - Fork 34
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Disable UI when web updater is disabled in config.php #331
Disable UI when web updater is disabled in config.php #331
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍
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
@@ -175,6 +177,12 @@ public function __construct($baseDir) { | |||
require_once $configFileName; | |||
$this->configValues = $CONFIG; | |||
|
|||
if (php_sapi_name() !== 'cli' && $this->configValues['upgrade.disable-web'] ?? false) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah of course. I meant the sapi thing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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