CLI update apply db patches
This commit is contained in:
@@ -22,12 +22,15 @@ class User extends ApiObject {
|
||||
private array $groups;
|
||||
|
||||
public function __construct($configuration) {
|
||||
session_start();
|
||||
$this->configuration = $configuration;
|
||||
$this->setLanguage(Language::DEFAULT_LANGUAGE());
|
||||
$this->reset();
|
||||
$this->connectDb();
|
||||
$this->parseCookies();
|
||||
|
||||
if (!is_cli()) {
|
||||
session_start();
|
||||
$this->setLanguage(Language::DEFAULT_LANGUAGE());
|
||||
$this->parseCookies();
|
||||
}
|
||||
}
|
||||
|
||||
public function __destruct() {
|
||||
|
||||
@@ -12,6 +12,9 @@ spl_autoload_register(function($class) {
|
||||
}
|
||||
});
|
||||
|
||||
function is_cli(): bool {
|
||||
return php_sapi_name() === "cli";
|
||||
}
|
||||
|
||||
function getProtocol(): string {
|
||||
$isSecure = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on') ||
|
||||
|
||||
Reference in New Issue
Block a user