Remove BasePath dependency from App\Mode

This commit is contained in:
Philipp 2023-01-15 13:46:01 +01:00
parent dd6d96d048
commit a6fb683bcd
No known key found for this signature in database
GPG key ID: 24A7501396EB5432
3 changed files with 13 additions and 27 deletions

View file

@ -24,7 +24,6 @@ namespace Friendica\App;
use Detection\MobileDetect;
use Friendica\Core\Config\ValueObject\Cache;
use Friendica\Database\Database;
use Friendica\Util\BasePath;
/**
* Mode of the current Friendica Node
@ -129,15 +128,13 @@ class Mode
*
* @throws \Exception
*/
public function determine(BasePath $basepath, Database $database, Cache $configCache): Mode
public function determine(string $basePath, Database $database, Cache $configCache): Mode
{
$mode = 0;
$basepathName = $basepath->getPath();
if (!file_exists($basepathName . '/config/local.config.php')
&& !file_exists($basepathName . '/config/local.ini.php')
&& !file_exists($basepathName . '/.htconfig.php')) {
if (!file_exists($basePath . '/config/local.config.php') &&
!file_exists($basePath . '/config/local.ini.php') &&
!file_exists($basePath . '/.htconfig.php')) {
return new Mode($mode);
}