diff --git a/src/Connection/HttpRequest.php b/src/Connection/HttpRequest.php index 28d0515..87a2561 100644 --- a/src/Connection/HttpRequest.php +++ b/src/Connection/HttpRequest.php @@ -81,7 +81,7 @@ class Connection_HttpRequest $port = ($this->proxy_port) ? $this->proxy_port : $this->port; $errno = 0; $errstr = ''; - $socket = fsockopen($host, $port, $errno, $errstr, 30); + $socket = @fsockopen($host, $port, $errno, $errstr, 30); if (is_resource($socket)) { $header = $this->getHeader(); fwrite($socket, $header); diff --git a/src/Controller/Component.php b/src/Controller/Component.php index cbb5514..e1ab83c 100644 --- a/src/Controller/Component.php +++ b/src/Controller/Component.php @@ -318,11 +318,7 @@ class Controller_Component } function addRequireJsPath($name, $path, $shim = null) { - global $requireJsConfig; - $requireJsConfig['paths'][$name] = $path; - if ($shim) { - $requireJsConfig['shim'][$name] = $shim; - } + Controller_Site::addRequireJsPath($name, $path, $shim); } function actionIndex(/*.ComponentRequest.*/ $request) { diff --git a/src/Database.php b/src/Database.php index 0d8813e..2ddc1f4 100644 --- a/src/Database.php +++ b/src/Database.php @@ -29,7 +29,7 @@ class Database extends PDO { if ($dsn['phptype'] == 'pgsql' || $dsn['phptype'] == 'mysql') { - $port = (isset($dsn['port'])) ? "port={$dsn['port']};" : ""; + $port = (isset($dsn['port'])) ? "port={$dsn['port']};" : ""; /*.Database.*/$connection = new static("{$dsn['phptype']}:host={$dsn['hostspec']}; $port dbname={$dsn['database']}", $dsn['username'], $dsn['password']); if ($dsn['phptype'] == 'pgsql') { $connection->query('SET client_encoding="UTF-8"'); diff --git a/src/Filter/Authorization.php b/src/Filter/Authorization.php index 17db6a6..2666465 100644 --- a/src/Filter/Authorization.php +++ b/src/Filter/Authorization.php @@ -10,8 +10,8 @@ class Filter_Authorization { } $hash = self::getBrowserSign(); // Если $hash не совпадает $_SESSION['hash'] то удаляем сессию - if (isset($_SESSION ['access']) && isset($_SESSION[self::SESSION_BROWSER_SIGN_KEYNAME])) { - +// print_r($_SESSION); + if (isset($_SESSION['access']) && isset($_SESSION[self::SESSION_BROWSER_SIGN_KEYNAME])) { if ($hash == $_SESSION[self::SESSION_BROWSER_SIGN_KEYNAME]) { // UserAccess::getUserById($_SESSION ['access']); // Поиск по идентификатору return true; @@ -25,8 +25,8 @@ class Filter_Authorization { static function enter($id) { // $db->executeQuery("UPDATE visitor SET sid = '' WHERE id_visitor = " . $result->getInt('id_user')); - session_register("access"); - session_register("time"); +// session_register("access"); +// session_register("time"); // $_SESSION ["group"] = $result->getInt('access'); $_SESSION ["access"] = $id; // id_user diff --git a/src/security.php b/src/Security.php similarity index 100% rename from src/security.php rename to src/Security.php diff --git a/src/Validator/Validator.php b/src/Validator/Validator.php index 06b8213..5a3bc4c 100644 --- a/src/Validator/Validator.php +++ b/src/Validator/Validator.php @@ -61,7 +61,7 @@ class Validator_Validator $ruleObj->$p_name = $p_value; } $this->addRule($ruleObj); - } else { + } else if (!empty($rule)) { throw new Exception('Unknown validation rule "' . $rule . "'"); } }