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 f16c6770b72325d28ad12410d919b5330416ee76 (commit)
via 3e95eb5137dbae0b6e38ce5941667b633f321940 (commit)
via 9c6f266fb030c0e39829d4b786b99d332f16b288 (commit)
via 17c39014c6405068cc319a32f94d480438904c38 (commit)
via 9aacc8770d3f13233b3c07a57a0cad80a0a5fc5c (commit)
via c15bb6dc573bc110389c12172a1335bda23025ec (commit)
via b91283e9fd469896e5f082896c8b83e4957dce82 (commit)
via 66dbd1236ef86711e84abc5e5f2b79acee7d2eea (commit)
via 28c5d6e56fe950ad3a9c5d29fc31d6b9579c31e3 (commit)
via 8a97e39d76fd14767ce0bdc36ed5b7f7f770def9 (commit)
via cb7910326b4baf3cb4e4285bf697f6251ce9b0b5 (commit)
via fc359e1604e526ff18edad012adff8346a3f02a4 (commit)
via b88291c2a508353270af01c803612c6cd0b7a3ec (commit)
via f4c104f3504ae86db111803ac34730c66978e86f (commit)
via 372e4fff0ad087e01aea21e39ba2264c21dcbf03 (commit)
via 591e3944de40be7a6a2363e375989f2175807068 (commit)
via bf17b4da56c86e1a000179b282a60c6bbb31569e (commit)
from 47b65efefa33e3583f8f0ebc5108e1609d7899bb (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 f16c6770b72325d28ad12410d919b5330416ee76
Author: Ivan Borzenkov <iva...@li...>
Date: Tue Dec 28 16:56:21 2010 +0300
Удалена старая функция управления кешами
diff --git a/QFW/QuickFW/Cache.php b/QFW/QuickFW/Cache.php
index f369fd1..3f66fd0 100644
--- a/QFW/QuickFW/Cache.php
+++ b/QFW/QuickFW/Cache.php
@@ -200,46 +200,6 @@ class Cache
}
-/**
- * нужна для того, что сессии используют кешер и они записывают данные
- * после уничтожения всех обьектов, кешер пересоздается заново
- * для записи сессий
- *
- * @deprecated Используйте Cache::get()
- */
-function &getCache($backend='',$opt=array(),$tags=false,$namespace='')
-{
- trigger_error('Используйте Cache::get()', E_USER_DEPRECATED);
- global $config;
- static $cachers=array();
- if ($backend=='')
- $backend=ucfirst($config['cacher']['module']);
- $key=crc32(serialize(func_get_args()));
- if (isset($cachers[$key]))
- return $cachers[$key];
-
- $cl='Cacher_'.$backend;
- require_once(QFWPATH.'/Cacher/'.$backend.'.php');
- $c=new $cl;
-
- if (isset($config['cacher']['options']))
- $opt = array_merge($config['cacher']['options'],$opt);
- $c->setDirectives($opt);
-
- if ($namespace!='')
- {
- require_once(QFWPATH.'/QuickFW/Cacher/Namespace.php');
- $c=new Dklab_Cache_Backend_NamespaceWrapper($c,$namespace);
- }
- if ($tags)
- {
- require_once(QFWPATH.'/QuickFW/Cacher/TagEmu.php');
- $c=new Dklab_Cache_Backend_TagEmuWrapper($c);
- }
- $cachers[$key]=&$c;
- return $cachers[$key];
-}
-
class Cache_Thru
{
private $_cacher, $_obj, $_id, $_tags, $_lt;
diff --git a/QFW/config.php b/QFW/config.php
index e2ec504..7dd0e6e 100644
--- a/QFW/config.php
+++ b/QFW/config.php
@@ -68,9 +68,6 @@ $config['session'] = array(
//'httponly' => false,
);
-$config['cacher']=array(
- 'module' => 'File',
-);
$config['cache'] = array(
'default' => array(
'module' => 'File',
diff --git a/application/default.php b/application/default.php
index bf84612..e24e60e 100644
--- a/application/default.php
+++ b/application/default.php
@@ -59,23 +59,12 @@ $config['error'][] = array(
$config['error'] = false;
/**
- * Настройки кешера (класс бекенда и дополнительные параметры, если есть)
- *
- * @deprecated лучше юзайте новый кешер
- */
-$config['cacher']=array(
- 'module' => 'Bdb',
- 'options' => array(
- 'file'=>'ttt',
- ),
-);
-/**
* Настройки кешеров
* Массив из названий, обязателен default
*/
$config['cache'] = array(
'default' => array(
- 'module' => 'Bdb',
+ 'module' => 'File',
'namespace' => '',
'tags' => false,
),
commit 3e95eb5137dbae0b6e38ce5941667b633f321940
Author: Ivan Borzenkov <iva...@li...>
Date: Tue Dec 28 16:37:25 2010 +0300
Конфиг для ошибок
diff --git a/application/default.php b/application/default.php
index 0f63902..bf84612 100644
--- a/application/default.php
+++ b/application/default.php
@@ -35,7 +35,7 @@ $config['redirection']=array(
/**
* Настройки обработчика ошибок
*/
-$config['error'] = array();
+/*$config['error'] = array();
$config['error'][] = array(
'name' => 'mail',
'RemoveDups' => 300, //секунд или false
@@ -46,6 +46,16 @@ $config['error'][] = array(
'charset' => 'UTF-8',
),
);
+$config['error'][] = array(
+ 'name' => 'log',
+ 'RemoveDups' => 300, //секунд или false
+ 'options' => array(
+ 'to' => 'error',
+ 'whatToSend' => 65535, // LOG_ALL (look in TextNotifier)
+ 'subjPrefix' => '[ERROR] ',
+ 'charset' => 'UTF-8',
+ ),
+);*/
$config['error'] = false;
/**
commit 9c6f266fb030c0e39829d4b786b99d332f16b288
Author: Ivan Borzenkov <iva...@li...>
Date: Tue Dec 28 16:31:41 2010 +0300
Инициализация логера ошибок + новые логеры ошибок - в лог и в jabber
diff --git a/QFW/Init.php b/QFW/Init.php
index 08d8599..7b2023d 100644
--- a/QFW/Init.php
+++ b/QFW/Init.php
@@ -141,17 +141,12 @@ class QFW
$name = ucfirst($handler['name']);
require_once LIBPATH.'/Debug/ErrorHook/'.$name.'Notifier.php';
//пока так, потом возможно придется переделать
- if ($name == 'Mail')
{
- $i = new Debug_ErrorHook_MailNotifier(
+ $class = 'Debug_ErrorHook_'.$name.'Notifier';
+ $i = new $class(
$handler['options']['to'], $handler['options']['whatToSend'],
$handler['options']['subjPrefix'], $handler['options']['charset']);
}
- else
- {
- $class = 'Debug_ErrorHook_'.$name.'Notifier';
- $i = new $class($handler['options']['whatToSend']);
- }
if ($handler['RemoveDups'])
{
require_once LIBPATH.'/Debug/ErrorHook/RemoveDupsWrapper.php';
diff --git a/lib/Debug/ErrorHook/JabberNotifier.php b/lib/Debug/ErrorHook/JabberNotifier.php
new file mode 100644
index 0000000..77643f3
--- /dev/null
+++ b/lib/Debug/ErrorHook/JabberNotifier.php
@@ -0,0 +1,63 @@
+<?php
+/**
+ * Sends all notifications to a specified jabber.
+ *
+ * Consider using this class together with Debug_ErrorHook_RemoveDupsWrapper
+ * to avoid mail server flooding when a lot of errors arrives.
+ */
+
+require_once dirname(__FILE__).'/Util.php';
+require_once dirname(__FILE__).'/TextNotifier.php';
+
+class Debug_ErrorHook_JabberNotifier extends Debug_ErrorHook_TextNotifier
+{
+ private $_to;
+ private $_charset;
+ private $_whatToSend;
+ private $_subjPrefix;
+ private static $messages=array();
+
+ public function __construct($to, $whatToSend, $subjPrefix = "[ERROR] ", $charset = "UTF-8")
+ {
+ parent::__construct($whatToSend);
+ $this->_to = $to;
+ $this->_subjPrefix = $subjPrefix;
+ $this->_charset = $charset;
+ }
+
+ protected function _notifyText($subject, $body)
+ {
+ $str = $this->_subjPrefix . $subject . "\n\n".$body;
+ self::$messages[$this->_to][]=$str;
+ }
+
+ /**
+ * Отправляет очередь сообщений
+ * <br>нужно в случае длительной работы и отправке в jabber
+ */
+ private static function sendQuery()
+ {
+ if (count(self::$messages))
+ {
+ if (!isset(QFW::$config['jabber']))
+ error_log('Jabber не настроен ');
+ else
+ {
+ $J = QFW::JabberFromConfig();
+ $J->connect();
+ $J->processUntil('session_start',10);
+ $J->presence();
+ foreach (self::$messages as $k=>$msg)
+ $J->message($k, join("\n",$msg));
+ $J->disconnect();
+ }
+ self::$messages = array();
+ }
+ }
+
+ public function __destruct()
+ {
+ self::sendQuery();
+ }
+
+}
diff --git a/lib/Debug/ErrorHook/LogNotifier.php b/lib/Debug/ErrorHook/LogNotifier.php
new file mode 100644
index 0000000..07f71dd
--- /dev/null
+++ b/lib/Debug/ErrorHook/LogNotifier.php
@@ -0,0 +1,35 @@
+<?php
+/**
+ * Sends all notifications to a specified jabber.
+ *
+ * Consider using this class together with Debug_ErrorHook_RemoveDupsWrapper
+ * to avoid mail server flooding when a lot of errors arrives.
+ */
+
+require_once dirname(__FILE__).'/Util.php';
+require_once dirname(__FILE__).'/TextNotifier.php';
+require_once LIBPATH.'/Log.php';
+
+class Debug_ErrorHook_LogNotifier extends Debug_ErrorHook_TextNotifier
+{
+ private $_to;
+ private $_charset;
+ private $_whatToSend;
+ private $_subjPrefix;
+ private static $messages=array();
+
+ public function __construct($to, $whatToSend, $subjPrefix = "[ERROR] ", $charset = "UTF-8")
+ {
+ parent::__construct($whatToSend);
+ $this->_to = $to;
+ $this->_subjPrefix = $subjPrefix;
+ $this->_charset = $charset;
+ }
+
+ protected function _notifyText($subject, $body)
+ {
+ $str = $this->_subjPrefix . $subject . "\n".$body;
+ Log::out($str, $this->_to);
+ }
+
+}
diff --git a/lib/Debug/ErrorHook/TextNotifier.php b/lib/Debug/ErrorHook/TextNotifier.php
index a02e670..5d0019c 100644
--- a/lib/Debug/ErrorHook/TextNotifier.php
+++ b/lib/Debug/ErrorHook/TextNotifier.php
@@ -36,7 +36,7 @@ abstract class Debug_ErrorHook_TextNotifier implements Debug_ErrorHook_INotifier
$body[] = $this->_makeSection(
"",
join("\n", array(
- (@$_SERVER['GATEWAY_INTERFACE']? "//{$_SERVER['HTTP_HOST']}{$_SERVER['REQUEST_URI']}" : ""),
+ (!empty($_SERVER['GATEWAY_INTERFACE'])? "//{$_SERVER['HTTP_HOST']}{$_SERVER['REQUEST_URI']}" : ""),
"$errno: $errstr",
"at $errfile on line $errline",
))
commit 17c39014c6405068cc319a32f94d480438904c38
Author: Ivan Borzenkov <iva...@li...>
Date: Tue Dec 28 16:31:01 2010 +0300
Исправлена ошибка создания класса jabberа
diff --git a/QFW/Init.php b/QFW/Init.php
index 941431e..08d8599 100644
--- a/QFW/Init.php
+++ b/QFW/Init.php
@@ -169,7 +169,7 @@ class QFW
static public function JabberFromConfig()
{
require_once LIBPATH.'/XMPPHP/XMPP.php';
- new XMPPHP_XMPP(
+ return new XMPPHP_XMPP(
QFW::$config['jabber']['host'], QFW::$config['jabber']['port'],
QFW::$config['jabber']['user'], QFW::$config['jabber']['pass'],
QFW::$config['jabber']['resource'], QFW::$config['jabber']['server'],
commit 9aacc8770d3f13233b3c07a57a0cad80a0a5fc5c
Author: Ivan Borzenkov <iva...@li...>
Date: Tue Dec 28 14:59:40 2010 +0300
Обнуляем все, а не только модуль
diff --git a/QFW/QuickFW/Router.php b/QFW/QuickFW/Router.php
index 81cbe70..de70c54 100644
--- a/QFW/QuickFW/Router.php
+++ b/QFW/QuickFW/Router.php
@@ -96,8 +96,10 @@ class QuickFW_Router
$data = explode(self::PATH_SEPARATOR, $requestUri);
$data = array_map('urldecode', $data);
- //обнуляем модуль - если нас вызвали повторно
+ //обнуляем если нас вызвали повторно
$this->module = '';
+ $this->controller = '';
+ $this->action = '';
$MCA = $this->loadMCA($data, $type);
if (isset($MCA['Error']))
commit c15bb6dc573bc110389c12172a1335bda23025ec
Author: Ivan Borzenkov <iva...@li...>
Date: Tue Dec 28 14:49:56 2010 +0300
404 может быть в дизайне главной
diff --git a/QFW/QuickFW/Router.php b/QFW/QuickFW/Router.php
index d66bf98..81cbe70 100644
--- a/QFW/QuickFW/Router.php
+++ b/QFW/QuickFW/Router.php
@@ -227,7 +227,10 @@ class QuickFW_Router
header((empty($_SERVER['SERVER_PROTOCOL']) ? 'HTTP/1.1 ' : $_SERVER['SERVER_PROTOCOL']).' 404 Not Found');
if (!is_file(QFW::$view->getScriptPath().'/404.php'))
QFW::$view->setScriptPath(APPPATH.'/default/templates/');
- die(QFW::$view->displayMain(QFW::$view->render('404.php')));
+ $content = QFW::$view->fetch('404.php');
+ if (!QFW::$config['QFW']['main404'])
+ QFW::$view->mainTemplate = '';
+ die(QFW::$view->displayMain($content));
}
/**
diff --git a/QFW/config.php b/QFW/config.php
index b0ff7cf..e2ec504 100644
--- a/QFW/config.php
+++ b/QFW/config.php
@@ -34,8 +34,9 @@ $config['redirection']=array(
$config['QFW'] = array(
'release' => false, /* статус проекта на данном хосте - отладка и всякие быстрые компиляции */
'cacheSessions' => false, /* Хранить сессии в кеше, не использовать стандартный механизм */
- 'autoload' => false, /* включить автолоад false|true|string */
+ 'autoload' => true, /* включить автолоад false|true|string */
'auto404' => false, /* не перенаправлять на дефолтовый контроллер все запросы */
+ 'main404' => false, /* 404 страница в дизайне main */
'addCSSXml' => false, /* addJS и addCSS выводят теги в XML */
);
diff --git a/application/default.php b/application/default.php
index 14c650c..0f63902 100644
--- a/application/default.php
+++ b/application/default.php
@@ -84,6 +84,7 @@ $config['QFW'] = array(
'cacheSessions' => false, /* Хранить сессии в кеше, не использовать стандартный механизм */
'autoload' => true, /* включить автолоад false|true|string */
'auto404' => false, /* не перенаправлять на дефолтовый контроллер все запросы */
+ 'main404' => false, /* 404 страница в дизайне main */
'addCSSXml' => false, /* addJS и addCSS выводят теги в XML */
);
commit b91283e9fd469896e5f082896c8b83e4957dce82
Author: Ivan Borzenkov <iva...@li...>
Date: Tue Dec 28 14:41:12 2010 +0300
Фикс с my_trim
diff --git a/lib/Modules/Scaffold/Fields.php b/lib/Modules/Scaffold/Fields.php
index 9ad11c7..5d978d8 100644
--- a/lib/Modules/Scaffold/Fields.php
+++ b/lib/Modules/Scaffold/Fields.php
@@ -1,6 +1,7 @@
<?php
require_once LIBPATH.'/utils.php';
+require_once LIBPATH.'/Text.php';
require_once dirname(__FILE__).'/Display.php';
/**
@@ -309,7 +310,7 @@ abstract class Scaffold_UserInput extends Scaffold_Field
public function display($id, $value)
{
- return QFW::$view->esc(my_trim($value, $this->trim));
+ return QFW::$view->esc(Text::my_trim($value, $this->trim));
}
}
commit 66dbd1236ef86711e84abc5e5f2b79acee7d2eea
Author: Ivan Borzenkov <iva...@li...>
Date: Tue Dec 28 14:40:44 2010 +0300
Возможность использования блоков на 404 странице
diff --git a/QFW/QuickFW/Router.php b/QFW/QuickFW/Router.php
index 1d7d62d..d66bf98 100644
--- a/QFW/QuickFW/Router.php
+++ b/QFW/QuickFW/Router.php
@@ -227,7 +227,7 @@ class QuickFW_Router
header((empty($_SERVER['SERVER_PROTOCOL']) ? 'HTTP/1.1 ' : $_SERVER['SERVER_PROTOCOL']).' 404 Not Found');
if (!is_file(QFW::$view->getScriptPath().'/404.php'))
QFW::$view->setScriptPath(APPPATH.'/default/templates/');
- die(QFW::$view->render('404.php'));
+ die(QFW::$view->displayMain(QFW::$view->render('404.php')));
}
/**
@@ -454,7 +454,9 @@ SREG;
$MCA['Module'] = array_shift($data);
else
$MCA['Module'] = $type=='Block' ? $this->curModule : $this->defM;
- $path = $this->baseDir.'/'.$MCA['Module'];
+ $this->cModule = $MCA['Module'];
+ if ($this->module == '') $this->module = $this->cModule;
+ $path = $this->baseDir.'/'.$this->cModule;
QFW::$view->setScriptPath($path.'/templates');
$c=count($data); // Количество элементов URI исключая модуль
@@ -480,9 +482,8 @@ SREG;
}
$MCA['Controller'] = $cname;
$class_key=$MCA['Module'].'|'.$MCA['Controller'];
-
- $this->cModule = $MCA['Module'];
$this->cController = $MCA['Controller'];
+ if ($this->controller == '') $this->controller = $this->cController;
if (!isset($this->classes[$class_key]))
{
@@ -503,17 +504,13 @@ SREG;
$acts = get_class_methods($class);
//Выполняется при первом вызове и сохраняет значение вызванного MCA
- //Достаточно проверить только один - после выполнения пустыми они быть не могут
- if ($this->module == '')
+ //Проверяем последний так как остальные уже записаны
+ if ($this->action == '')
{
$aname = isset($data[0]) ? $data[0] :
(isset($vars['defA']) ? $vars['defA'] : $this->defA);
if (!in_array(strtr($aname,'.','_').$type, $acts))
$aname = (isset($vars['defA']) ? $vars['defA'] : $this->defA);
- //Инициализируем значения, чтобы можно было узнать
- //как нас вызвали в конструкторе
- $this->cModule = $this->module = $MCA['Module'];
- $this->cController = $this->controller = $MCA['Controller'];
$this->cAction = $this->action = $aname;
$this->type = $type;
}
commit 28c5d6e56fe950ad3a9c5d29fc31d6b9579c31e3
Author: Ivan Borzenkov <iva...@li...>
Date: Tue Dec 28 14:17:28 2010 +0300
Пара полезных функций в утилиты
diff --git a/lib/utils.php b/lib/utils.php
index 17eb979..46bad18 100644
--- a/lib/utils.php
+++ b/lib/utils.php
@@ -288,4 +288,23 @@ function nocache()
*/
function esc($s) { return htmlspecialchars($s, ENT_QUOTES, QFW::$config['host']['encoding']); }
+/**
+ * Добавляет соль пароля
+ */
+function password_sailt($pass)
+{
+ return md5($pass.QFW::$config['pass_sailt']);
+}
+
+/**
+ * Генерирует урл из текста - убирает / и применяет urlencode
+ *
+ * @param string $text
+ * @return string
+ */
+function genUrl($text)
+{
+ return rawurlencode(str_replace(array('/', ' '), '-', $text));
+}
+
?>
commit 8a97e39d76fd14767ce0bdc36ed5b7f7f770def9
Author: Ivan Borzenkov <iva...@li...>
Date: Tue Dec 28 14:14:18 2010 +0300
Часть функций из utils в хелпер text
diff --git a/lib/Text.php b/lib/Text.php
index 7567de8..68d8990 100644
--- a/lib/Text.php
+++ b/lib/Text.php
@@ -32,6 +32,9 @@ class Text
return $form5;
}
+ /**
+ * Обрезка текста
+ */
static public function my_trim($str, $size, $word=false)
{
if (mb_strlen($str)<=$size)
@@ -46,6 +49,19 @@ class Text
return $str;
}
+
+ /**
+ * Печать размера файла в форматированном виде
+ */
+ static public function printSize($size)
+ {
+ if ($size>1024*1024*2)
+ return round($size/1024/1024,2).' Мб';
+ if ($size>1024*10)
+ return round($size/1024,2).' Кб';
+ return $size.' байт';
+ }
+
/**
* Формирование даты по-русски
* <br>так как при выстановке локали неправильно склоняет
diff --git a/lib/utils.php b/lib/utils.php
index c950a5f..17eb979 100644
--- a/lib/utils.php
+++ b/lib/utils.php
@@ -127,31 +127,6 @@ function make_urls($string)
}
/**
- * Печать размера файла в форматированном виде
- */
-function printSize($size)
-{
- if ($size>1024*1024*2)
- return round($size/1024/1024,2).' Мб';
- if ($size>1024*10)
- return round($size/1024,2).' Кб';
- return $size.' байт';
-}
-
-/**
- * Обрезает длинные строки, добавляя в конце многоточие
- *
- * @param string $str строка, которую нужно обрезать
- * @param integer $size до скольки знаков
- */
-function my_trim($str, $size)
-{
- if (mb_strlen($str)>$size)
- $str=mb_substr($str,0,$size-3).'...';
- return $str;
-}
-
-/**
* Обрезает длинные строки, не разрывая последнее слово
*
* @param string $str строка, которую нужно обрезать
@@ -275,61 +250,6 @@ function array2xml($array,$attrName='attr',$arrFlar='array')
}
/**
- * Вывод окончаний русских слов с учетом числительных (например сообщение сообщения сообщений)
- *
- * @param integer $n число
- * @param string $form1 единственное
- * @param string $form2 форма для 2-4
- * @param string $form5 форма для 5 и более
- * @return string нужная форма
- */
-function pluralForm($n, $form1, $form2, $form5)
-{
- $n = abs($n) % 100;
- $n1 = $n % 10;
- if ($n > 10 && $n < 20) return $form5;
- if ($n1 > 1 && $n1 < 5) return $form2;
- if ($n1 == 1) return $form1;
- return $form5;
-}
-
-/**
- * Формирование даты по-русски
- * <br>так как при выстановке локали неправильно склоняет
- *
- * @see date
- * @param string $format формат аналогичен date
- * @param integer $time время
- * @return string дата
- */
-function russian_date($format, $time=false)
-{
- static $translation = array(
- "January" => "Января",
- "February" => "Февраля",
- "March" => "Марта",
- "April" => "Апреля",
- "May" => "Мая",
- "June" => "Июня",
- "July" => "Июля",
- "August" => "Августа",
- "September" => "Сентября",
- "October" => "Октября",
- "November" => "Ноября",
- "December" => "Декабря",
- "Monday" => "Понедельник",
- "Tuesday" => "Вторник",
- "Wednesday" => "Среда",
- "Thursday" => "Четверг",
- "Friday" => "Пятница",
- "Saturday" => "Суббота",
- "Sunday" => "Воскресенье",
- );
- return strtr(date($format, $time!==false ? $time : time()), $translation);
-}
-
-
-/**
* Вызывает preg_match(_all) и
* <br>возвращается данные в удобном формате
* <br>с использованием флага PREG_SET_ORDER
commit cb7910326b4baf3cb4e4285bf697f6251ce9b0b5
Author: Ivan Borzenkov <iva...@li...>
Date: Tue Dec 28 14:07:09 2010 +0300
Обновлена DbSimple
diff --git a/lib/DbSimple/Connect.php b/lib/DbSimple/Connect.php
index b3dec28..17fc5e7 100644
--- a/lib/DbSimple/Connect.php
+++ b/lib/DbSimple/Connect.php
@@ -40,6 +40,8 @@ class DbSimple_Connect
protected $DSN;
/** @var string Тип базы данных */
protected $shema;
+ /** @var array Что выставить при коннекте */
+ protected $init;
/**
* Конструктор только запоминает переданный DSN
@@ -51,6 +53,7 @@ class DbSimple_Connect
{
$this->DbSimple = null;
$this->DSN = $dsn;
+ $this->init = array();
$this->shema = ucfirst(substr($dsn, 0, strpos($dsn, ':')));
}
@@ -101,6 +104,7 @@ class DbSimple_Connect
/**
* Подключение к базе данных
+ * @param string $dsn DSN строка БД
*/
protected function connect($dsn)
{
@@ -115,13 +119,22 @@ class DbSimple_Connect
$this->DbSimple = new $class($parsed);
if (isset($parsed['prefix']))
$this->DbSimple->setIdentPrefix($parsed['prefix']);
- $this->DbSimple->setCachePrefix('db_'.md5($parsed['dsn']).'_');
+ if ($this->_cachePrefix) $this->DbSimple->setCachePrefix($this->_cachePrefix);
+ if ($this->_cacher) $this->DbSimple->setCacher($this->_cacher);
+ if ($this->_logger) $this->DbSimple->setLogger($this->_logger);
$this->DbSimple->setErrorHandler($this->errorHandler!==null ? $this->errorHandler : array(&$this, 'errorHandler'));
+ //выставление переменных
+ foreach($this->init as $query)
+ call_user_func_array(array(&$this->DbSimple, 'query'), $query);
+ $this->init = array();
}
/**
* Функция обработки ошибок - стандартный обработчик
* Все вызовы без @ прекращают выполнение скрипта
+ *
+ * @param string $msg Сообщение об ошибке
+ * @param array $info Подробная информация о контексте ошибки
*/
public function errorHandler($msg, $info)
{
@@ -135,6 +148,19 @@ class DbSimple_Connect
}
/**
+ * Выставляет запрос для инициализации
+ *
+ * @param string $query запрос
+ */
+ public function addInit($query)
+ {
+ $args = func_get_args();
+ if ($this->DbSimple !== null)
+ return call_user_func_array(array(&$this->DbSimple, 'query'), $args);
+ $this->init[] = $args;
+ }
+
+ /**
* Устанавливает новый обработчик ошибок
* Обработчик получает 2 аргумента:
* - сообщение об ошибке
@@ -143,6 +169,7 @@ class DbSimple_Connect
* @param callback|null|false $handler обработчик ошибок
* <br> null - по умолчанию
* <br> false - отключен
+ * @return callback|null|false предыдущий обработчик
*/
public function setErrorHandler($handler)
{
@@ -155,11 +182,69 @@ class DbSimple_Connect
/** @var callback обработчик ошибок */
private $errorHandler = null;
+ private $_cachePrefix = '';
+ private $_logger = null;
+ private $_cacher = null;
+
+ /**
+ * callback setLogger(callback $logger)
+ * Set query logger called before each query is executed.
+ * Returns previous logger.
+ */
+ public function setLogger($logger)
+ {
+ $prev = $this->_logger;
+ $this->_logger = $logger;
+ if ($this->DbSimple)
+ $this->DbSimple->setLogger($logger);
+ return $prev;
+ }
+
+ /**
+ * callback setCacher(callback $cacher)
+ * Set cache mechanism called during each query if specified.
+ * Returns previous handler.
+ */
+ public function setCacher(Zend_Cache_Backend_Interface $cacher=null)
+ {
+ $prev = $this->_cacher;
+ $this->_cacher = $cacher;
+ if ($this->DbSimple)
+ $this->DbSimple->setCacher($cacher);
+ return $prev;
+ }
+
+ /**
+ * string setIdentPrefix($prx)
+ * Set identifier prefix used for $_ placeholder.
+ */
+ public function setIdentPrefix($prx)
+ {
+ $old = $this->_identPrefix;
+ if ($prx !== null) $this->_identPrefix = $prx;
+ if ($this->DbSimple)
+ $this->DbSimple->setIdentPrefix($prx);
+ return $old;
+ }
+
+ /**
+ * string setCachePrefix($prx)
+ * Set cache prefix used in key caclulation.
+ */
+ public function setCachePrefix($prx)
+ {
+ $old = $this->_cachePrefix;
+ if ($prx !== null) $this->_cachePrefix = $prx;
+ if ($this->DbSimple)
+ $this->DbSimple->setCachePrefix($prx);
+ return $old;
+ }
/**
* Разбирает строку DSN в массив параметров подключения к базе
*
- * @param array parseDSN(string $dsn)
+ * @param string $dsn строка DSN для разбора
+ * @return array Параметры коннекта
*/
protected function parseDSN($dsn)
{
@@ -177,4 +262,4 @@ class DbSimple_Connect
}
}
-?>
\ No newline at end of file
+?>
commit fc359e1604e526ff18edad012adff8346a3f02a4
Author: Ivan Borzenkov <iva...@li...>
Date: Mon Dec 27 16:54:30 2010 +0300
Немного переписан Scaffold_Display
diff --git a/lib/Modules/Scaffold/Display.php b/lib/Modules/Scaffold/Display.php
index a98826d..c521a6e 100644
--- a/lib/Modules/Scaffold/Display.php
+++ b/lib/Modules/Scaffold/Display.php
@@ -11,19 +11,50 @@ class Scaffold_Display
public $new;
public $multiedit;
public $multidel;
+ /** @var bool текущее состояние */
+ private static $cur;
+
+ /**
+ * Фабрика
+ *
+ * @return Scaffold_Display
+ */
+ public static function get() { return new self; }
public function __construct()
{
+ self::$cur = true;
$this->edit = $this->list = $this->multiedit = $this->multidel = $this->new = true;
}
- public function show()
- {
+ public function tedit($v=null) { $this->edit = $v===null ? self::$cur : (bool)$v; return $this; }
+ public function tlist($v=null) { $this->list = $v===null ? self::$cur : (bool)$v; return $this; }
+ public function tnew($v=null) { $this->new = $v===null ? self::$cur : (bool)$v; return $this; }
+ public function tmultiedit($v=null) { $this->multiedit = $v===null ? self::$cur : (bool)$v; return $this; }
+ public function tmultidel($v=null) { $this->multidel = $v===null ? self::$cur : (bool)$v; return $this; }
- }
- public function hide()
+ /**
+ * Показывать следующие поля
+ *
+ * @param $v bool показывать
+ * @return Scaffold_Display this
+ */
+ public function show($v=true)
{
+ self::$cur = $v;
+ return $this;
+ }
+ /**
+ * Скрывать следующие поля
+ *
+ * @param $v bool скрывать
+ * @return Scaffold_Display this
+ */
+ public function hide($v=true)
+ {
+ self::$cur = !$v;
+ return $this;
}
}
diff --git a/lib/Modules/Scaffold/Fields.php b/lib/Modules/Scaffold/Fields.php
index e804a39..9ad11c7 100644
--- a/lib/Modules/Scaffold/Fields.php
+++ b/lib/Modules/Scaffold/Fields.php
@@ -74,14 +74,13 @@ class Scaffold_Field extends Scaffold_Field_Info
$this->title = $this->name;
//для совместимости
if ($this->disp === false)
- {
- $this->disp = new Scaffold_Display();
- $this->disp->list =
- $this->disp->edit =
- $this->disp->new =
- $this->disp->multiedit =
- $this->disp->multidel = !$this->hide;
- }
+ $this->disp = Scaffold_Display::get()
+ ->hide($this->hide)
+ ->tlist()
+ ->tedit()
+ ->tnew()
+ ->tmultiedit()
+ ->tmultidel();
}
/**
commit b88291c2a508353270af01c803612c6cd0b7a3ec
Author: Ivan Borzenkov <iva...@li...>
Date: Fri Dec 24 18:01:05 2010 +0300
Скафолдинг - обработка данных после записи в таблицу для поля и переменная $row - текущая строка
diff --git a/lib/Modules/Scaffold/Fields.php b/lib/Modules/Scaffold/Fields.php
index d06ba5a..e804a39 100644
--- a/lib/Modules/Scaffold/Fields.php
+++ b/lib/Modules/Scaffold/Fields.php
@@ -165,6 +165,17 @@ class Scaffold_Field extends Scaffold_Field_Info
return $value;
}
+ /**
+ * Обработка значения после записи в таблицу - известен ID для insert
+ *
+ * @param string $id первичный ключ - уже исзвестен для insert
+ * @param string $value новое значение
+ * @param string $old Старое значение
+ */
+ public function post($id, $value, $old)
+ {
+ }
+
public function action($id, $action='do')
{
die('Был вызван метод '.$action.' для поля '. $this->title);
diff --git a/lib/Modules/Scaffold/ScaffoldController.php b/lib/Modules/Scaffold/ScaffoldController.php
index 1563630..4c21851 100644
--- a/lib/Modules/Scaffold/ScaffoldController.php
+++ b/lib/Modules/Scaffold/ScaffoldController.php
@@ -55,6 +55,28 @@ abstract class ScaffoldController extends Controller
/** @var array сообщения для вывода */
private $messages;
+ /** @var array текущая строка */
+ static private $row;
+
+ /**
+ * Получает текущую строку
+ *
+ * @return array текущая строка
+ */
+ static public function getCurRow()
+ {
+ return self::$row;
+ }
+ /**
+ * устанавливает текущую строку
+ *
+ * @param array $row строка
+ */
+ static public function setCurRow($row)
+ {
+ self::$row = $row;
+ }
+
/**
* Получает данные о полях
*
@@ -105,6 +127,7 @@ abstract class ScaffoldController extends Controller
*/
public function __construct()
{
+ $this->row = array();
Hlp::addCSS('built-in/scaffold.css');
if ($this->useJs)
{
@@ -297,6 +320,7 @@ abstract class ScaffoldController extends Controller
$data[$f] = call_user_func(array(get_class($this), 'default_'.ucfirst($f)));
else
$data[$f] = $this->fields[$f]->def();
+ self::setCurRow($data);
$state = new TemplaterState(QFW::$view);
QFW::$view->setScriptPath(dirname(__FILE__));
@@ -341,6 +365,7 @@ abstract class ScaffoldController extends Controller
$this->sess['return'] = $_SERVER['HTTP_REFERER'];
$data = $this->getOldVars($id);
+ self::setCurRow($data);
$state = new TemplaterState(QFW::$view);
QFW::$view->setScriptPath(dirname(__FILE__));
@@ -365,6 +390,7 @@ abstract class ScaffoldController extends Controller
$old = $this->getOldVars($id);
if (!$old)
QFW::$router->redirect(Url::C('index'), true);
+ self::setCurRow($old);
foreach($this->fields as $k=>$v)
$v->proccess($id, false, $old[$k]);
QFW::$db->query('DELETE FROM ?# WHERE ?#=?',
@@ -394,8 +420,11 @@ abstract class ScaffoldController extends Controller
$this->primaryKey, array($this->table=>array_merge($this->order, array('*'))),
$this->table, $this->primaryKey, $ids);
foreach($olds as $id=>$old)
+ {
+ self::setCurRow($old);
foreach($this->fields as $k=>$v)
$v->proccess($id, false, $old[$k]);
+ }
QFW::$db->query('DELETE FROM ?# WHERE ?# IN (?a)',
$this->table, $this->primaryKey, $ids);
$this->messages['success'][] = 'Выбранные записи удалены';
@@ -472,6 +501,8 @@ abstract class ScaffoldController extends Controller
$errors = array();
//Обработка результата редактирования
foreach($alldata as $id => $data)
+ {
+ self::setCurRow($old);
foreach ($data as $k=>$v)
{
if (isset($this->methods['validator_'.ucfirst($k)]))
@@ -483,6 +514,7 @@ abstract class ScaffoldController extends Controller
if ($res === false)
$errors[$k] = 'Поле '.$this->fields[$k]->title.' имеет некорректное значение';
}
+ }
//Если ошибок нет, то записываем в базу изменения
if (count($errors))
@@ -494,7 +526,8 @@ abstract class ScaffoldController extends Controller
foreach($alldata as $id => $data)
{
$old = $this->getOldVars($id);
- //Обработка данных после POST
+ self::setCurRow($old);
+ //Обработка данных перед POST
foreach ($this->fields as $k=>$class)
if ($k == $this->primaryKey && !isset($data[$k]))
continue; //не трогаем первичный ключ
@@ -513,6 +546,17 @@ abstract class ScaffoldController extends Controller
QFW::$db->query('UPDATE ?# SET ?a WHERE ?#=?',
$this->table, $data, $this->primaryKey, $id);
+ //Обработка данных после POST
+ foreach ($this->fields as $k=>$class)
+ if ($k == $this->primaryKey && !isset($data[$k]))
+ continue; //не трогаем первичный ключ
+ elseif (isset($this->methods['post_'.ucfirst($k)]))
+ $data[$k] = call_user_func(array($this, 'post_'.ucfirst($k)),
+ isset($data[$k]) ? $data[$k] : $old[$k], $id == -1 ? $ins_id : $id, $old[$k]);
+ else
+ $data[$k] = $class->post($id == -1 ? $ins_id : $id,
+ isset($data[$k]) ? $data[$k] : $old[$k], $old[$k]);
+
if (isset($this->methods['postEdit']))
call_user_func(array($this, 'postEdit'), $id == -1 ? $ins_id : $id);
}
diff --git a/lib/Modules/Scaffold/scaffold/index.php b/lib/Modules/Scaffold/scaffold/index.php
index 3e522f4..d00f6d8 100644
--- a/lib/Modules/Scaffold/scaffold/index.php
+++ b/lib/Modules/Scaffold/scaffold/index.php
@@ -48,7 +48,7 @@ foreach(current($data) as $key=>$v)
</tr>
</thead>
<tbody>
-<?php foreach($data as $id=>$row) { ?>
+<?php foreach($data as $id=>$row) { $class::setCurRow($row); ?>
<tr>
<td><input type="checkbox" name="id[]" value="<?php echo $id ?>" /></td>
<?php foreach($row as $key=>$v) {
diff --git a/lib/Modules/Scaffold/scaffold/multidel.php b/lib/Modules/Scaffold/scaffold/multidel.php
index 1d2c7f3..23df76f 100644
--- a/lib/Modules/Scaffold/scaffold/multidel.php
+++ b/lib/Modules/Scaffold/scaffold/multidel.php
@@ -16,7 +16,7 @@
</tr>
</thead>
<tbody>
-<?php foreach($data as $id=>$row) { ?>
+<?php foreach($data as $id=>$row) { $class::setCurRow($row); ?>
<tr>
<?php foreach($row as $key=>$v) {
$i = $fields[$key];
diff --git a/lib/Modules/Scaffold/scaffold/multiedit.php b/lib/Modules/Scaffold/scaffold/multiedit.php
index f783b4b..1a58082 100644
--- a/lib/Modules/Scaffold/scaffold/multiedit.php
+++ b/lib/Modules/Scaffold/scaffold/multiedit.php
@@ -19,7 +19,7 @@
</tr>
</thead>
<tbody>
-<?php foreach($data as $id=>$row) { ?>
+<?php foreach($data as $id=>$row) { $class::setCurRow($row); ?>
<tr>
<?php foreach($row as $key=>$v) {
$i = $fields[$key];
commit f4c104f3504ae86db111803ac34730c66978e86f
Author: Ivan Borzenkov <iva...@li...>
Date: Fri Dec 24 17:43:33 2010 +0300
Функция сортировки перенесера вверх
diff --git a/lib/Modules/Scaffold/ScaffoldController.php b/lib/Modules/Scaffold/ScaffoldController.php
index 2676e53..1563630 100644
--- a/lib/Modules/Scaffold/ScaffoldController.php
+++ b/lib/Modules/Scaffold/ScaffoldController.php
@@ -562,6 +562,37 @@ abstract class ScaffoldController extends Controller
QFW::$router->redirect(Url::C('index'), true);
}
+
+ /**
+ * Устанавливает порядок сортировки
+ *
+ * @param string $field Имя поля
+ * @param string $dir Направление сортировки (ASC|DESC|) - пустое - сменить
+ * @return bool Удачно или нет
+ */
+ public function setSort($field='', $dir='')
+ {
+ //такого поля нету
+ if (!isset($this->fields[$field]))
+ return false;
+ //если сортировки в этой таблице еще нет
+ if (!isset($this->sess['sort']))
+ $this->sess['sort'] = array(
+ 'field' => '',
+ 'direction' => '',
+ );
+ //если не указана, то ASC или сменить ASC на DESC
+ if ($dir != 'ASC' && $dir != 'DESC')
+ $dir = ($this->sess['sort']['field'] == $field &&
+ $this->sess['sort']['direction'] == 'ASC')
+ ? 'DESC' : 'ASC';
+ $this->sess['sort'] = array(
+ 'field' => $field,
+ 'direction' => $dir,
+ );
+ return true;
+ }
+
////////////////////////////////////////////////////////////
//Функции для упращения настройки таблицы - удобные сеттеры
////////////////////////////////////////////////////////////
@@ -886,36 +917,6 @@ abstract class ScaffoldController extends Controller
}
/**
- * Устанавливает порядок сортировки
- *
- * @param string $field Имя поля
- * @param string $dir Направление сортировки (ASC|DESC|) - пустое - сменить
- * @return bool Удачно или нет
- */
- public function setSort($field='', $dir='')
- {
- //такого поля нету
- if (!isset($this->fields[$field]))
- return false;
- //если сортировки в этой таблице еще нет
- if (!isset($this->sess['sort']))
- $this->sess['sort'] = array(
- 'field' => '',
- 'direction' => '',
- );
- //если не указана, то ASC или сменить ASC на DESC
- if ($dir != 'ASC' && $dir != 'DESC')
- $dir = ($this->sess['sort']['field'] == $field &&
- $this->sess['sort']['direction'] == 'ASC')
- ? 'DESC' : 'ASC';
- $this->sess['sort'] = array(
- 'field' => $field,
- 'direction' => $dir,
- );
- return true;
- }
-
- /**
* Генерирует сортировку
*
* @return DbSimple_SubQuery Подзапрос сортировки
commit 372e4fff0ad087e01aea21e39ba2264c21dcbf03
Author: Ivan Borzenkov <iva...@li...>
Date: Fri Dec 24 17:40:43 2010 +0300
Прикручет datetime
diff --git a/lib/Modules/Scaffold/Fields.php b/lib/Modules/Scaffold/Fields.php
index bcc62a0..d06ba5a 100644
--- a/lib/Modules/Scaffold/Fields.php
+++ b/lib/Modules/Scaffold/Fields.php
@@ -465,16 +465,17 @@ class Scaffold_Datetime extends Scaffold_Field
public function editor($id, $value)
{
- return QFW::$view->
- assign('id', $id)->
- assign('name', $this->editName($id))->
- assign('value', $value)->
- fetch('scaffold/fields/dateedit.php');
+ //баг - с секундами не отправляет - ограничимся минутами
+ return '<input type="datetime-local" name="'.$this->editName($id).'"
+ default="'.date('Y-m-d\TH:i:00', strtotime($value)).'" />';
}
}
-class Scaffold_Timestamp extends Scaffold_Datetime {}
+class Scaffold_Timestamp extends Scaffold_Datetime {
+ //пока никаких отличий от Scaffold_Datetime
+ //так как в опере баг с datetime - часовой пояс отличный от 0 не работает
+}
/**
diff --git a/lib/Modules/Scaffold/scaffold/fields/dateedit.php b/lib/Modules/Scaffold/scaffold/fields/dateedit.php
deleted file mode 100644
index 061f28e..0000000
--- a/lib/Modules/Scaffold/scaffold/fields/dateedit.php
+++ /dev/null
@@ -1,20 +0,0 @@
-<?php
-Hlp::addCSS('timepicker/jquery-ui-1.8.custom.css');
-Hlp::addJs('js/jquery.js');
-Hlp::addJs('timepicker/jquery-ui-1.8.custom.min.js');
-Hlp::addJs('timepicker/jquery-ui-timepicker-addon.min.js');
-Hlp::addJs('timepicker/jquery-ui-datepicker-ru.js');
-?><input type="text" name="<?php echo $name ?>" default="<?php echo $value?>" class="datepicker" />
-<?php Hlp::sJSe() ?>
-$('.datepicker').datetimepicker({
- showSecond: true,
- dateFormat: 'yy-mm-dd',
- timeFormat: 'hh:mm:ss',
- timeOnlyTitle: 'Выберите время',
- timeText: 'Время',
- hourText: 'Час',
- minuteText: 'Мин',
- secondText: 'Сек',
- currentText: 'Теперь',
-});
-<?php Hlp::eJSe() ?>
commit 591e3944de40be7a6a2363e375989f2175807068
Author: Ivan Borzenkov <iva...@li...>
Date: Fri Dec 24 16:21:37 2010 +0300
Доработки скафолдинга - label
diff --git a/lib/Modules/Scaffold/Fields.php b/lib/Modules/Scaffold/Fields.php
index 0b6cee3..bcc62a0 100644
--- a/lib/Modules/Scaffold/Fields.php
+++ b/lib/Modules/Scaffold/Fields.php
@@ -45,6 +45,8 @@ class Scaffold_Field_Info
public $class = false;
/** @var bool Обязательная колонка */
public $required = false;
+ /** @var bool использовать label */
+ public $label = true;
}
@@ -500,6 +502,7 @@ class Scaffold_File extends Scaffold_Field
public function __construct($info)
{
parent::__construct($info);
+ $this->label = false;
if (empty ($info->typeParams['path']))
throw new Exception('Не указана директория для фалов', 1);
if (!is_dir($info->typeParams['path']))
diff --git a/lib/Modules/Scaffold/scaffold/index.php b/lib/Modules/Scaffold/scaffold/index.php
index 184be51..3e522f4 100644
--- a/lib/Modules/Scaffold/scaffold/index.php
+++ b/lib/Modules/Scaffold/scaffold/index.php
@@ -5,6 +5,7 @@
include 'filterForm.php';
} ?>
+<?php echo $this->block(Url::C('preTable')); ?>
<?php echo $pager; ?>
<?php if (count($data)>0) { $cols = 3 + (empty($actions) ? 0 : 1); // с чекбоксами, редактирование+удаление, действия
@@ -17,7 +18,8 @@ foreach(current($data) as $key=>$v)
<thead>
<tr>
<td colspan="<?php echo $cols ?>">
- <input type="button" class="button" value="Добавить" onclick="window.location.href='<?php echo Url::C('edit/-1') ?>'" />
+ <?php echo $this->block(Url::C('multiPre')); ?>
+ <input type="button" value="Добавить" onclick="window.location.href='<?php echo Url::C('edit/-1') ?>'" />
<input type="submit" name="edit" value="Редактировать выбранных" />
<input type="submit" name="delete" value="Удалить выбранных" />
<?php echo $this->block(Url::C('multiPost')); ?>
@@ -54,25 +56,26 @@ foreach(current($data) as $key=>$v)
if (!$i->disp->list)
continue;
?>
- <td<?php if ($i->class) {?> class="<?php echo $i->class===true ? 'col_'.$key : $i->class ?>"<?php } ?>><?php
+ <td<?php if ($i->class) {?> class="<?php echo $i->class===true ? 'col_'.$key : $i->class ?>"<?php } ?>><?php //отображение обычного не связанного поля
if (isset($methods['display_'.ucfirst($key)]))
echo call_user_func($class.'::display_'.ucfirst($key), $id, $v);
else
echo $i->display($id, $v);
?></td>
<?php } ?>
- <td><a href="<?php echo Url::C('edit/'.$id) ?>">ред.</a></td>
+ <td><a href="<?php echo Url::C('edit/'.$row[$primaryKey]) ?>">ред.</a></td>
<td><a onclick="return confirm('Удалить?')" href="<?php echo
Url::C('delete/'.$row[$primaryKey]) ?>">уд.</a></td>
<?php if (count($actions)) {?><td><?php foreach ($actions as $tit => $uri) { ?>
- <a href="<?php echo Url::C($uri.'/'.$id) ?>"><?php echo $tit ?></a>
+ <a href="<?php echo Url::C($uri.'/'.$row[$primaryKey]) ?>"><?php echo $tit ?></a>
<?php } ?></td><?php } ?>
</tr>
<?php } ?>
</tbody>
<tfoot>
<tr><td colspan="<?php echo $cols ?>">
- <input type="button" class="button" value="Добавить" onclick="window.location.href='<?php echo Url::C('edit/-1') ?>'" />
+ <?php echo $this->block(Url::C('multiPre')); ?>
+ <input type="button" value="Добавить" onclick="window.location.href='<?php echo Url::C('edit/-1') ?>'" />
<input type="submit" name="edit" value="Редактировать выбранных" />
<input type="submit" name="delete" value="Удалить выбранных" />
<?php echo $this->block(Url::C('multiPost')); ?>
commit bf17b4da56c86e1a000179b282a60c6bbb31569e
Author: Ivan Borzenkov <iva...@li...>
Date: Fri Dec 17 20:09:46 2010 +0300
Сохранение в слот возвращает то что сохранила - для удобства
diff --git a/QFW/QuickFW/Cacher/Slot.php b/QFW/QuickFW/Cacher/Slot.php
index b4f853c..6ac8e45 100644
--- a/QFW/QuickFW/Cacher/Slot.php
+++ b/QFW/QuickFW/Cacher/Slot.php
@@ -77,7 +77,7 @@ abstract class Dklab_Cache_Frontend_Slot
* Saves a data for this slot.
*
* @param mixed $data Data to be saved.
- * @return void
+ * @return mixed $data
*/
public function save($data)
{
@@ -87,6 +87,7 @@ abstract class Dklab_Cache_Frontend_Slot
}
$raw = serialize($data);
$this->_getBackend()->save($raw, $this->_id, $tags, $this->_lifetime);
+ return $data;
}
-----------------------------------------------------------------------
Summary of changes:
QFW/Init.php | 11 +--
QFW/QuickFW/Cache.php | 40 --------
QFW/QuickFW/Cacher/Slot.php | 3 +-
QFW/QuickFW/Router.php | 24 +++--
QFW/config.php | 6 +-
application/default.php | 26 +++---
lib/DbSimple/Connect.php | 91 +++++++++++++++++-
lib/Debug/ErrorHook/JabberNotifier.php | 63 ++++++++++++
lib/Debug/ErrorHook/LogNotifier.php | 35 +++++++
lib/Debug/ErrorHook/TextNotifier.php | 2 +-
lib/Modules/Scaffold/Display.php | 39 +++++++-
lib/Modules/Scaffold/Fields.php | 45 ++++++---
lib/Modules/Scaffold/ScaffoldController.php | 107 +++++++++++++++------
lib/Modules/Scaffold/scaffold/fields/dateedit.php | 20 ----
lib/Modules/Scaffold/scaffold/index.php | 15 ++-
lib/Modules/Scaffold/scaffold/multidel.php | 2 +-
lib/Modules/Scaffold/scaffold/multiedit.php | 2 +-
lib/Text.php | 16 +++
lib/utils.php | 99 ++++---------------
19 files changed, 407 insertions(+), 239 deletions(-)
create mode 100644 lib/Debug/ErrorHook/JabberNotifier.php
create mode 100644 lib/Debug/ErrorHook/LogNotifier.php
delete mode 100644 lib/Modules/Scaffold/scaffold/fields/dateedit.php
hooks/post-receive
--
quickfw
|