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 546866fd02d24540ff67ed6ab1a2236ebf71df42 (commit)
via 5bb4948e715a9e456246433c3e1ea5ab06519e12 (commit)
from c6714502a469a3834a755a661c08f289e0989919 (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 546866fd02d24540ff67ed6ab1a2236ebf71df42
Author: Ivan1986 <iva...@li...>
Date: Tue Mar 30 17:14:32 2010 +0400
Отступы в Error.php
diff --git a/QFW/QuickFW/Error.php b/QFW/QuickFW/Error.php
index 932d4ef..7004293 100644
--- a/QFW/QuickFW/Error.php
+++ b/QFW/QuickFW/Error.php
@@ -1,71 +1,71 @@
<?php
- /**
- * Функция - обработчик ошибок
- * На продакшене записывает в лог
- * На тестовом вылетает как эксепшн
- */
- function exception_error_handler($errno, $errstr, $errfile, $errline )
+/**
+ * Функция - обработчик ошибок
+ * На продакшене записывает в лог
+ * На тестовом вылетает как эксепшн
+ */
+function exception_error_handler($errno, $errstr, $errfile, $errline )
+{
+ if (QFW::$config['QFW']['release'])
{
- if (QFW::$config['QFW']['release'])
- {
- require_once LIBPATH.'/Log.php';
- Log::log($errstr.' in '.$errfile.' on line '.$errline,'debug');
- return false;
- }
- throw new ErrorException($errstr, 0, $errno, $errfile, $errline);
+ require_once LIBPATH.'/Log.php';
+ Log::log($errstr.' in '.$errfile.' on line '.$errline,'debug');
+ return false;
}
- set_error_handler("exception_error_handler");
+ throw new ErrorException($errstr, 0, $errno, $errfile, $errline);
+}
+set_error_handler("exception_error_handler");
- /**
- * Обработка исключений
- * Обрабатывает исключение неавторизованности как нормальное - показом контента
- * Исключение 404 - показывает ошибку 404
- * Остальные - на продакшене 404 и в лог
- * в дебаге - на страницу
- */
- function exception_handler(Exception $exception)
+/**
+ * Обработка исключений
+ * Обрабатывает исключение неавторизованности как нормальное - показом контента
+ * Исключение 404 - показывает ошибку 404
+ * Остальные - на продакшене 404 и в лог
+ * в дебаге - на страницу
+ */
+function exception_handler(Exception $exception)
+{
+ $GLOBALS['DONE'] = 1;
+ if ($exception instanceof AuthException)
+ echo $exception->getMessage();
+ elseif ($exception instanceof S404Exception)
+ QFW::$router->show404();
+ elseif (QFW::$config['QFW']['release'])
{
- $GLOBALS['DONE'] = 1;
- if ($exception instanceof AuthException)
- echo $exception->getMessage();
- elseif ($exception instanceof S404Exception)
- QFW::$router->show404();
- elseif (QFW::$config['QFW']['release'])
- {
- require_once LIBPATH.'/Log.php';
- Log::log("Uncaught exception: " . $exception->getMessage(),'debug');
- QFW::$router->show404();
- }
- else
- echo "Uncaught exception: " , $exception->getMessage(), "\n";
+ require_once LIBPATH.'/Log.php';
+ Log::log("Uncaught exception: " . $exception->getMessage(),'debug');
+ QFW::$router->show404();
}
- set_exception_handler('exception_handler');
+ else
+ echo "Uncaught exception: " , $exception->getMessage(), "\n";
+}
+set_exception_handler('exception_handler');
- /**
- * Классы исключений
- *
- */
- class AuthException extends Exception {}
- class S404Exception extends Exception {}
+/**
+ * Классы исключений
+ *
+ */
+class AuthException extends Exception {}
+class S404Exception extends Exception {}
- /**
- * Перехватчик фатальных ошибок
- * В случае фатальной ошибки может что-то сделать
- * TODO: Дописать коммент
- */
- function FatalErrorHandler($text)
- {
- //тут определим что жопа не случилась
- if ($GLOBALS['DONE'])
- return false;
- // Случилась жопа, начинаем обработку ошибок
- QFW::Init();
- require_once LIBPATH.'/Log.php';
- Log::log("Fatal Error" ,'critical');
- //TODO: Выдирать лог ошибок и отправлять последние куда-то
- return $text;
- }
- ob_start('FatalErrorHandler');
+/**
+ * Перехватчик фатальных ошибок
+ * В случае фатальной ошибки может что-то сделать
+ * TODO: Дописать коммент
+ */
+function FatalErrorHandler($text)
+{
+ //тут определим что жопа не случилась
+ if ($GLOBALS['DONE'])
+ return false;
+ // Случилась жопа, начинаем обработку ошибок
+ QFW::Init();
+ require_once LIBPATH.'/Log.php';
+ Log::log("Fatal Error" ,'critical');
+ //TODO: Выдирать лог ошибок и отправлять последние куда-то
+ return $text;
+}
+ob_start('FatalErrorHandler');
?>
\ No newline at end of file
commit 5bb4948e715a9e456246433c3e1ea5ab06519e12
Author: Ivan1986 <iva...@li...>
Date: Tue Mar 30 17:14:02 2010 +0400
Исправлены отступы в Cache.php
diff --git a/QFW/QuickFW/Cache.php b/QFW/QuickFW/Cache.php
index b9245fb..db8ac61 100644
--- a/QFW/QuickFW/Cache.php
+++ b/QFW/QuickFW/Cache.php
@@ -1,266 +1,266 @@
<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to li...@ze... so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Cache
+ * @subpackage Zend_Cache_Backend
+ * @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+
+define('CACHE_CLR_ALL','all');
+define('CACHE_CLR_OLD','old');
+define('CACHE_CLR_TAG','tag');
+define('CACHE_CLR_NOT_TAG','notTag');
+
+/**
+ * @package Zend_Cache
+ * @subpackage Zend_Cache_Backend
+ * @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+interface Zend_Cache_Backend_Interface
+{
/**
- * Zend Framework
+ * Set the frontend directives
*
- * LICENSE
+ * @param array $directives assoc of directives
+ */
+ public function setDirectives($directives);
+
+ /**
+ * Test if a cache is available for the given id and (if yes) return it (false else)
*
- * This source file is subject to the new BSD license that is bundled
- * with this package in the file LICENSE.txt.
- * It is also available through the world-wide-web at this URL:
- * http://framework.zend.com/license/new-bsd
- * If you did not receive a copy of the license and are unable to
- * obtain it through the world-wide-web, please send an email
- * to li...@ze... so we can send you a copy immediately.
+ * Note : return value is always "string" (unserialization is done by the core not by the backend)
*
- * @category Zend
- * @package Zend_Cache
- * @subpackage Zend_Cache_Backend
- * @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
- * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @param string|array $id Cache id
+ * @param boolean $doNotTestCacheValidity If set to true, the cache validity won't be tested
+ * @return string|false cached datas
*/
-
- define('CACHE_CLR_ALL','all');
- define('CACHE_CLR_OLD','old');
- define('CACHE_CLR_TAG','tag');
- define('CACHE_CLR_NOT_TAG','notTag');
-
+ public function load($id, $doNotTest = false);
+
/**
- * @package Zend_Cache
- * @subpackage Zend_Cache_Backend
- * @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
- * @license http://framework.zend.com/license/new-bsd New BSD License
+ * Test if a cache is available or not (for the given id)
+ *
+ * @param string|array $id cache id
+ * @return mixed|false (a cache is not available) or "last modified" timestamp (int) of the available cache record
*/
- interface Zend_Cache_Backend_Interface
- {
- /**
- * Set the frontend directives
- *
- * @param array $directives assoc of directives
- */
- public function setDirectives($directives);
-
- /**
- * Test if a cache is available for the given id and (if yes) return it (false else)
- *
- * Note : return value is always "string" (unserialization is done by the core not by the backend)
- *
- * @param string|array $id Cache id
- * @param boolean $doNotTestCacheValidity If set to true, the cache validity won't be tested
- * @return string|false cached datas
- */
- public function load($id, $doNotTest = false);
-
- /**
- * Test if a cache is available or not (for the given id)
- *
- * @param string|array $id cache id
- * @return mixed|false (a cache is not available) or "last modified" timestamp (int) of the available cache record
- */
- public function test($id);
-
- /**
- * Save some string datas into a cache record
- *
- * Note : $data is always "string" (serialization is done by the
- * core not by the backend)
- *
- * @param string $data Datas to cache
- * @param string $id Cache id
- * @param array $tags Array of strings, the cache record will be tagged by each string entry
- * @param int $specificLifetime If != false, set a specific lifetime for this cache record (null => infinite lifetime)
- * @return boolean true if no problem
- */
- public function save($data, $id, $tags = array(), $specificLifetime = false);
-
- /**
- * Remove a cache record
- *
- * @param string $id Cache id
- * @return boolean True if no problem
- */
- public function remove($id);
-
- /**
- * Clean some cache records
- *
- * Available modes are :
- * CACHE_CLR_ALL (default) => remove all cache entries ($tags is not used)
- * CACHE_CLR_OLD => remove too old cache entries ($tags is not used)
- * CACHE_CLR_TAG => remove cache entries matching all given tags
- * ($tags can be an array of strings or a single string)
- * CACHE_CLR_NOT_TAG => remove cache entries not {matching one of the given tags}
- * ($tags can be an array of strings or a single string)
- *
- * @param string $mode Clean mode
- * @param array $tags Array of tags
- * @return boolean true if no problem
- */
- public function clean($mode = CACHE_CLR_ALL, $tags = array());
-
- }
+ public function test($id);
/**
- * Класс со статическими функциями
- * фабрика объектов для работы с кешем
+ * Save some string datas into a cache record
+ *
+ * Note : $data is always "string" (serialization is done by the
+ * core not by the backend)
+ *
+ * @param string $data Datas to cache
+ * @param string $id Cache id
+ * @param array $tags Array of strings, the cache record will be tagged by each string entry
+ * @param int $specificLifetime If != false, set a specific lifetime for this cache record (null => infinite lifetime)
+ * @return boolean true if no problem
*/
- class Cache
- {
- static $cachers=array();
+ public function save($data, $id, $tags = array(), $specificLifetime = false);
- private function __construct() {}
+ /**
+ * Remove a cache record
+ *
+ * @param string $id Cache id
+ * @return boolean True if no problem
+ */
+ public function remove($id);
- /**
- * Фабрика кешеров
- *
- * @param string $name тип кешера
- * @param string $namespace пространство имен
- * @return Zend_Cache_Backend_Interface кешер
- */
- public static function get($name='default', $ns='')
- {
- if (isset(self::$cachers[$name.'_'.$ns]))
- return self::$cachers[$name.'_'.$ns];
- if (isset(self::$cachers['__'.$name]))
- $c = self::$cachers['__'.$name];
- else
- {
- if (!isset(QFW::$config['cache'][$name]))
- throw new Exception('Не найдены парамерты кеша '.$name);
- $data = QFW::$config['cache'][$name];
- $backend=ucfirst($data['module']);
- $cl='Cacher_'.$backend;
- require_once(QFWPATH.'/Cacher/'.$backend.'.php');
- $c=new $cl;
- $c->setDirectives(
- (isset($data['options']) && is_array($data['options']))
- ? $data['options'] : array()
- );
- self::$cachers['__'.$name] = $c;
- }
-
- // если у нас не пустое пространство имен - юзаем проксирующий класс
- if ($n = (isset($data['namespace']) ? $data['namespace'] : '').$ns)
- $c=self::ns($c,$n);
- if (isset($data['tags']) && $data['tags'])
- {
- require_once(QFWPATH.'/QuickFW/Cacher/TagEmu.php');
- $c=new Dklab_Cache_Backend_TagEmuWrapper($c);
- }
- return self::$cachers[$name.'_'.$ns]=$c;
- }
+ /**
+ * Clean some cache records
+ *
+ * Available modes are :
+ * CACHE_CLR_ALL (default) => remove all cache entries ($tags is not used)
+ * CACHE_CLR_OLD => remove too old cache entries ($tags is not used)
+ * CACHE_CLR_TAG => remove cache entries matching all given tags
+ * ($tags can be an array of strings or a single string)
+ * CACHE_CLR_NOT_TAG => remove cache entries not {matching one of the given tags}
+ * ($tags can be an array of strings or a single string)
+ *
+ * @param string $mode Clean mode
+ * @param array $tags Array of tags
+ * @return boolean true if no problem
+ */
+ public function clean($mode = CACHE_CLR_ALL, $tags = array());
- /**
- * Фабрика пространств имен
- *
- * @param string $name имя пространства имен
- * @return Dklab_Cache_Backend_NamespaceWrapper новое пространство имен
- */
- public static function ns(Zend_Cache_Backend_Interface $cacher, $ns='')
- {
- require_once(QFWPATH.'/QuickFW/Cacher/Namespace.php');
- return new Dklab_Cache_Backend_NamespaceWrapper($cacher,$ns);
- }
+}
+
+/**
+ * Класс со статическими функциями
+ * фабрика объектов для работы с кешем
+ */
+class Cache
+{
+ static $cachers=array();
- /**
- * Фабрика слотов
- *
- * @param string $name имя слота
- * @return Dklab_Cache_Frontend_Slot новый слот
- */
- public static function slot($name)
+ private function __construct() {}
+
+ /**
+ * Фабрика кешеров
+ *
+ * @param string $name тип кешера
+ * @param string $namespace пространство имен
+ * @return Zend_Cache_Backend_Interface кешер
+ */
+ public static function get($name='default', $ns='')
+ {
+ if (isset(self::$cachers[$name.'_'.$ns]))
+ return self::$cachers[$name.'_'.$ns];
+ if (isset(self::$cachers['__'.$name]))
+ $c = self::$cachers['__'.$name];
+ else
{
- require_once QFWPATH.'/QuickFW/Cacher/Slot.php';
- require_once APPPATH.'/_common/slots/'.$name.'.php';
- $args = func_get_args();
- array_shift($args);
- $reflectionObj = new ReflectionClass('Slot_'.$name);
- return $reflectionObj->newInstanceArgs($args);
+ if (!isset(QFW::$config['cache'][$name]))
+ throw new Exception('Не найдены парамерты кеша '.$name);
+ $data = QFW::$config['cache'][$name];
+ $backend=ucfirst($data['module']);
+ $cl='Cacher_'.$backend;
+ require_once(QFWPATH.'/Cacher/'.$backend.'.php');
+ $c=new $cl;
+ $c->setDirectives(
+ (isset($data['options']) && is_array($data['options']))
+ ? $data['options'] : array()
+ );
+ self::$cachers['__'.$name] = $c;
}
- /**
- * Фабрика тегов
- *
- * @param string $name имя тега
- * @return Dklab_Cache_Frontend_Tag новый тег
- */
- public static function tag($name)
+ // если у нас не пустое пространство имен - юзаем проксирующий класс
+ if ($n = (isset($data['namespace']) ? $data['namespace'] : '').$ns)
+ $c=self::ns($c,$n);
+ if (isset($data['tags']) && $data['tags'])
{
- require_once QFWPATH.'/QuickFW/Cacher/Tag.php';
- require_once APPPATH.'/_common/tags/'.$name.'.php';
- $args = func_get_args();
- array_shift($args);
- $reflectionObj = new ReflectionClass('Tag_'.$name);
- return $reflectionObj->newInstanceArgs($args);
+ require_once(QFWPATH.'/QuickFW/Cacher/TagEmu.php');
+ $c=new Dklab_Cache_Backend_TagEmuWrapper($c);
}
+ return self::$cachers[$name.'_'.$ns]=$c;
+ }
+ /**
+ * Фабрика пространств имен
+ *
+ * @param string $name имя пространства имен
+ * @return Dklab_Cache_Backend_NamespaceWrapper новое пространство имен
+ */
+ public static function ns(Zend_Cache_Backend_Interface $cacher, $ns='')
+ {
+ require_once(QFWPATH.'/QuickFW/Cacher/Namespace.php');
+ return new Dklab_Cache_Backend_NamespaceWrapper($cacher,$ns);
}
/**
- * нужна для того, что сессии используют кешер и они записывают данные
- * после уничтожения всех обьектов, кешер пересоздается заново
- * для записи сессий
+ * Фабрика слотов
*
- * @deprecated Используйте Cache::get()
+ * @param string $name имя слота
+ * @return Dklab_Cache_Frontend_Slot новый слот
*/
- function &getCache($backend='',$opt=array(),$tags=false,$namespace='')
+ public static function slot($name)
{
- 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];
+ require_once QFWPATH.'/QuickFW/Cacher/Slot.php';
+ require_once APPPATH.'/_common/slots/'.$name.'.php';
+ $args = func_get_args();
+ array_shift($args);
+ $reflectionObj = new ReflectionClass('Slot_'.$name);
+ return $reflectionObj->newInstanceArgs($args);
+ }
- $cl='Cacher_'.$backend;
- require_once(QFWPATH.'/Cacher/'.$backend.'.php');
- $c=new $cl;
+ /**
+ * Фабрика тегов
+ *
+ * @param string $name имя тега
+ * @return Dklab_Cache_Frontend_Tag новый тег
+ */
+ public static function tag($name)
+ {
+ require_once QFWPATH.'/QuickFW/Cacher/Tag.php';
+ require_once APPPATH.'/_common/tags/'.$name.'.php';
+ $args = func_get_args();
+ array_shift($args);
+ $reflectionObj = new ReflectionClass('Tag_'.$name);
+ return $reflectionObj->newInstanceArgs($args);
+ }
- 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;
+/**
+ * нужна для того, что сессии используют кешер и они записывают данные
+ * после уничтожения всех обьектов, кешер пересоздается заново
+ * для записи сессий
+ *
+ * @deprecated Используйте Cache::get()
+ */
+function &getCache($backend='',$opt=array(),$tags=false,$namespace='')
+{
+ 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];
- }
- class Cache_Thru
+ $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)
{
- private $_cacher, $_obj, $_id, $_tags, $_lt;
+ require_once(QFWPATH.'/QuickFW/Cacher/TagEmu.php');
+ $c=new Dklab_Cache_Backend_TagEmuWrapper($c);
+ }
+ $cachers[$key]=&$c;
+ return $cachers[$key];
+}
- public function __construct($Cacher, $obj, $id, $tags, $lifeTime)
- {
- $this->_cacher = $Cacher;
- $this->_obj = $obj;
- $this->_id = $id;
- $this->_tags = $tags;
- $this->_lt = $lifeTime;
- }
+class Cache_Thru
+{
+ private $_cacher, $_obj, $_id, $_tags, $_lt;
- public function __call($method, $args)
- {
- if (false === ($result = $this->_cacher->load($this->_id))) {
- $result = call_user_func_array($this->_obj?array($this->_obj, $method):$method, $args);
- $this->_cacher->save($result, $this->_id, $this->_tags, $this->_lt);
- }
- return $result;
- }
+ public function __construct($Cacher, $obj, $id, $tags, $lifeTime)
+ {
+ $this->_cacher = $Cacher;
+ $this->_obj = $obj;
+ $this->_id = $id;
+ $this->_tags = $tags;
+ $this->_lt = $lifeTime;
}
- function thru($Cacher, $obj, $id, $tags=array(), $lifeTime=null)
+ public function __call($method, $args)
{
- return new Cache_Thru($Cacher, $obj, $id, $tags, $lifeTime);
+ if (false === ($result = $this->_cacher->load($this->_id))) {
+ $result = call_user_func_array($this->_obj?array($this->_obj, $method):$method, $args);
+ $this->_cacher->save($result, $this->_id, $this->_tags, $this->_lt);
+ }
+ return $result;
}
+}
+
+function thru($Cacher, $obj, $id, $tags=array(), $lifeTime=null)
+{
+ return new Cache_Thru($Cacher, $obj, $id, $tags, $lifeTime);
+}
-?>
\ No newline at end of file
+?>
-----------------------------------------------------------------------
Summary of changes:
QFW/QuickFW/Cache.php | 450 ++++++++++++++++++++++++------------------------
QFW/QuickFW/Error.php | 120 +++++++-------
2 files changed, 285 insertions(+), 285 deletions(-)
hooks/post-receive
--
quickfw
|