diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml index 3092b8e..696b869 100644 --- a/.github/FUNDING.yml +++ b/.github/FUNDING.yml @@ -2,7 +2,7 @@ github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2] patreon: # Replace with a single Patreon username -open_collective: # Replace with a single Open Collective username +open_collective: arikaim-cms ko_fi: arikaim tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry diff --git a/README.md b/README.md index 74bedae..0259db4 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,7 @@ This package is part of arikaim/core package. #### Requirements - * PHP 7.2, 7.3, 7.4 + * PHP 7.3, 7.4 #### Installation diff --git a/RouteType.php b/RouteType.php index 928f360..fd2c886 100644 --- a/RouteType.php +++ b/RouteType.php @@ -104,23 +104,26 @@ public static function isAdminPage(string $url): bool /** * Return true if request is for installation * + * @param string|null $uri * @return boolean */ - public static function isApiInstallRequest(): bool + public static function isApiInstallRequest(?string $uri = null): bool { - $uri = $_SERVER['REQUEST_URI'] ?? ''; - - return (\substr($uri,-17) == 'core/api/install/'); + $uri = $uri ?? $_SERVER['REQUEST_URI'] ?? ''; + $path = \str_replace(BASE_PATH,'',$uri); + + return (\substr($path,0,18) == '/core/api/install/'); } /** * Check for install page url - * + * + * @param string|null $uri * @return boolean */ - public static function isInstallPage(): bool + public static function isInstallPage(?string $uri = null): bool { - $uri = $_SERVER['REQUEST_URI'] ?? ''; + $uri = $uri ?? $_SERVER['REQUEST_URI'] ?? ''; return (\substr($uri,-13) == Self::INSTALL_PAGE_URL_PATH); } diff --git a/composer.json b/composer.json index bfdd787..10d7f0c 100644 --- a/composer.json +++ b/composer.json @@ -10,8 +10,7 @@ "homepage": "http://arikaim.com" }], "homepage": "http://arikaim.com", - "require": { - "php": ">=7.1", + "require": { "arikaim/interfaces": "^1.0.0" }, "autoload": {