quickfw-git Mailing List for QuickFramework (Page 6)
Brought to you by:
ivan1986,
seriousdron
You can subscribe to this list here.
2010 |
Jan
|
Feb
|
Mar
(9) |
Apr
(25) |
May
(22) |
Jun
(22) |
Jul
(15) |
Aug
(16) |
Sep
(4) |
Oct
(9) |
Nov
(9) |
Dec
(6) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2011 |
Jan
(5) |
Feb
(3) |
Mar
(2) |
Apr
(11) |
May
(2) |
Jun
(2) |
Jul
(1) |
Aug
(3) |
Sep
|
Oct
(2) |
Nov
|
Dec
|
From: Ivan1986 <iva...@us...> - 2010-05-20 13:54:13
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "quickfw". The branch, master has been updated via ae6209fc73ef21aff5a38ff2a72699086b50b095 (commit) from 4375ba2181a17231efc0f8f88a81cfd1fdbb5268 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit ae6209fc73ef21aff5a38ff2a72699086b50b095 Author: Ivan1986 <iva...@li...> Date: Thu May 20 17:53:38 2010 +0400 Шаблон конфига nginx diff --git a/doc/nginx.conf b/doc/nginx.conf new file mode 100644 index 0000000..6bcc1ce --- /dev/null +++ b/doc/nginx.conf @@ -0,0 +1,8 @@ + location / { + if (!-e $request_filename) { + rewrite ^(.*)$ /index.php$1 break; + proxy_pass http://<...>; + } + proxy_pass http://<...>; + root <...>; + } ----------------------------------------------------------------------- Summary of changes: doc/nginx.conf | 8 ++++++++ 1 files changed, 8 insertions(+), 0 deletions(-) create mode 100644 doc/nginx.conf hooks/post-receive -- quickfw |
From: Ivan1986 <iva...@us...> - 2010-05-20 12:24:36
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "quickfw". The branch, master has been updated via 4375ba2181a17231efc0f8f88a81cfd1fdbb5268 (commit) from 4d465030b50ac27e35042a2f7a8d4dd10976961c (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 4375ba2181a17231efc0f8f88a81cfd1fdbb5268 Author: Ivan1986 <iva...@li...> Date: Thu May 20 16:23:55 2010 +0400 Стили скафолда diff --git a/www/css/buildin/scafold.css b/www/css/buildin/scafold.css index e69de29..c1d5f56 100644 --- a/www/css/buildin/scafold.css +++ b/www/css/buildin/scafold.css @@ -0,0 +1,56 @@ +div.pageslist {text-align:center;} + +table.scafoldTable +{ + border:2px solid black; + width: 100%; +} + +.scafoldTable th, .scafoldTable td +{ + border:1px dashed black; + padding: 5px; + margin: 0; +} + +.scafoldTable td:last-child, .scafoldTable td:nth-last-child(2) +{ + width: 25px; +} + +.scafoldTable tr {vertical-align:top;} +.scafoldTable th { background-color:#eec0c0; } +.scafoldTable tr td { background-color:#ddd; text-align:left;} +.scafoldTable tr:nth-child(odd) td { background-color:#c0ffc0; } + +.scafoldTable table.tnone {border: 1px solid black;} +.scafoldTable table.tnone td {background-color:#FFF; border: none; padding: 0; margin: 0;} + +form.scafoldEdit .err {color: red;} + +form.scafoldEdit textarea:focus, input:focus, select:focus { + border: 2px solid #900; +} + +form.scafoldEdit dt { + padding: 0; + margin: 0.7em 1em 0.5em 0; + width: 25%; + float: left; + clear: left; + text-align: right; +} + +form.scafoldEdit dd { + margin: 0; + padding: 0.5em 0; + width: 70%; + float: left; +} + +form.scafoldEdit small +{ + display: block; + margin-left: 20px; + color: #999; +} ----------------------------------------------------------------------- Summary of changes: www/css/buildin/scafold.css | 56 +++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 56 insertions(+), 0 deletions(-) hooks/post-receive -- quickfw |
From: Ivan1986 <iva...@us...> - 2010-05-20 11:51:06
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "quickfw". The branch, master has been updated via 4d465030b50ac27e35042a2f7a8d4dd10976961c (commit) from 2d3d9658c77fa16fd3945306a03965f738b80d7a (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 4d465030b50ac27e35042a2f7a8d4dd10976961c Author: Ivan1986 <iva...@li...> Date: Thu May 20 15:50:35 2010 +0400 Исправлена верстка в скафолдинге diff --git a/lib/Modules/Scafold/scafold/edit.html b/lib/Modules/Scafold/scafold/edit.html index 3b47bf1..0c14992 100644 --- a/lib/Modules/Scafold/scafold/edit.html +++ b/lib/Modules/Scafold/scafold/edit.html @@ -24,6 +24,7 @@ <?php if ($i->desc) {?><small><?php echo $i->desc ?></small><?php } ?> </dd> <?php } ?> + <dt></dt> + <dd><input type="submit" value="Отправить" name="send" /></dd> </dl> - <input type="submit" value="Отправить" name="send" /> </form> ----------------------------------------------------------------------- Summary of changes: lib/Modules/Scafold/scafold/edit.html | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) hooks/post-receive -- quickfw |
From: Ivan1986 <iva...@us...> - 2010-05-14 09:37:45
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "quickfw". The branch, master has been updated via 2d3d9658c77fa16fd3945306a03965f738b80d7a (commit) from d6d1e71b5d481d80ecb3de3f690a78f27c121cdd (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 2d3d9658c77fa16fd3945306a03965f738b80d7a Author: Ivan1986 <iva...@li...> Date: Fri May 14 13:37:04 2010 +0400 Исправлена ошибка в сесиях diff --git a/QFW/QuickFW/Session.php b/QFW/QuickFW/Session.php index fefb01d..255a40c 100644 --- a/QFW/QuickFW/Session.php +++ b/QFW/QuickFW/Session.php @@ -69,12 +69,15 @@ class QuickFW_Session */ public static function destroy($id) { + if (!session_id()) + return; setcookie(session_name(), '', 1, '/', isset(QFW::$config['session']['domain']) ? QFW::$config['session']['domain'] : ''); unset($_COOKIE[session_name()]); - self::$cache->remove('sess_'.$id); + if (self::$cache) + self::$cache->remove('sess_'.$id); $_SESSION = array(); - session_id(''); + session_destroy(); } /** ----------------------------------------------------------------------- Summary of changes: QFW/QuickFW/Session.php | 7 +++++-- 1 files changed, 5 insertions(+), 2 deletions(-) hooks/post-receive -- quickfw |
From: Ivan1986 <iva...@us...> - 2010-05-14 06:14:00
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "quickfw". The branch, master has been updated via d6d1e71b5d481d80ecb3de3f690a78f27c121cdd (commit) from f98f38f5b9ba1e568ffc727a27d5b8b41837815e (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit d6d1e71b5d481d80ecb3de3f690a78f27c121cdd Author: Ivan1986 <iva...@li...> Date: Fri May 14 10:13:14 2010 +0400 Теперь Url можно передавать блоку diff --git a/QFW/QuickFW/Router.php b/QFW/QuickFW/Router.php index 2bbe92d..70b946a 100644 --- a/QFW/QuickFW/Router.php +++ b/QFW/QuickFW/Router.php @@ -137,6 +137,9 @@ class QuickFW_Router //Сохраняем старый путь шаблонов $scriptPath = QFW::$view->getScriptPath(); + if ($Uri instanceof Url) + $Uri = $Uri->intern(); + //два варианта записи вызова // module.controller.action(p1,p2,p3,...) if (preg_match('|^(?:(\w*?)\.)?(\w*?)(?:\.(\w*))?(?:\((.*)\))?$|',$Uri,$patt)) diff --git a/QFW/QuickFW/Url.php b/QFW/QuickFW/Url.php index 67c4d3f..5a6cd2d 100644 --- a/QFW/QuickFW/Url.php +++ b/QFW/QuickFW/Url.php @@ -33,7 +33,7 @@ class Url /** * Урл, относительно модуля * - * @param string|self $url url + * @param string|self $CA url * @param string|array $get параметры * @param string $ancor якорь * @return self адрес на сайте @@ -47,7 +47,7 @@ class Url /** * Урл, относительно контроллера * - * @param string|self $url url + * @param string|self $action url * @param string|array $get параметры * @param string $ancor якорь * @return self адрес на сайте @@ -63,18 +63,18 @@ class Url /** * Урл, относительно экшена * - * @param string|self $url url + * @param string|self $params url * @param string|array $get параметры * @param string $ancor якорь * @return self адрес на сайте */ - public static function A($url, $get='', $ancor='') + public static function A($params='', $get='', $ancor='') { - return new self($url, $get, $ancor, QFW::$router->cModule. + return new self($params, $get, $ancor, QFW::$router->cModule. QuickFW_Router::PATH_SEPARATOR. QFW::$router->cController. QuickFW_Router::PATH_SEPARATOR. - QFW::$router->cAction); + QFW::$router->cAction.QuickFW_Router::PATH_SEPARATOR); } /** @@ -140,6 +140,17 @@ class Url ($this->ancor ? '#' . $this->ancor : ''); } + + /** + * Внутренний адрес - для блока + * + * @internal + * @return string внутренний адрес + */ + public function intern() + { + return $this->u; + } } ----------------------------------------------------------------------- Summary of changes: QFW/QuickFW/Router.php | 3 +++ QFW/QuickFW/Url.php | 23 +++++++++++++++++------ 2 files changed, 20 insertions(+), 6 deletions(-) hooks/post-receive -- quickfw |
From: Ivan1986 <iva...@us...> - 2010-05-13 09:28:48
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "quickfw". The branch, master has been updated via f98f38f5b9ba1e568ffc727a27d5b8b41837815e (commit) from 9f1f2fd43e09892aed409ff398620b0926f6bf1b (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit f98f38f5b9ba1e568ffc727a27d5b8b41837815e Author: Ivan1986 <iva...@li...> Date: Thu May 13 13:27:46 2010 +0400 Добавлены поля для Int и Varchar/Char в скафолдинг diff --git a/lib/Modules/Scafold/Fields.php b/lib/Modules/Scafold/Fields.php index c3b85d4..533c810 100644 --- a/lib/Modules/Scafold/Fields.php +++ b/lib/Modules/Scafold/Fields.php @@ -278,6 +278,42 @@ class Scafold_Text extends Scafold_UserInput } /** + * Класс для типа Int + */ +class Scafold_Int extends Scafold_Field +{ + public function validator($id, $value) + { + return is_numeric($value); + } +} + +/** + * Класс для типа Varchar + */ +class Scafold_Varchar extends Scafold_Field +{ + /** @var integer размер поля в базе */ + private $size; + + public function __construct($info, $size) + { + parent::__construct($info); + $this->size = $size; + } + + public function validator($id, $value) + { + return mb_strlen($value) <= $this->size; + } +} + +/** + * Класс для типа Char - полностью аналогичен Varchar + */ +class Scafold_Char extends Scafold_Varchar {} + +/** * Класс для типа ENUM */ class Scafold_Enum extends Scafold_Field ----------------------------------------------------------------------- Summary of changes: lib/Modules/Scafold/Fields.php | 36 ++++++++++++++++++++++++++++++++++++ 1 files changed, 36 insertions(+), 0 deletions(-) hooks/post-receive -- quickfw |
From: Ivan1986 <iva...@us...> - 2010-05-05 10:17:10
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "quickfw". The branch, master has been updated via 9f1f2fd43e09892aed409ff398620b0926f6bf1b (commit) from 0c835bf2b5e45d093c1f7b11586b67bbfc602dc5 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 9f1f2fd43e09892aed409ff398620b0926f6bf1b Author: Ivan Borzenkov <iva...@li...> Date: Wed May 5 14:16:31 2010 +0400 Кеширование разбора MCA diff --git a/QFW/QuickFW/Router.php b/QFW/QuickFW/Router.php index a6be5ee..2bbe92d 100644 --- a/QFW/QuickFW/Router.php +++ b/QFW/QuickFW/Router.php @@ -370,9 +370,41 @@ SREG; protected function loadMCA(&$data, $type) { - $MCA = array(); while (isset($data[0]) AND $data[0] === '') array_shift($data); + if (!empty(QFW::$config['cache']['MCA'])) + { + $Cache = Cache::get('MCA'); + $key = 'MCA_'.crc32(serialize($data)).$type. + ($type=='Block' ? $this->curModule : $this->defM); + $cached = $Cache->load($key); + if ($cached) + { + $MCA = $cached['MCA']; + $path = $this->baseDir.'/'.$MCA['Module']; + QFW::$view->setScriptPath($path.'/templates'); + $class = ucfirst($MCA['Controller']).'Controller'; + $fullname = $path . '/controllers/' . strtr($class,'_','/') . '.php'; + require_once($fullname); + $class_key=$MCA['Module'].'|'.$MCA['Controller']; + if ($this->module == '') + { + $this->cModule = $this->module = $MCA['Module']; + $this->cController = $this->controller = $MCA['Controller']; + $this->cAction = $this->action = $MCA['Action']; + $this->type = $MCA['Type']; + } + if (!isset($this->classes[$class_key])) + $this->classes[$class_key] = array( + 'i' => $MCA['Class'] = new $class, + 'defA' => $cached['defA'], + 'a' => $cached['a'], + ); + return $MCA; + } + } + $MCA = array(); + //Определяем модуль if (isset($data[0]) && (is_dir($this->baseDir . '/' . $data[0]))) $MCA['Module'] = array_shift($data); @@ -475,6 +507,13 @@ SREG; } $MCA['Path']=$MCA['Module'].'/'.$MCA['Controller'].'/'.$aname; + if (!empty(QFW::$config['cache']['MCA'])) + $Cache->save(array( + 'MCA' => $MCA, + 'defA' => $this->classes[$class_key]['defA'], + 'a' => $this->classes[$class_key]['a'], + ), $key, array()); + return $MCA; } diff --git a/QFW/config.php b/QFW/config.php index 04bdc89..186f569 100644 --- a/QFW/config.php +++ b/QFW/config.php @@ -63,6 +63,11 @@ $config['cache'] = array( 'namespace' => '', 'tags' => false, ), + 'MCA' => array( + 'module' => 'Xcache', + 'namespace' => '', + 'tags' => false, + ), ); $config['templater'] = array( diff --git a/application/default.php b/application/default.php index 2adf32a..b6f670b 100644 --- a/application/default.php +++ b/application/default.php @@ -54,6 +54,11 @@ $config['cache'] = array( 'namespace' => '', 'tags' => false, ), + /*'MCA' => array( + 'module' => 'Xcache', + 'namespace' => '', + 'tags' => false, + ),*/ ); /** ----------------------------------------------------------------------- Summary of changes: QFW/QuickFW/Router.php | 41 ++++++++++++++++++++++++++++++++++++++++- QFW/config.php | 5 +++++ application/default.php | 5 +++++ 3 files changed, 50 insertions(+), 1 deletions(-) hooks/post-receive -- quickfw |
From: Ivan1986 <iva...@us...> - 2010-05-05 09:24:50
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "quickfw". The branch, master has been updated via 0c835bf2b5e45d093c1f7b11586b67bbfc602dc5 (commit) from 7f93f06ca7ad9b566487af1b1a157aa8a47e65d1 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 0c835bf2b5e45d093c1f7b11586b67bbfc602dc5 Author: Ivan Borzenkov <iva...@li...> Date: Wed May 5 13:23:39 2010 +0400 Опция перенаправления всех запросов на действие по умолчанию diff --git a/QFW/QuickFW/Router.php b/QFW/QuickFW/Router.php index 8f2a14b..a6be5ee 100644 --- a/QFW/QuickFW/Router.php +++ b/QFW/QuickFW/Router.php @@ -467,8 +467,8 @@ SREG; } } - if (count($data)==$c && $c>0) // если из URI после модуля ничего не забрали и что-то осталось - { + if (QFW::$config['QFW']['auto404'] && count($data)==$c && $c>0) + { // если из URI после модуля ничего не забрали и что-то осталось $MCA['Error']="Указаны параметры у дефолтового CA \n". "или несуществующий Контроллер или Экшен дефолтового контроллера\n". "Не работает, мать его за ногу"; diff --git a/QFW/config.php b/QFW/config.php index 742fd6e..04bdc89 100644 --- a/QFW/config.php +++ b/QFW/config.php @@ -38,6 +38,7 @@ $config['QFW'] = array( 'ErrorStack' => false, /* вывод стека вызовов в сообщении об ошибке в БД */ 'cacheSessions' => false, /* Хранить сессии в кеше, не использовать стандартный механизм */ 'autoload' => false, /* включить автолоад false|true|string */ + 'auto404' => false, /* не перенаправлять на дефолтовый контроллер все запросы */ ); /** diff --git a/application/default.php b/application/default.php index 91dfb89..2adf32a 100644 --- a/application/default.php +++ b/application/default.php @@ -65,6 +65,7 @@ $config['QFW'] = array( 'ErrorStack' => false, /* вывод стека вызовов в сообщении об ошибке в БД */ 'cacheSessions' => false, /* Хранить сессии в кеше, не использовать стандартный механизм */ 'autoload' => true, /* включить автолоад false|true|string */ + 'auto404' => false, /* не перенаправлять на дефолтовый контроллер все запросы */ ); /* Шаблонизатор - имя класса + дефолтовый шаблон */ ----------------------------------------------------------------------- Summary of changes: QFW/QuickFW/Router.php | 4 ++-- QFW/config.php | 1 + application/default.php | 1 + 3 files changed, 4 insertions(+), 2 deletions(-) hooks/post-receive -- quickfw |
From: Ivan1986 <iva...@us...> - 2010-05-02 17:47:15
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "quickfw". The branch, master has been updated via 7f93f06ca7ad9b566487af1b1a157aa8a47e65d1 (commit) from 4a25eef48e26b6f8256928aaf84925f1f7b0697f (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 7f93f06ca7ad9b566487af1b1a157aa8a47e65d1 Author: Ivan Borzenkov <iva...@li...> Date: Fri Apr 23 20:20:27 2010 +0400 Добавил CURLOPT_AUTOREFERER diff --git a/lib/Curl.php b/lib/Curl.php index 4a36bee..0684956 100644 --- a/lib/Curl.php +++ b/lib/Curl.php @@ -120,6 +120,7 @@ class Curl //Set some default CURL options curl_setopt_array($handle, array( + CURLOPT_AUTOREFERER => true, CURLOPT_FOLLOWLOCATION => true, CURLOPT_HEADER => true, CURLOPT_RETURNTRANSFER => true, ----------------------------------------------------------------------- Summary of changes: lib/Curl.php | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) hooks/post-receive -- quickfw |
From: Ivan1986 <iva...@us...> - 2010-04-29 08:16:23
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "quickfw". The branch, master has been updated via 4a25eef48e26b6f8256928aaf84925f1f7b0697f (commit) from 255366db2a8070327209fadfb4a20c8a4c191d3b (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 4a25eef48e26b6f8256928aaf84925f1f7b0697f Author: Ivan1986 <iva...@li...> Date: Thu Apr 29 12:15:37 2010 +0400 Обработка потери сесии при редактировании зависимой таблицы diff --git a/lib/Modules/Scafold/Fields.php b/lib/Modules/Scafold/Fields.php index b0c7d43..c3b85d4 100644 --- a/lib/Modules/Scafold/Fields.php +++ b/lib/Modules/Scafold/Fields.php @@ -191,6 +191,12 @@ class Scafold_Parent extends Scafold_Field { return $_SESSION['scafold'][$this->table]['parent']; } + + public function validator($id, $value) + { + //если у нас будет потеря сессии, то случится фигня + return isset($_SESSION['scafold'][$this->table]['parent']); + } public function filterForm($session) { ----------------------------------------------------------------------- Summary of changes: lib/Modules/Scafold/Fields.php | 6 ++++++ 1 files changed, 6 insertions(+), 0 deletions(-) hooks/post-receive -- quickfw |
From: Ivan1986 <iva...@us...> - 2010-04-27 13:22:47
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "quickfw". The branch, master has been updated via 255366db2a8070327209fadfb4a20c8a4c191d3b (commit) from ab01232409e00dfd269a61c7b494094e78c8a19f (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 255366db2a8070327209fadfb4a20c8a4c191d3b Author: Ivan1986 <iva...@li...> Date: Tue Apr 27 17:22:14 2010 +0400 Скафолдинг - поддержка NULL diff --git a/lib/Modules/Scafold/Fields.php b/lib/Modules/Scafold/Fields.php index 310273b..b0c7d43 100644 --- a/lib/Modules/Scafold/Fields.php +++ b/lib/Modules/Scafold/Fields.php @@ -72,7 +72,8 @@ class Scafold_Field extends Scafold_Field_Info */ public function display($id, $value) { - return $value===null ? '-' : QFW::$view->esc($value); + return $value===null ? ( $this->fiendInfo['Null'] == 'YES' ? 'NULL' : '-') + : QFW::$view->esc($value); } /** @@ -135,6 +136,8 @@ class Scafold_Field extends Scafold_Field_Info */ public function proccess($id, $value) { + if ($this->fiendInfo['Null'] == 'YES' && $value=='') + return null; return $value; } ----------------------------------------------------------------------- Summary of changes: lib/Modules/Scafold/Fields.php | 5 ++++- 1 files changed, 4 insertions(+), 1 deletions(-) hooks/post-receive -- quickfw |
From: Ivan1986 <iva...@us...> - 2010-04-27 13:09:08
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "quickfw". The branch, master has been updated via ab01232409e00dfd269a61c7b494094e78c8a19f (commit) from 5614f97533c515affe96dc367b3e80eadc006d20 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit ab01232409e00dfd269a61c7b494094e78c8a19f Author: Ivan1986 <iva...@li...> Date: Tue Apr 27 17:08:35 2010 +0400 Условие подзапросом diff --git a/lib/Modules/Scafold/ScafoldController.php b/lib/Modules/Scafold/ScafoldController.php index bafb53a..703174b 100644 --- a/lib/Modules/Scafold/ScafoldController.php +++ b/lib/Modules/Scafold/ScafoldController.php @@ -97,9 +97,9 @@ abstract class ScafoldController extends Controller //Устанавливаем фильтр if ($this->parentData) { - $parent = QFW::$db->selectCol('SELECT ?# AS ARRAY_KEY, ?# FROM ?# '.$this->parentData['other'], + $parent = QFW::$db->selectCol('SELECT ?# AS ARRAY_KEY, ?# FROM ?# ?s', $this->parentData['key'], $this->parentData['field'], - $this->parentData['table']); + $this->parentData['table'], $this->parentData['other']); $this->session(); if (isset($_POST['parent'])) { @@ -293,10 +293,10 @@ abstract class ScafoldController extends Controller * @param string|DbSimple_SubQuery $table Главная таблица * @param string|DbSimple_SubQuery $id Ключ в главной таблице * @param string|DbSimple_SubQuery $name Заголовок в главной таблице - * @param string $other Дополнительные условия + * @param DbSimple_SubQuery $other Дополнительные условия * @return ScafoldController */ - protected function parent($colum, $table, $id, $name, $other='') + protected function parent($colum, $table, $id, $name, $other=DBSIMPLE_SKIP) { $this->parentData = array( 'colum' => $colum, ----------------------------------------------------------------------- Summary of changes: lib/Modules/Scafold/ScafoldController.php | 8 ++++---- 1 files changed, 4 insertions(+), 4 deletions(-) hooks/post-receive -- quickfw |
From: Ivan1986 <iva...@us...> - 2010-04-27 13:04:42
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "quickfw". The branch, master has been updated via 5614f97533c515affe96dc367b3e80eadc006d20 (commit) from 5172fd695b2165311b25c8473cda62903b64b904 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 5614f97533c515affe96dc367b3e80eadc006d20 Author: Ivan1986 <iva...@li...> Date: Tue Apr 27 17:03:51 2010 +0400 Добавлена настройка выборки из главной таблицы diff --git a/lib/Modules/Scafold/ScafoldController.php b/lib/Modules/Scafold/ScafoldController.php index a4bb15b..bafb53a 100644 --- a/lib/Modules/Scafold/ScafoldController.php +++ b/lib/Modules/Scafold/ScafoldController.php @@ -97,8 +97,9 @@ abstract class ScafoldController extends Controller //Устанавливаем фильтр if ($this->parentData) { - $parent = QFW::$db->selectCol('SELECT ?# AS ARRAY_KEY, ?# FROM ?#', - $this->parentData['key'], $this->parentData['field'], $this->parentData['table']); + $parent = QFW::$db->selectCol('SELECT ?# AS ARRAY_KEY, ?# FROM ?# '.$this->parentData['other'], + $this->parentData['key'], $this->parentData['field'], + $this->parentData['table']); $this->session(); if (isset($_POST['parent'])) { @@ -288,19 +289,21 @@ abstract class ScafoldController extends Controller * * <br><br> Вызывается только в конструкторе * - * @param string $colum Колонка зависимости - * @param string $table Главная таблица - * @param string $id Ключ в главной таблице - * @param string $name Заголовок в главной таблице + * @param string|DbSimple_SubQuery $colum Колонка зависимости + * @param string|DbSimple_SubQuery $table Главная таблица + * @param string|DbSimple_SubQuery $id Ключ в главной таблице + * @param string|DbSimple_SubQuery $name Заголовок в главной таблице + * @param string $other Дополнительные условия * @return ScafoldController */ - protected function parent($colum, $table, $id, $name) + protected function parent($colum, $table, $id, $name, $other='') { $this->parentData = array( 'colum' => $colum, 'field' => $name, 'table' => $table, 'key' => $id, + 'other' => $other, ); $this->getInfoClass($colum)->type = 'parent'; $this->getInfoClass($colum)->hide = true; ----------------------------------------------------------------------- Summary of changes: lib/Modules/Scafold/ScafoldController.php | 17 ++++++++++------- 1 files changed, 10 insertions(+), 7 deletions(-) hooks/post-receive -- quickfw |
From: Ivan1986 <iva...@us...> - 2010-04-27 12:08:14
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "quickfw". The branch, master has been updated via 5172fd695b2165311b25c8473cda62903b64b904 (commit) from 12aae4200c4d4b7210bb7c3435a4039105c9a960 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 5172fd695b2165311b25c8473cda62903b64b904 Author: Ivan1986 <iva...@li...> Date: Tue Apr 27 16:07:31 2010 +0400 поддержка подзапроса в идентификаторе diff --git a/lib/DbSimple/Generic.php b/lib/DbSimple/Generic.php index 8fbbcb8..6cad8cf 100644 --- a/lib/DbSimple/Generic.php +++ b/lib/DbSimple/Generic.php @@ -740,6 +740,8 @@ abstract class DbSimple_Generic_Database extends DbSimple_Generic_LastError // Identifier. if (!is_array($value)) { + if ($value instanceof DbSimple_SubQuery) + return $value->get($this->_placeholderNativeArgs); if (substr($value, 0, 2) == '?_') $value = $this->_identPrefix . substr($value, 2); return $this->escape($value, true); ----------------------------------------------------------------------- Summary of changes: lib/DbSimple/Generic.php | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) hooks/post-receive -- quickfw |
From: Ivan1986 <iva...@us...> - 2010-04-27 08:22:35
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "quickfw". The branch, master has been updated via 12aae4200c4d4b7210bb7c3435a4039105c9a960 (commit) from e6a6e4c525528920929d974ef7027f8d94b0a452 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 12aae4200c4d4b7210bb7c3435a4039105c9a960 Author: Ivan1986 <iva...@li...> Date: Tue Apr 27 12:22:01 2010 +0400 Документация по Url diff --git a/QFW/QuickFW/Url.php b/QFW/QuickFW/Url.php index d121285..67c4d3f 100644 --- a/QFW/QuickFW/Url.php +++ b/QFW/QuickFW/Url.php @@ -68,9 +68,9 @@ class Url * @param string $ancor якорь * @return self адрес на сайте */ - public static function A($get='', $ancor='') + public static function A($url, $get='', $ancor='') { - return new self('', $get, $ancor, QFW::$router->cModule. + return new self($url, $get, $ancor, QFW::$router->cModule. QuickFW_Router::PATH_SEPARATOR. QFW::$router->cController. QuickFW_Router::PATH_SEPARATOR. diff --git a/doc/asciidoc/Makefile b/doc/asciidoc/Makefile index c5da5ba..f676452 100644 --- a/doc/asciidoc/Makefile +++ b/doc/asciidoc/Makefile @@ -1,6 +1,6 @@ all: quickfw.pdf quickfw.html -FILES = quickfw general quickstart directory mvc blocks templates cache auth autoload features +FILES = quickfw general quickstart directory mvc blocks templates cache auth autoload helpers features TEXTS = $(addsuffix .txt, $(FILES) ) quickfw.pdf: $(TEXTS) diff --git a/doc/asciidoc/helpers.txt b/doc/asciidoc/helpers.txt new file mode 100644 index 0000000..73eced0 --- /dev/null +++ b/doc/asciidoc/helpers.txt @@ -0,0 +1,21 @@ +Хелперы +------- + +Генерация URL +~~~~~~~~~~~~~ + +Для генерации URL существует отдельный класс +Url+ в котором есть статические методы. +Каждая функция-генератор кромя base принимает три параметра: относительный адрес, get параметы и якорь. + ++Url::base+:: + отдает базовый Url ++Url::site+:: + Url относительно корня сайта ++Url::M+:: + Url относительно модуля ++Url::C+:: + Url относительно контроллера ++Url::A+:: + Url относительно экшена + +Для переинициализации есть функция +Url::Init+, которая перечитывает массив +QFW::$config[\'redirection']+. diff --git a/doc/asciidoc/quickfw.txt b/doc/asciidoc/quickfw.txt index 664bd48..0fe9ffc 100644 --- a/doc/asciidoc/quickfw.txt +++ b/doc/asciidoc/quickfw.txt @@ -21,4 +21,6 @@ include::auth.txt[] include::autoload.txt[] +include::helpers.txt[] + include::features.txt[] ----------------------------------------------------------------------- Summary of changes: QFW/QuickFW/Url.php | 4 ++-- doc/asciidoc/Makefile | 2 +- doc/asciidoc/helpers.txt | 21 +++++++++++++++++++++ doc/asciidoc/quickfw.txt | 2 ++ 4 files changed, 26 insertions(+), 3 deletions(-) create mode 100644 doc/asciidoc/helpers.txt hooks/post-receive -- quickfw |
From: Ivan1986 <iva...@us...> - 2010-04-27 07:52:38
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "quickfw". The branch, master has been updated via e6a6e4c525528920929d974ef7027f8d94b0a452 (commit) from 0540b977bca89f875823bc1b307c0e65ec4446ef (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit e6a6e4c525528920929d974ef7027f8d94b0a452 Author: Ivan1986 <iva...@li...> Date: Tue Apr 27 11:52:02 2010 +0400 Исправлена мелкая ошибка в роутере diff --git a/QFW/QuickFW/Router.php b/QFW/QuickFW/Router.php index 4505fc1..8f2a14b 100644 --- a/QFW/QuickFW/Router.php +++ b/QFW/QuickFW/Router.php @@ -456,7 +456,7 @@ SREG; else { $aname = $this->classes[$class_key]['defA']; - $MCA['Action'] = $aname; + $MCA['Action'] = strtr($aname,'.','_'); $MCA['Type'] = $type; if (!in_array($aname.$type,$this->classes[$class_key]['a'])) { ----------------------------------------------------------------------- Summary of changes: QFW/QuickFW/Router.php | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) hooks/post-receive -- quickfw |
From: Ivan1986 <iva...@us...> - 2010-04-26 15:06:20
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "quickfw". The branch, master has been updated via 0540b977bca89f875823bc1b307c0e65ec4446ef (commit) via 6ecc6c87af795452fe92b6d122f9d96487b0d904 (commit) from d1c7b365ce3d4c4084e986b0b1370427afcf3f45 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 0540b977bca89f875823bc1b307c0e65ec4446ef Author: Ivan1986 <iva...@li...> Date: Mon Apr 26 19:05:25 2010 +0400 Исправлена ошибка в хелпере паджинатора diff --git a/application/helper/controllers/NavController.php b/application/helper/controllers/NavController.php index fd48ad4..d32e38c 100644 --- a/application/helper/controllers/NavController.php +++ b/application/helper/controllers/NavController.php @@ -24,7 +24,7 @@ class NavController 'url'=>$url, 'size'=>$size, )); - return QFW::$view->fetch($name.'.html'); + return QFW::$view->fetch('pager/'.$name.'.html'); } /** commit 6ecc6c87af795452fe92b6d122f9d96487b0d904 Author: Ivan1986 <iva...@li...> Date: Mon Apr 26 19:04:57 2010 +0400 Исправлена верстка в скафолдинге diff --git a/lib/Modules/Scafold/ScafoldController.php b/lib/Modules/Scafold/ScafoldController.php index 7d1b626..a4bb15b 100644 --- a/lib/Modules/Scafold/ScafoldController.php +++ b/lib/Modules/Scafold/ScafoldController.php @@ -48,6 +48,7 @@ abstract class ScafoldController extends Controller */ public function __construct() { + QFW::$view->P->addCSS('css/buildin/scafold.css'); $this->setup = true; parent::__construct(); $this->ControllerUrl = QFW::$router->module.'/'.QFW::$router->controller; diff --git a/lib/Modules/Scafold/scafold/edit.html b/lib/Modules/Scafold/scafold/edit.html index 23087f7..3b47bf1 100644 --- a/lib/Modules/Scafold/scafold/edit.html +++ b/lib/Modules/Scafold/scafold/edit.html @@ -5,6 +5,7 @@ <?php } ?> <form action="<?php echo $P->siteUrl($info['ControllerUrl'].'/edit/'.$id) ?>" class="scafoldEdit" method="post" id="form_<?php echo $table ?>" enctype="multipart/form-data"> + <dl> <?php foreach($data as $k=>$v) { $i = $fields[$k]; if ($i->hide) @@ -13,16 +14,16 @@ if (!$i->primaryKey && !($i->hide === false)) continue; ?> - <p> - <label<?php if (isset($errors[$k])) echo ' class="err"'; ?>> - <?php echo $i->title ?></label> - <?php + <dt<?php if (isset($errors[$k])) echo ' class="err"'; ?>> + <?php echo $i->title ?></dt> + <dd><?php if (isset($methods['editor_'.ucfirst($k)])) echo call_user_func($class.'::editor_'.ucfirst($k), $id, $v); else echo $i->editor($id, $v); ?> <?php if ($i->desc) {?><small><?php echo $i->desc ?></small><?php } ?> - </p> + </dd> <?php } ?> + </dl> <input type="submit" value="Отправить" name="send" /> </form> diff --git a/www/css/buildin/scafold.css b/www/css/buildin/scafold.css new file mode 100644 index 0000000..e69de29 ----------------------------------------------------------------------- Summary of changes: application/helper/controllers/NavController.php | 2 +- lib/Modules/Scafold/ScafoldController.php | 1 + lib/Modules/Scafold/scafold/edit.html | 11 ++++++----- 3 files changed, 8 insertions(+), 6 deletions(-) create mode 100644 www/css/buildin/scafold.css hooks/post-receive -- quickfw |
From: Ivan1986 <iva...@us...> - 2010-04-26 14:35:34
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "quickfw". The branch, master has been updated via fd3fe7bb125839c00529be0c342f211d2e17ae17 (commit) from 0f1eafc3627eb8dd6702fa77e91cbc08e48e207a (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit fd3fe7bb125839c00529be0c342f211d2e17ae17 Author: Ivan1986 <iva...@li...> Date: Mon Apr 26 16:31:04 2010 +0400 В конфиге автоудаление дефолтовых MCA diff --git a/QFW/QuickFW/Plugs.php b/QFW/QuickFW/Plugs.php index 6ee9603..daf570e 100644 --- a/QFW/QuickFW/Plugs.php +++ b/QFW/QuickFW/Plugs.php @@ -27,6 +27,8 @@ class QuickFW_Plugs public function siteUrl($url, $get='') { + if (QFW::$config['redirection']['delDef']) + $url = QFW::$router->delDef($url); if (QFW::$config['redirection']['useRewrite']) $url = QFW::$router->backrewrite($url); if (is_array($get) && count($get)) diff --git a/QFW/QuickFW/Url.php b/QFW/QuickFW/Url.php index 6981730..d121285 100644 --- a/QFW/QuickFW/Url.php +++ b/QFW/QuickFW/Url.php @@ -114,6 +114,8 @@ class Url $this->u = $begin.trim($url, QuickFW_Router::PATH_SEPARATOR); $this->get = $get; $this->ancor = ltrim($ancor, '#'); + if (self::$config['delDef']) + $this->u = QFW::$router->delDef($this->u); } /** @var string внутреннее представление адреса */ diff --git a/QFW/config.php b/QFW/config.php index 4fd5b91..742fd6e 100644 --- a/QFW/config.php +++ b/QFW/config.php @@ -26,6 +26,7 @@ $config['redirection']=array( 'defExt' => '', 'useRewrite' => true, 'useBlockRewrite' => false, + 'delDef' => true, ); /** diff --git a/application/default.php b/application/default.php index 71235fe..91dfb89 100644 --- a/application/default.php +++ b/application/default.php @@ -30,6 +30,7 @@ $config['redirection']=array( 'defExt' => '', //или пусто или .html например 'useRewrite' => true, 'useBlockRewrite' => false, + 'delDef' => true, ); /** ----------------------------------------------------------------------- Summary of changes: QFW/QuickFW/Plugs.php | 2 ++ QFW/QuickFW/Url.php | 2 ++ QFW/config.php | 1 + application/default.php | 1 + 4 files changed, 6 insertions(+), 0 deletions(-) hooks/post-receive -- quickfw |
From: Ivan1986 <iva...@us...> - 2010-04-26 13:30:31
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "quickfw". The branch, master has been updated via d1c7b365ce3d4c4084e986b0b1370427afcf3f45 (commit) from 3d1e5e46396c89b96c63fe19a81f0370a2895ff0 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit d1c7b365ce3d4c4084e986b0b1370427afcf3f45 Author: Ivan1986 <iva...@li...> Date: Mon Apr 26 17:27:23 2010 +0400 Класс состояния шаблона в файл абстрактного шаблонизатора diff --git a/QFW/Templater/Templater.php b/QFW/Templater/Templater.php index f69de23..eb95493 100644 --- a/QFW/Templater/Templater.php +++ b/QFW/Templater/Templater.php @@ -164,4 +164,45 @@ abstract class Templater } +/** + * Класс для сохранения состояния шаблонизатора<br> + * Сохраняет путь к шаблонам и переменные + * + * @author ivan1986 + */ +class TemplaterState +{ + /** @var string текущий путь к шаблонам */ + private $path; + + /** @var array Массив переменных */ + private $vars; + + /** @var Templater_PlainView Ссылка на шаболонизатор */ + private $tpl; + + /** + * Сохраняет все переменные в шаблоне, а при уничтожении восстанавливает + * + * @param Templater_PlainView $templater + */ + public function __construct($templater) + { + $this->path = $templater->getScriptPath(); + $this->vars = $templater->getTemplateVars(); + $this->tpl = $templater; + } + + /** + * Восстанавливает старые переменные + */ + public function __destruct() + { + $this->tpl->setScriptPath($this->path); + $this->tpl->clearVars(); + $this->tpl->assign($this->vars); + } + +}; + ?> \ No newline at end of file diff --git a/lib/Modules/Scafold/ScafoldController.php b/lib/Modules/Scafold/ScafoldController.php index 6fd853b..7d1b626 100644 --- a/lib/Modules/Scafold/ScafoldController.php +++ b/lib/Modules/Scafold/ScafoldController.php @@ -89,7 +89,6 @@ abstract class ScafoldController extends Controller { // считаем страницы с нуля и убираем отрицательные $page = max($page-1, 0); - require_once LIBPATH.'/TemplaterState.php'; $state = new TemplaterState(QFW::$view); QFW::$view->setScriptPath(dirname(__FILE__)); @@ -219,7 +218,6 @@ abstract class ScafoldController extends Controller $data = QFW::$db->selectRow('SELECT * FROM ?# WHERE ?#=?', $this->table, $this->primaryKey, $id); - require_once LIBPATH.'/TemplaterState.php'; $state = new TemplaterState(QFW::$view); QFW::$view->setScriptPath(dirname(__FILE__)); diff --git a/lib/TemplaterState.php b/lib/TemplaterState.php deleted file mode 100644 index be4df18..0000000 --- a/lib/TemplaterState.php +++ /dev/null @@ -1,44 +0,0 @@ -<?php - -/** - * Класс для сохранения состояния шаблонизатора<br> - * Сохраняет путь к шаблонам и переменные - * - * @author ivan1986 - */ -class TemplaterState -{ - /** @var string текущий путь к шаблонам */ - private $path; - - /** @var array Массив переменных */ - private $vars; - - /** @var Templater_PlainView Ссылка на шаболонизатор */ - private $tpl; - - /** - * Сохраняет все переменные в шаблоне, а при уничтожении восстанавливает - * - * @param Templater_PlainView $templater - */ - public function __construct($templater) - { - $this->path = $templater->getScriptPath(); - $this->vars = $templater->getTemplateVars(); - $this->tpl = $templater; - } - - /** - * Восстанавливает старые переменные - */ - public function __destruct() - { - $this->tpl->setScriptPath($this->path); - $this->tpl->clearVars(); - $this->tpl->assign($this->vars); - } - -}; - -?> ----------------------------------------------------------------------- Summary of changes: QFW/Templater/Templater.php | 41 +++++++++++++++++++++++++++ lib/Modules/Scafold/ScafoldController.php | 2 - lib/TemplaterState.php | 44 ----------------------------- 3 files changed, 41 insertions(+), 46 deletions(-) delete mode 100644 lib/TemplaterState.php hooks/post-receive -- quickfw |
From: Ivan1986 <iva...@us...> - 2010-04-26 13:18:30
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "quickfw". The branch, master has been updated via 3d1e5e46396c89b96c63fe19a81f0370a2895ff0 (commit) from fd3fe7bb125839c00529be0c342f211d2e17ae17 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 3d1e5e46396c89b96c63fe19a81f0370a2895ff0 Author: Ivan1986 <iva...@li...> Date: Mon Apr 26 17:17:47 2010 +0400 Меню для работы с Url вместо строк diff --git a/application/helper/controllers/NavController.php b/application/helper/controllers/NavController.php index f9d1047..fd48ad4 100644 --- a/application/helper/controllers/NavController.php +++ b/application/helper/controllers/NavController.php @@ -31,6 +31,38 @@ class NavController * Вывод меню списком с подсветкой текущего элемента * * @param array $items Массив элементов: + * <br>ключ - заголовок, значение Url|false + * @param string $id id для элемента ul - для оформления + * @param Url $cur текущий адресс + * @param boolean $delDef Применять к ссылкам функцию QFW::$router->delDef + * @return string Сформированное меню + */ + public function menuNewBlock($items, $id='', $cur=false) + { + if (count($items) == 0) + return ''; + if ($cur == false) + $cur = QFW::$router->RequestUri; + $result = '<ul'.($id?' id="'.$id.'"':'').'>'; + foreach ($items as $k=>$v) + { + $result.='<li>'; + if ($v === false) + $result.=$k; + elseif ($cur == $v) + $result.='<b>'.$k.'</b>'; + else + $result.='<a href="'.$v.'">'.$k.'</a>'; + $result.="</li>\n"; + } + $result.= '</ul>'; + return $result; + } + + /** + * Вывод меню списком с подсветкой текущего элемента + * + * @param array $items Массив элементов: * <br>ключ - заголовок, значение адресс|false * @param string $id id для элемента ul - для оформления * @param string $cur текущий адресс ----------------------------------------------------------------------- Summary of changes: application/helper/controllers/NavController.php | 32 ++++++++++++++++++++++ 1 files changed, 32 insertions(+), 0 deletions(-) hooks/post-receive -- quickfw |
From: Ivan1986 <iva...@us...> - 2010-04-26 12:08:54
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "quickfw". The branch, master has been updated via 0f1eafc3627eb8dd6702fa77e91cbc08e48e207a (commit) from 19cf094318c883921a8a3f0f7fe9f3c499e66630 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 0f1eafc3627eb8dd6702fa77e91cbc08e48e207a Author: Ivan1986 <iva...@li...> Date: Mon Apr 26 16:08:21 2010 +0400 Хелпер для урлов diff --git a/QFW/Init.php b/QFW/Init.php index 78924e2..8caad4d 100644 --- a/QFW/Init.php +++ b/QFW/Init.php @@ -59,6 +59,10 @@ class QFW require QFWPATH.'/QuickFW/Cache.php'; require QFWPATH.'/QuickFW/Plugs.php'; + //хелпер для урлов + require QFWPATH.'/QuickFW/Url.php'; + Url::Init(); + //выставляем заголовок с нужной кодировкой if (!empty(self::$config['host']['encoding'])) header("Content-Type: text/html; charset=".self::$config['host']['encoding']); diff --git a/QFW/QuickFW/Url.php b/QFW/QuickFW/Url.php new file mode 100644 index 0000000..6981730 --- /dev/null +++ b/QFW/QuickFW/Url.php @@ -0,0 +1,144 @@ +<?php + +/** + * Хелпер для адресов + * + * @author ivan1986 + */ +class Url +{ + /** + * Возвращает базовый урл + * + * @return self базовый url + */ + public static function base() + { + return new self(''); + } + + /** + * Урл, относительно корня сайта + * + * @param string|self $url url + * @param string|array $get параметры + * @param string $ancor якорь + * @return self адрес на сайте + */ + public static function site($url, $get='', $ancor='') + { + return new self($url, $get); + } + + /** + * Урл, относительно модуля + * + * @param string|self $url url + * @param string|array $get параметры + * @param string $ancor якорь + * @return self адрес на сайте + */ + public static function M($CA, $get='', $ancor='') + { + return new self($CA, $get, $ancor, QFW::$router->cModule. + QuickFW_Router::PATH_SEPARATOR); + } + + /** + * Урл, относительно контроллера + * + * @param string|self $url url + * @param string|array $get параметры + * @param string $ancor якорь + * @return self адрес на сайте + */ + public static function C($action, $get='', $ancor='') + { + return new self($action, $get, $ancor, QFW::$router->cModule. + QuickFW_Router::PATH_SEPARATOR. + QFW::$router->cController. + QuickFW_Router::PATH_SEPARATOR); + } + + /** + * Урл, относительно экшена + * + * @param string|self $url url + * @param string|array $get параметры + * @param string $ancor якорь + * @return self адрес на сайте + */ + public static function A($get='', $ancor='') + { + return new self('', $get, $ancor, QFW::$router->cModule. + QuickFW_Router::PATH_SEPARATOR. + QFW::$router->cController. + QuickFW_Router::PATH_SEPARATOR. + QFW::$router->cAction); + } + + /** + * Инициализация класса из конфига + */ + public static function Init() + { + self::$config = QFW::$config['redirection']; + self::$config['base'] = self::$config['baseUrl']. + (self::$config['useIndex'] ? 'index.php/' : ''); + self::$config['ext'] = self::$config['defExt'] ? + self::$config['defExt'] : '/'; + } + + /** @var array QFW::$config['redirection'] */ + private static $config; + + /** + * Конструктор класса запроса + * + * @param string $url внутреннее представление адреса + * @param string|array $get параметры get + * @param string $ancor якорь + * @param string $begin базовый урл от текущего + */ + private function __construct($url, $get='', $ancor='', $begin='') + { + if (is_array($get) && count($get)) + $get = http_build_query($get); + if ($url instanceof self) + { + $this->u = $begin.$url->u; + $this->get = $url->get.($get?('&'.$get):''); + $this->ancor = $ancor ? ltrim($ancor, '#') : $url->ancor; + return; + } + $this->u = $begin.trim($url, QuickFW_Router::PATH_SEPARATOR); + $this->get = $get; + $this->ancor = ltrim($ancor, '#'); + } + + /** @var string внутреннее представление адреса */ + private $u; + + /** @var string внутреннее представление адреса */ + private $get; + + /** @var string якорь */ + private $ancor; + + /** + * урл для вывода, с подстановками + * + * @return string урл + */ + public function __toString() + { + return self::$config['base'].$this->u. + ($this->u!==''?self::$config['ext']:''). + ($this->get ? '?' . $this->get : ''). + ($this->ancor ? '#' . $this->ancor : ''); + + } + +} + +?> ----------------------------------------------------------------------- Summary of changes: QFW/Init.php | 4 ++ QFW/QuickFW/Url.php | 144 +++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 148 insertions(+), 0 deletions(-) create mode 100644 QFW/QuickFW/Url.php hooks/post-receive -- quickfw |
From: Ivan1986 <iva...@us...> - 2010-04-23 13:42:44
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "quickfw". The branch, master has been updated via 19cf094318c883921a8a3f0f7fe9f3c499e66630 (commit) from 8870a9579cc56ce6dec3b82c5d522c694b634c96 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 19cf094318c883921a8a3f0f7fe9f3c499e66630 Author: Ivan1986 <iva...@li...> Date: Fri Apr 23 17:42:12 2010 +0400 Оптимизация при пустых масиввах реврайта diff --git a/QFW/QuickFW/Router.php b/QFW/QuickFW/Router.php index 353326e..4505fc1 100644 --- a/QFW/QuickFW/Router.php +++ b/QFW/QuickFW/Router.php @@ -294,9 +294,9 @@ class QuickFW_Router } /** @var array Массив прямых преобразований Uri */ - protected $rewrite = array(); + protected $rewrite = false; /** @var array Массив обратных преобразований Uri */ - protected $backrewrite = array(); + protected $backrewrite = false; /** * Функция производит преобразования урла для вывода на страницу @@ -309,7 +309,7 @@ class QuickFW_Router { if (!QFW::$config['redirection']['useRewrite']) return $uri; - if (!$this->backrewrite) + if ($this->backrewrite == false) { $backrewrite = array(); require APPPATH . '/rewrite.php'; @@ -329,7 +329,7 @@ class QuickFW_Router { if (!QFW::$config['redirection']['useRewrite']) return $uri; - if (!$this->rewrite) + if ($this->rewrite == false) { $rewrite = array(); require APPPATH . '/rewrite.php'; ----------------------------------------------------------------------- Summary of changes: QFW/QuickFW/Router.php | 8 ++++---- 1 files changed, 4 insertions(+), 4 deletions(-) hooks/post-receive -- quickfw |
From: Ivan1986 <iva...@us...> - 2010-04-23 13:39:07
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "quickfw". The branch, master has been updated via 8870a9579cc56ce6dec3b82c5d522c694b634c96 (commit) from cf3d2b5fd041ad079bd8087d48c7590104f0e079 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 8870a9579cc56ce6dec3b82c5d522c694b634c96 Author: Ivan1986 <iva...@li...> Date: Fri Apr 23 17:37:42 2010 +0400 Исправлена ошибка в роутере diff --git a/QFW/QuickFW/Router.php b/QFW/QuickFW/Router.php index d55fb27..353326e 100644 --- a/QFW/QuickFW/Router.php +++ b/QFW/QuickFW/Router.php @@ -451,7 +451,7 @@ SREG; $MCA['Action'] = strtr($aname,'.','_'); $MCA['Type'] = $type; - if (in_array($MCA['Action'], $this->classes[$class_key]['a'])) + if (in_array($MCA['Action'].$MCA['Type'], $this->classes[$class_key]['a'])) array_shift($data); else { ----------------------------------------------------------------------- Summary of changes: QFW/QuickFW/Router.php | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) hooks/post-receive -- quickfw |
From: Ivan1986 <iva...@us...> - 2010-04-23 11:16:24
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "quickfw". The branch, master has been updated via cf3d2b5fd041ad079bd8087d48c7590104f0e079 (commit) from 86b897b55b48634d6b97b7e83789bcad78b6dd07 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit cf3d2b5fd041ad079bd8087d48c7590104f0e079 Author: Ivan1986 <iva...@li...> Date: Fri Apr 23 15:14:54 2010 +0400 В роутере разделение на тип и название экшена diff --git a/QFW/QuickFW/Router.php b/QFW/QuickFW/Router.php index c3bafb0..d55fb27 100644 --- a/QFW/QuickFW/Router.php +++ b/QFW/QuickFW/Router.php @@ -24,7 +24,7 @@ class QuickFW_Router //модуль и контроллер в контексте которого выполняется, //необходимо для роутинга компонентов - protected $cModule, $cController; + protected $curModule, $curController; /** @var string модуль, в контексте которого выполняется текущий запрос */ public $module; @@ -35,43 +35,37 @@ class QuickFW_Router /** @var string экшен, в контексте которого выполняется текущий запрос */ public $action; - /** - * Uri который был вызван для исполнения - * Без учета параметров - только модуль, контроллер и экшен - * - * @var string + /** @var string тип, в контексте которого выполняется текущий запрос */ + public $type; + + /** @var string текущий модуль */ + public $cModule; + + /** @var string текущий контроллер */ + public $cController; + + /** @var string текущий экшен */ + public $cAction; + + /** + * @var string Uri который был вызван для исполнения + * <br>Без учета параметров - только модуль, контроллер и экшен */ public $UriPath; /** - * Uri который выполняется в данный момент - * (отличается от вызванного в подключаемых модулях) - * - * @var string + * @var string Uri который выполняется в данный момент + * <br>(отличается от вызванного в подключаемых модулях) */ public $CurPath; - /** - * Uri из которого был вызван выполняемый модуль - * - * @var string - */ + /** @var string Uri из которого был вызван выполняемый модуль */ public $ParentPath; - /** - * Uri который был вызван для исполнения - * модуль, контроллер, экшен и параметры - * - * @var string - */ + /** @var string Uri который был вызван для исполнения модуль, контроллер, экшен и параметры */ public $Uri; - /** - * Uri который был вызван для исполнения - * после фильтрации переменных и реврайта - * - * @var string - */ + /** @var string Uri который был вызван для исполнения после фильтрации переменных и реврайта */ public $RequestUri; public function __construct($baseDir) @@ -114,15 +108,15 @@ class QuickFW_Router } $params = $this->parseParams($data); - $this->cModule = $this->module = $MCA['Module']; - $this->cController = $this->controller = $MCA['Controller']; - $this->action = $MCA['Action']; + $this->curModule = $this->cModule = $this->module = $MCA['Module']; + $this->curController = $this->cController = $this->controller = $MCA['Controller']; + $this->cAction = $this->action = $MCA['Action']; $this->CurPath = $this->UriPath = $MCA['Path']; $this->Uri = $MCA['Path'] . self::PATH_SEPARATOR . join(self::PATH_SEPARATOR, $data); $this->RequestUri = $requestUri; $this->ParentPath = null; - $result = call_user_func_array(array($MCA['Class'], $this->action), $params); + $result = call_user_func_array(array($MCA['Class'], $MCA['Action'].$MCA['Type']), $params); QFW::$view->setScriptPath($this->baseDir.'/'.$MCA['Module'].'/templates'); @@ -178,11 +172,24 @@ class QuickFW_Router $MCA['Path']."\n".$MCA['Error']; } + //сохраняем пути вызова list($lpPath, $this->ParentPath, $this->CurPath) = array($this->ParentPath, $this->CurPath, $MCA['Path']); - $result = call_user_func_array(array($MCA['Class'], $MCA['Action']), $MCA['Params']); + //сохраняем прошлый MCA + list ($oModule, $oController, $oAction) = + array($this->cModule, $this->cController, $this->cAction); + //устанавливаем текущий + list ($this->cModule, $this->cController, $this->cAction) = + array($MCA['Module'], $MCA['Controller'], $MCA['Action']); + + $result = call_user_func_array(array($MCA['Class'], $MCA['Action'].$MCA['Type']), $MCA['Params']); + + //восстанавливаем MCA + list ($this->cModule, $this->cController, $this->cAction) = + array($oModule, $oController, $oAction); + //восстанавливаем пути вызова list($this->CurPath, $this->ParentPath) = array($this->ParentPath, $lpPath); @@ -370,13 +377,13 @@ SREG; if (isset($data[0]) && (is_dir($this->baseDir . '/' . $data[0]))) $MCA['Module'] = array_shift($data); else - $MCA['Module'] = $type=='Block' ? $this->cModule : $this->defM; + $MCA['Module'] = $type=='Block' ? $this->curModule : $this->defM; $path = $this->baseDir.'/'.$MCA['Module']; QFW::$view->setScriptPath($path.'/templates'); $c=count($data); // Количество элементов URI исключая модуль //Определяем контроллер - $cname = isset($data[0]) ? $data[0] : ($type=='Block' ? $this->cController : $this->defC); + $cname = isset($data[0]) ? $data[0] : ($type=='Block' ? $this->curController : $this->defC); $class = ucfirst($cname).'Controller'; $fullname = $path . '/controllers/' . strtr($class,'_','/') . '.php'; @@ -385,7 +392,7 @@ SREG; array_shift($data); else { - $cname = $type=='Block' ? $this->cController : $this->defC; + $cname = $type=='Block' ? $this->curController : $this->defC; $class = ucfirst($cname).'Controller'; $fullname = $path . '/controllers/' . $class . '.php'; if (!is_file($fullname)) @@ -422,14 +429,14 @@ SREG; { $aname = isset($data[0]) ? $data[0] : (isset($vars['defA']) ? $vars['defA'] : $this->defA); - $fname = strtr($aname,'.','_').$type; - if (!in_array($fname,$acts)) - $fname = (isset($vars['defA']) ? $vars['defA'] : $this->defA).$type; + if (!in_array(strtr($aname,'.','_').$type, $acts)) + $aname = (isset($vars['defA']) ? $vars['defA'] : $this->defA); //Инициализируем значения, чтобы можно было узнать //как нас вызвали в конструкторе - $this->module = $MCA['Module']; - $this->controller = $MCA['Controller']; - $this->action = $fname; + $this->cModule = $this->module = $MCA['Module']; + $this->cController = $this->controller = $MCA['Controller']; + $this->cAction = $this->action = $aname; + $this->type = $type; } $this->classes[$class_key] = array( @@ -441,18 +448,20 @@ SREG; $MCA['Class'] = $this->classes[$class_key]['i']; $aname = isset($data[0]) ? $data[0] : $this->classes[$class_key]['defA']; - $MCA['Action'] = strtr($aname,'.','_').$type; + $MCA['Action'] = strtr($aname,'.','_'); + $MCA['Type'] = $type; if (in_array($MCA['Action'], $this->classes[$class_key]['a'])) array_shift($data); else { $aname = $this->classes[$class_key]['defA']; - $MCA['Action'] = $aname.$type; - if (!in_array($MCA['Action'],$this->classes[$class_key]['a'])) + $MCA['Action'] = $aname; + $MCA['Type'] = $type; + if (!in_array($aname.$type,$this->classes[$class_key]['a'])) { $MCA['Error']="в классе \t\t\t".$class." \nне найдена функция \t\t". - $MCA['Action']."\nМетод не найден шоб его"; + $MCA['Action'].$MCA['Type']."\nМетод не найден шоб его"; $MCA['Path']=$MCA['Module'].'/'.$MCA['Controller'].'/'.$aname; return $MCA; } ----------------------------------------------------------------------- Summary of changes: QFW/QuickFW/Router.php | 99 ++++++++++++++++++++++++++---------------------- 1 files changed, 54 insertions(+), 45 deletions(-) hooks/post-receive -- quickfw |
From: Ivan1986 <iva...@us...> - 2010-04-20 13:08:25
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "quickfw". The branch, master has been updated via 86b897b55b48634d6b97b7e83789bcad78b6dd07 (commit) via e81202811dc4f3ab63904971a9c0f12b59486f47 (commit) via 581fe0d885639a47fa2f2bcf92c6b110f3cefd9c (commit) via c0bd69d59df26b34dbeb5843efd1bfa779cae3bb (commit) from 292f23a2bb4a0725ce65d5e72d7ab40d609e6d9e (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 86b897b55b48634d6b97b7e83789bcad78b6dd07 Author: Ivan1986 <iva...@li...> Date: Tue Apr 20 17:07:48 2010 +0400 Описание автолоада diff --git a/doc/asciidoc/Makefile b/doc/asciidoc/Makefile index 8ddbaca..c5da5ba 100644 --- a/doc/asciidoc/Makefile +++ b/doc/asciidoc/Makefile @@ -1,6 +1,6 @@ all: quickfw.pdf quickfw.html -FILES = quickfw general quickstart directory mvc blocks templates cache auth features +FILES = quickfw general quickstart directory mvc blocks templates cache auth autoload features TEXTS = $(addsuffix .txt, $(FILES) ) quickfw.pdf: $(TEXTS) diff --git a/doc/asciidoc/autoload.txt b/doc/asciidoc/autoload.txt new file mode 100644 index 0000000..c28ae71 --- /dev/null +++ b/doc/asciidoc/autoload.txt @@ -0,0 +1,12 @@ +Автолоад +-------- + +Есть возможность опционально включить автолоад классов. + +Параметр +QFW::$config[\'QFW'][\'autoload']+ по умолчанию имеет значение +false+. + +Имя файла совпадает с именем класса, символ +_+ заменяется на +/+. + +Файлы ищутся в папке библиотек (константа +LIBPATH+) и папке моделей (+MODPATH+). + +Если указать в +QFW::$config[\'QFW'][\'autoload']+ имя функции, то если не будет найден класс, то последней вызовется указанная функция. diff --git a/doc/asciidoc/quickfw.txt b/doc/asciidoc/quickfw.txt index 0ab4943..664bd48 100644 --- a/doc/asciidoc/quickfw.txt +++ b/doc/asciidoc/quickfw.txt @@ -19,5 +19,6 @@ include::cache.txt[] include::auth.txt[] +include::autoload.txt[] include::features.txt[] commit e81202811dc4f3ab63904971a9c0f12b59486f47 Author: Ivan1986 <iva...@li...> Date: Tue Apr 20 16:57:27 2010 +0400 Опциональный автолоад diff --git a/QFW/Init.php b/QFW/Init.php index fe3ba58..78924e2 100644 --- a/QFW/Init.php +++ b/QFW/Init.php @@ -95,6 +95,13 @@ class QFW if (!empty(self::$config['QFW']['catchFE'])) require QFWPATH.'/QuickFW/Error.php'; + //автолоад + if (!empty(self::$config['QFW']['autoload'])) + { + require QFWPATH.'/QuickFW/Autoload.php'; + Autoload::Init(self::$config['QFW']['autoload']); + } + //JsHttpRequest if (isset($_REQUEST['JsHttpRequest'])) { diff --git a/QFW/QuickFW/Autoload.php b/QFW/QuickFW/Autoload.php new file mode 100644 index 0000000..92f9772 --- /dev/null +++ b/QFW/QuickFW/Autoload.php @@ -0,0 +1,45 @@ +<?php + +/** + * Класс для автолоада + * + * @author ivan1986 + */ +class Autoload +{ + /** + * Инициализация автолоада + * + * @param string|boolean $function имя дополнительной функции + */ + static public function Init($function = false) + { + spl_autoload_register(array(__CLASS__, 'Dirs')); + if (is_callable($function)) + spl_autoload_register($function); + } + + /** + * Функция автолоада + * + * @param string $class искомый класс + */ + static public function Dirs($class) + { + $list = array( + LIBPATH, + MODPATH, + ); + $class = str_replace('_', '/', $class); + foreach ($list as $dir) + if (is_file($dir.'/'.$class.'.php')) + { + require $dir.'/'.$class.'.php'; + return true; + } + return false; + } + +} + +?> diff --git a/QFW/config.php b/QFW/config.php index 25d95d9..4fd5b91 100644 --- a/QFW/config.php +++ b/QFW/config.php @@ -36,6 +36,7 @@ $config['QFW'] = array( 'catchFE' => false, /* перехват ошибок как исключений, исключений как логов и фатальных ошибок */ 'ErrorStack' => false, /* вывод стека вызовов в сообщении об ошибке в БД */ 'cacheSessions' => false, /* Хранить сессии в кеше, не использовать стандартный механизм */ + 'autoload' => false, /* включить автолоад false|true|string */ ); /** diff --git a/application/default.php b/application/default.php index c7fce50..71235fe 100644 --- a/application/default.php +++ b/application/default.php @@ -63,6 +63,7 @@ $config['QFW'] = array( 'catchFE' => false, /* перехват ошибок как исключений, исключений как логов и фатальных ошибок */ 'ErrorStack' => false, /* вывод стека вызовов в сообщении об ошибке в БД */ 'cacheSessions' => false, /* Хранить сессии в кеше, не использовать стандартный механизм */ + 'autoload' => true, /* включить автолоад false|true|string */ ); /* Шаблонизатор - имя класса + дефолтовый шаблон */ commit 581fe0d885639a47fa2f2bcf92c6b110f3cefd9c Author: Ivan1986 <iva...@li...> Date: Tue Apr 20 16:56:41 2010 +0400 Динамически подключаемые файлы вынесены в функцию diff --git a/QFW/Init.php b/QFW/Init.php index d5c9502..fe3ba58 100644 --- a/QFW/Init.php +++ b/QFW/Init.php @@ -3,7 +3,7 @@ class QFW { /** @var array Глобальный массив данных */ - static public $globalData; + static public $globalData = array(); /** @var QuickFW_Router Роутер */ static public $router; @@ -15,13 +15,13 @@ class QFW static public $view; /** @var array Подключенные глобальные библиотеки */ - static public $libs; + static public $libs = array(); - /** @var DbSimple_Generic_Database Подключение к базе данных */ - static public $db; + /** @var DbSimple_Generic_Database|false Подключение к базе данных */ + static public $db = false; /** @var mixed|false Данные о пользователе */ - static public $userdata; + static public $userdata = false; /** @var JsHttpRequest|false JsHttpRequest, если был выполнени Ajax запрос */ static public $ajax = false; @@ -59,12 +59,9 @@ class QFW require QFWPATH.'/QuickFW/Cache.php'; require QFWPATH.'/QuickFW/Plugs.php'; - //Библиотеки - self::$libs = array(); - //глобальный массив - self::$globalData = array(); - //Данные о пользователе - self::$userdata = false; + //выставляем заголовок с нужной кодировкой + if (!empty(self::$config['host']['encoding'])) + header("Content-Type: text/html; charset=".self::$config['host']['encoding']); //Подключаем шаблонизатор $templ = ucfirst(self::$config['templater']['name']); @@ -73,31 +70,41 @@ class QFW self::$view = new $class(APPPATH, isset(self::$config['templater']['def_tpl']) ? self::$config['templater']['def_tpl'] : ''); - //Если запрос через JsHttp, то инициализируем библиотеку - //и устанавливаем пустой главный шаблон + //подключаем модули и библиотеки + self::modules(); + + require QFWPATH.'/QuickFW/Router.php'; + self::$router = new QuickFW_Router(APPPATH); + + } + + /** + * Инициализирует необязательные модули + * <br>в зависимости от настроек конфигов + */ + static public function modules() + { + //Инициализируем класс базы данных + if (!empty(self::$config['database'])) + { + require LIBPATH.'/DbSimple/Connect.php'; + self::$db = new DbSimple_Connect(self::$config['database']); + } + + //Включаем обработку фатальных ошибок, если в конфиге указано + if (!empty(self::$config['QFW']['catchFE'])) + require QFWPATH.'/QuickFW/Error.php'; + + //JsHttpRequest if (isset($_REQUEST['JsHttpRequest'])) { require_once LIBPATH.'/JsHttpRequest.php'; //QFW::$libs['JsHttpRequest'] для совместимости со старым вариантом self::$ajax = QFW::$libs['JsHttpRequest'] = new JsHttpRequest(self::$config['host']['encoding']); + //устанавливаем пустой главный шаблон self::$view->mainTemplate = ''; } - - require LIBPATH.'/DbSimple/Connect.php'; - //Инициализируем класс базы данных - self::$db = new DbSimple_Connect(self::$config['database']); - - //выставляем заголовок с нужной кодировкой - if (!empty(self::$config['host']['encoding'])) - header("Content-Type: text/html; charset=".self::$config['host']['encoding']); - //Включаем обработку фатальных ошибок, если в конфиге указано - if (!empty(self::$config['QFW']['catchFE'])) - require QFWPATH.'/QuickFW/Error.php'; - - require QFWPATH.'/QuickFW/Router.php'; - self::$router = new QuickFW_Router(APPPATH); - } } commit c0bd69d59df26b34dbeb5843efd1bfa779cae3bb Author: Ivan1986 <iva...@li...> Date: Tue Apr 20 15:54:25 2010 +0400 Хранение сессий в кеше - дефолтовый конфиг diff --git a/QFW/config.php b/QFW/config.php index 07ff4d8..25d95d9 100644 --- a/QFW/config.php +++ b/QFW/config.php @@ -35,6 +35,7 @@ $config['QFW'] = array( 'release' => false, /* статус проекта на данном хосте - отладка и всякие быстрые компиляции */ 'catchFE' => false, /* перехват ошибок как исключений, исключений как логов и фатальных ошибок */ 'ErrorStack' => false, /* вывод стека вызовов в сообщении об ошибке в БД */ + 'cacheSessions' => false, /* Хранить сессии в кеше, не использовать стандартный механизм */ ); /** ----------------------------------------------------------------------- Summary of changes: QFW/Init.php | 70 +++++++++++++++++++++++++++------------------ QFW/QuickFW/Autoload.php | 45 +++++++++++++++++++++++++++++ QFW/config.php | 2 + application/default.php | 1 + doc/asciidoc/Makefile | 2 +- doc/asciidoc/autoload.txt | 12 ++++++++ doc/asciidoc/quickfw.txt | 1 + 7 files changed, 104 insertions(+), 29 deletions(-) create mode 100644 QFW/QuickFW/Autoload.php create mode 100644 doc/asciidoc/autoload.txt hooks/post-receive -- quickfw |