You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
109 lines
1.8 KiB
109 lines
1.8 KiB
<?php
|
|
// SPDX-License-Identifier: EUPL-1.2
|
|
// Authors: see README.md
|
|
|
|
namespace SeaCMS\App;
|
|
|
|
use SeaCMS\App\TestException;
|
|
use Throwable;
|
|
|
|
/**
|
|
* define exception to caught return for tests
|
|
*/
|
|
class TestBaseUrlException extends TestException
|
|
{
|
|
/**
|
|
* caught baseUrl
|
|
* @var string
|
|
*/
|
|
protected $baseUrl;
|
|
|
|
/**
|
|
* plugin dir
|
|
* @var string
|
|
*/
|
|
protected $pluginDir;
|
|
|
|
/**
|
|
* root dir
|
|
* @var string
|
|
*/
|
|
protected $rootDir;
|
|
|
|
/**
|
|
* theme dir
|
|
* @var string
|
|
*/
|
|
protected $themeDir;
|
|
|
|
/**
|
|
* currentPage
|
|
* @var null|array
|
|
*/
|
|
protected $currentPage;
|
|
|
|
public function __construct(
|
|
string $baseUrl,
|
|
string $rootDir,
|
|
string $pluginDir,
|
|
string $themeDir,
|
|
?array $currentPage,
|
|
string $message = "",
|
|
int $code=0,
|
|
Throwable $th = null
|
|
)
|
|
{
|
|
parent::__construct($message,$code,$th);
|
|
$this->baseUrl = $baseUrl;
|
|
$this->rootDir = $rootDir;
|
|
$this->pluginDir = $pluginDir;
|
|
$this->themeDir = $themeDir;
|
|
$this->currentPage = $currentPage;
|
|
}
|
|
|
|
/**
|
|
* get baseUrl
|
|
* @return string
|
|
*/
|
|
public function getBaseUrl(): string
|
|
{
|
|
return $this->baseUrl;
|
|
}
|
|
|
|
/**
|
|
* get pluginDir
|
|
* @return string
|
|
*/
|
|
public function getPluginDir(): string
|
|
{
|
|
return $this->pluginDir;
|
|
}
|
|
|
|
/**
|
|
* get rootDir
|
|
* @return string
|
|
*/
|
|
public function getRootDir(): string
|
|
{
|
|
return $this->rootDir;
|
|
}
|
|
|
|
/**
|
|
* get themeDir
|
|
* @return string
|
|
*/
|
|
public function getThemeDir(): string
|
|
{
|
|
return $this->themeDir;
|
|
}
|
|
|
|
/**
|
|
* get currentPage
|
|
* @return null|array
|
|
*/
|
|
public function getcurrentPage(): ?array
|
|
{
|
|
return $this->currentPage;
|
|
}
|
|
|
|
}
|
|
|