fix Доп. проверка для имени класса для прохождения тестов
This commit is contained in:
parent
36b7d93a98
commit
d9b6faafc6
3 changed files with 7 additions and 6 deletions
|
|
@ -14,7 +14,6 @@ use Exception,
|
||||||
ctiso\Filter\ActionAccess,
|
ctiso\Filter\ActionAccess,
|
||||||
ctiso\View\View,
|
ctiso\View\View,
|
||||||
ctiso\Controller\State;
|
ctiso\Controller\State;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Контроллер страниц
|
* Контроллер страниц
|
||||||
*/
|
*/
|
||||||
|
|
@ -219,9 +218,11 @@ class Action
|
||||||
|
|
||||||
if ($access == null || $access->checkAction($name)) {
|
if ($access == null || $access->checkAction($name)) {
|
||||||
$moduleName = explode("\\", strtolower(get_class($this)));
|
$moduleName = explode("\\", strtolower(get_class($this)));
|
||||||
array_shift($moduleName);
|
if (count($moduleName) > 2) {
|
||||||
if ($moduleName[0] == $moduleName[1]) {
|
|
||||||
array_shift($moduleName);
|
array_shift($moduleName);
|
||||||
|
if ($moduleName[0] == $moduleName[1]) {
|
||||||
|
array_shift($moduleName);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
$param = array_merge(array('module' => implode("\\", $moduleName), "action" => $name), $param);
|
$param = array_merge(array('module' => implode("\\", $moduleName), "action" => $name), $param);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -48,8 +48,8 @@ class Database/*<Database_PDOStatement>*/ extends PDO
|
||||||
static function getConnection(array $dsn)
|
static function getConnection(array $dsn)
|
||||||
{
|
{
|
||||||
|
|
||||||
if ($dsn['phptype'] == 'pgsql' || $dsn['phptype'] == 'mysql') {
|
if ($dsn['phptype'] == 'pgsql' || $dsn['phptype'] == 'mysql') {
|
||||||
$port = (isset($dsn['port'])) ? "port={$dsn['port']};" : "";
|
$port = (isset($dsn['port'])) ? "port={$dsn['port']};" : "";
|
||||||
$connection/*: Database*/ = new static("{$dsn['phptype']}:host={$dsn['hostspec']}; $port dbname={$dsn['database']}", $dsn['username'], $dsn['password']);
|
$connection/*: Database*/ = new static("{$dsn['phptype']}:host={$dsn['hostspec']}; $port dbname={$dsn['database']}", $dsn['username'], $dsn['password']);
|
||||||
if ($dsn['phptype'] == 'pgsql') {
|
if ($dsn['phptype'] == 'pgsql') {
|
||||||
$connection->query('SET client_encoding="UTF-8"');
|
$connection->query('SET client_encoding="UTF-8"');
|
||||||
|
|
|
||||||
|
|
@ -46,7 +46,7 @@ class Settings
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!is_array($settings)) {
|
if (!is_array($settings)) {
|
||||||
throw new Exception($this->file);
|
throw new Exception('no data in ' . $this->file);
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->data = $settings;
|
$this->data = $settings;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue