chore: Типы
This commit is contained in:
parent
3169ea2032
commit
08defbd046
5 changed files with 12 additions and 6 deletions
|
|
@ -47,7 +47,7 @@ class HttpResponse
|
||||||
|
|
||||||
if (isset($this->param['Transfer-Encoding']) && $this->param['Transfer-Encoding'] == 'chunked') {
|
if (isset($this->param['Transfer-Encoding']) && $this->param['Transfer-Encoding'] == 'chunked') {
|
||||||
//$this->data = substr($this->response, $this->offset);
|
//$this->data = substr($this->response, $this->offset);
|
||||||
$index = hexdec($this->getLine());
|
$index = (int)hexdec($this->getLine());
|
||||||
$chunk = [];
|
$chunk = [];
|
||||||
while ($index > 0) {
|
while ($index > 0) {
|
||||||
$chunk [] = substr($this->response, $this->offset, $index);
|
$chunk [] = substr($this->response, $this->offset, $index);
|
||||||
|
|
|
||||||
|
|
@ -135,7 +135,7 @@ class Component
|
||||||
foreach ($this->viewPath as $index => $viewPath) {
|
foreach ($this->viewPath as $index => $viewPath) {
|
||||||
// Загружать шаблон по умолчанию если не найден текущий
|
// Загружать шаблон по умолчанию если не найден текущий
|
||||||
$dir = Path::join($this->viewPath[$index], 'templates', $template);
|
$dir = Path::join($this->viewPath[$index], 'templates', $template);
|
||||||
if(is_dir($dir)) {
|
if (is_dir($dir)) {
|
||||||
$tpl = new PHPTAL(Path::join($this->viewPath[$index], 'templates', $template, $name));
|
$tpl = new PHPTAL(Path::join($this->viewPath[$index], 'templates', $template, $name));
|
||||||
$tpl->setPhpCodeDestination(PHPTAL_PHP_CODE_DESTINATION);
|
$tpl->setPhpCodeDestination(PHPTAL_PHP_CODE_DESTINATION);
|
||||||
$selected = $index;
|
$selected = $index;
|
||||||
|
|
|
||||||
|
|
@ -111,7 +111,7 @@ class Front extends Action
|
||||||
|
|
||||||
public function execute(HttpRequest $request)
|
public function execute(HttpRequest $request)
|
||||||
{
|
{
|
||||||
$name = $request->get('module', $this->default);
|
$name = $request->getString('module', $this->default);
|
||||||
try {
|
try {
|
||||||
return $this->loadModule($name, $request);
|
return $this->loadModule($name, $request);
|
||||||
} catch (UserMessageException $ex) { //Исключение с понятным пользователю сообщением
|
} catch (UserMessageException $ex) { //Исключение с понятным пользователю сообщением
|
||||||
|
|
|
||||||
|
|
@ -53,6 +53,12 @@ namespace ctiso {
|
||||||
return $result;
|
return $result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function query($query, $fetchMode = PDO::FETCH_INTO, mixed $_arg1 = null, mixed $_arg2 = null): PDOStatement {
|
||||||
|
/** @var PDOStatement */
|
||||||
|
$result = parent::query($query, $fetchMode);
|
||||||
|
return $result;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Возвращает DSN
|
* Возвращает DSN
|
||||||
* @return DSN
|
* @return DSN
|
||||||
|
|
|
||||||
|
|
@ -41,7 +41,7 @@ class Login extends Filter
|
||||||
/**
|
/**
|
||||||
* Проверка авторизации
|
* Проверка авторизации
|
||||||
* @param HttpRequest $request
|
* @param HttpRequest $request
|
||||||
* @return Boolean Авторизовани пользователь или нет
|
* @return bool Авторизовани пользователь или нет
|
||||||
*/
|
*/
|
||||||
public function isLoggin(HttpRequest $request)
|
public function isLoggin(HttpRequest $request)
|
||||||
{
|
{
|
||||||
|
|
@ -50,8 +50,8 @@ class Login extends Filter
|
||||||
switch ($request->getAction()) {
|
switch ($request->getAction()) {
|
||||||
// Авторизация по постоянному паролю
|
// Авторизация по постоянному паролю
|
||||||
case 'login':
|
case 'login':
|
||||||
$login = $request->get('login', '') ;
|
$login = $request->getString('login', '') ;
|
||||||
$password = $request->get('password');
|
$password = $request->getString('password');
|
||||||
|
|
||||||
$result = $this->role->getUserByLogin($login); // Поиск по логину
|
$result = $this->role->getUserByLogin($login); // Поиск по логину
|
||||||
if ($result) {
|
if ($result) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue