upgrade manager fix

Signed-off-by: Andy Miller <rhuk@mac.com>
This commit is contained in:
Andy Miller
2025-10-15 10:44:19 -06:00
parent 250568bae5
commit 2b1a7d3fb6

View File

@@ -47,9 +47,19 @@ class RecoveryManager
/** @var string */
private $userPath;
public function __construct(?string $rootPath = null)
/**
* @param mixed $context Container or root path.
*/
public function __construct($context = null)
{
$root = $rootPath ?? GRAV_ROOT;
if ($context instanceof \Grav\Common\Grav) {
$root = GRAV_ROOT;
} elseif (is_string($context) && $context !== '') {
$root = $context;
} else {
$root = GRAV_ROOT;
}
$this->rootPath = rtrim($root, DIRECTORY_SEPARATOR);
$this->userPath = $this->rootPath . '/user';
}