Еще рефакторинг имен
This commit is contained in:
parent
981a1d0f0f
commit
312f18a20a
7 changed files with 15 additions and 12 deletions
|
|
@ -1,6 +1,6 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
class Connection_HttpConnection
|
class Connection_HttpRequest
|
||||||
{
|
{
|
||||||
const POST = "POST";
|
const POST = "POST";
|
||||||
const GET = "GET";
|
const GET = "GET";
|
||||||
|
|
|
||||||
|
|
@ -3,11 +3,14 @@
|
||||||
/**
|
/**
|
||||||
* Обрабатывает HTTP ответ
|
* Обрабатывает HTTP ответ
|
||||||
*/
|
*/
|
||||||
class Connection_HttpConnectionResponse
|
class Connection_HttpResponse
|
||||||
{
|
{
|
||||||
private $offset;
|
private $offset;
|
||||||
private $param = array ();
|
private $param = array ();
|
||||||
private $code;
|
private $code;
|
||||||
|
public $response;
|
||||||
|
public $data;
|
||||||
|
public $version;
|
||||||
|
|
||||||
public function __construct($response)
|
public function __construct($response)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -26,7 +26,7 @@ class Controller_Action
|
||||||
// Параметры устанавливаются при создании контроллера
|
// Параметры устанавливаются при создании контроллера
|
||||||
public $name; // Имя модуля
|
public $name; // Имя модуля
|
||||||
public $viewPath = null; // Путь к шаблонам контроллера
|
public $viewPath = null; // Путь к шаблонам контроллера
|
||||||
public $db; // Соединение с базой данных
|
public /*.Database.*/$db; // Соединение с базой данных
|
||||||
|
|
||||||
// Фильтры
|
// Фильтры
|
||||||
public $access = null; // Обьект хранит параметры доступа
|
public $access = null; // Обьект хранит параметры доступа
|
||||||
|
|
@ -77,7 +77,7 @@ class Controller_Action
|
||||||
$suggest = array();
|
$suggest = array();
|
||||||
$file = Path::join($this->viewPath, 'help', $name . '.suggest');
|
$file = Path::join($this->viewPath, 'help', $name . '.suggest');
|
||||||
if (file_exists($file) && include($file)) {
|
if (file_exists($file) && include($file)) {
|
||||||
$view->addScriptRaw("add_suggest(".json::encode($suggest).");\n");
|
$view->addScriptRaw("add_suggest(".json_encode($suggest).");\n");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -140,7 +140,7 @@ class Controller_Action
|
||||||
* 2. Использовать наследование чтобы добавить к старому обработчику новое поведение
|
* 2. Использовать наследование чтобы добавить к старому обработчику новое поведение
|
||||||
* @param $request Обьект запроса
|
* @param $request Обьект запроса
|
||||||
*/
|
*/
|
||||||
public function execute1(HTTPRequest $request)
|
public function execute1(HttpRequest $request)
|
||||||
{
|
{
|
||||||
$action = self::ACTION_PREFIX . ucfirst($request->getAction());
|
$action = self::ACTION_PREFIX . ucfirst($request->getAction());
|
||||||
if (method_exists($this, $action)) {
|
if (method_exists($this, $action)) {
|
||||||
|
|
@ -150,7 +150,7 @@ class Controller_Action
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function execute(HTTPRequest $request)
|
public function execute(HttpRequest $request)
|
||||||
{
|
{
|
||||||
$result = $this->execute1($request);
|
$result = $this->execute1($request);
|
||||||
if ($result) {
|
if ($result) {
|
||||||
|
|
@ -159,7 +159,7 @@ class Controller_Action
|
||||||
return $this->render();
|
return $this->render();
|
||||||
}
|
}
|
||||||
|
|
||||||
public function forward($action, HTTPRequest $args)
|
public function forward($action, HttpRequest $args)
|
||||||
{
|
{
|
||||||
// Действия до вызова основного обработчика
|
// Действия до вызова основного обработчика
|
||||||
/*foreach($this->_aspect as $aspect) {
|
/*foreach($this->_aspect as $aspect) {
|
||||||
|
|
|
||||||
|
|
@ -53,7 +53,7 @@
|
||||||
* @changelog since 0.5.1 class updated to PHP5/6 style should be compatible to PHP 4.3+
|
* @changelog since 0.5.1 class updated to PHP5/6 style should be compatible to PHP 4.3+
|
||||||
* - added a missing replace mapping for THAI CHARACTER SARA AM
|
* - added a missing replace mapping for THAI CHARACTER SARA AM
|
||||||
*/
|
*/
|
||||||
class idna_convert
|
class IdnaConvert
|
||||||
{
|
{
|
||||||
// NP See below
|
// NP See below
|
||||||
|
|
||||||
|
|
@ -3,7 +3,7 @@
|
||||||
/**
|
/**
|
||||||
* Проверка коллекции
|
* Проверка коллекции
|
||||||
*/
|
*/
|
||||||
class Validator
|
class Validator_Validator
|
||||||
{
|
{
|
||||||
protected $chain = array(); // Массив правил
|
protected $chain = array(); // Массив правил
|
||||||
protected $errorMsg = array(); // Массив ошибок
|
protected $errorMsg = array(); // Массив ошибок
|
||||||
|
|
|
||||||
|
|
@ -29,12 +29,12 @@ class View_Top // AbstractCompositeView
|
||||||
|
|
||||||
public function jGrowl($message, $args)
|
public function jGrowl($message, $args)
|
||||||
{
|
{
|
||||||
$this->addScriptRaw('$.jGrowl("' . $message . '", ' . json::encode($args) . ");\n", true);
|
$this->addScriptRaw('$.jGrowl("' . $message . '", ' . json_encode($args) . ");\n", true);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function setGlobal($name, $args)
|
public function setGlobal($name, $args)
|
||||||
{
|
{
|
||||||
$this->addScriptRaw("var " . $name . " = " . json::encode($args) . ";\n", false);
|
$this->addScriptRaw("var " . $name . " = " . json_encode($args) . ";\n", false);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@
|
||||||
// Класс отображения
|
// Класс отображения
|
||||||
// CompositeView !! Composite pattern
|
// CompositeView !! Composite pattern
|
||||||
|
|
||||||
class View
|
class View_View
|
||||||
{
|
{
|
||||||
protected $document;
|
protected $document;
|
||||||
protected $values;
|
protected $values;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue