From: Ivan1986 <iva...@us...> - 2011-10-12 16:54:32
|
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 dd7f43757f0006b78b2769383bb5cd4e654b50e6 (commit) via b7ef98ab579cc23a7692fc181ccb9e901c383be9 (commit) via 38326e7a12bfcc71dcf8f6c205e8f6e6e082f882 (commit) via 777d8260cd06f839515d160b2250e90f36a88cc9 (commit) from cb04338a5bc79749ab0011875ea495010ad08a5d (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 dd7f43757f0006b78b2769383bb5cd4e654b50e6 Author: Ivan Borzenkov <iva...@li...> Date: Wed Oct 12 20:52:32 2011 +0400 Более корректный поиск файлов - на fpm не работало diff --git a/QFW/QuickFW/Plugs.php b/QFW/QuickFW/Plugs.php index 84fea86..23c745d 100644 --- a/QFW/QuickFW/Plugs.php +++ b/QFW/QuickFW/Plugs.php @@ -1,6 +1,6 @@ <?php -require_once 'Helpers.php'; +require_once __DIR__.'/Helpers.php'; class QuickFW_Plugs { diff --git a/QFW/Templater/PlainView.php b/QFW/Templater/PlainView.php index c2650d2..4a7f9ca 100644 --- a/QFW/Templater/PlainView.php +++ b/QFW/Templater/PlainView.php @@ -1,6 +1,6 @@ <?php -require_once 'Templater.php'; +require_once __DIR__.'/Templater.php'; /** * Делегат отложенного вызова функции или метода diff --git a/QFW/Templater/Proxy.php b/QFW/Templater/Proxy.php index b92712e..3a9e27c 100644 --- a/QFW/Templater/Proxy.php +++ b/QFW/Templater/Proxy.php @@ -1,6 +1,6 @@ <?php -require_once 'Templater.php'; +require_once __DIR__.'/Templater.php'; class Templater_Proxy extends Templater { diff --git a/QFW/Templater/Smarty.php b/QFW/Templater/Smarty.php index 423684d..78e7bf9 100644 --- a/QFW/Templater/Smarty.php +++ b/QFW/Templater/Smarty.php @@ -1,6 +1,6 @@ <?php -require_once 'Templater.php'; +require_once __DIR__.'/Templater.php'; /** * Обертка для смарти * diff --git a/QFW/Templater/Twig.php b/QFW/Templater/Twig.php index f857609..5385371 100644 --- a/QFW/Templater/Twig.php +++ b/QFW/Templater/Twig.php @@ -1,6 +1,6 @@ <?php -require_once 'Templater.php'; +require_once __DIR__.'/Templater.php'; /** * Обертка для Twig * commit b7ef98ab579cc23a7692fc181ccb9e901c383be9 Author: Ivan Borzenkov <iva...@li...> Date: Tue Sep 27 21:53:27 2011 +0400 Класс для исключения diff --git a/QFW/QuickFW/Config.php b/QFW/QuickFW/Config.php index 96414fe..9e7e450 100644 --- a/QFW/QuickFW/Config.php +++ b/QFW/QuickFW/Config.php @@ -1,6 +1,11 @@ <?php /** + * Класс исключения - не найден файлы для этого модуля + */ +class QuickFWConfigNotFileException extends Exception {} + +/** * Класс для работы с конфигом */ class QuickFW_Config implements ArrayAccess @@ -53,12 +58,8 @@ class QuickFW_Config implements ArrayAccess try { $data = self::loadFromFiles(self::files(false)); } - catch(Exception $e) - { - if ($e->getMessage() == 'Not Exist Config File') - $data = array(); - else - throw $e; + catch(QuickFWConfigNotFileException $e) { + $data = array(); } return new self($data, APPPATH.'/config'); } @@ -108,11 +109,8 @@ class QuickFW_Config implements ArrayAccess try { $this->data[$offset] = $this->load($offset); } - catch(Exception $e) - { - if ($e->getMessage() == 'Not Exist Config File') - return false; - throw $e; + catch(QuickFWConfigNotFileException $e) { + return false; } } return $this->data[$offset]; @@ -162,7 +160,7 @@ class QuickFW_Config implements ArrayAccess array_replace_recursive($data, $new) : $new; } if ($empty) - throw new Exception('Not Exist Config File', 42); + throw new QuickFWConfigNotFileException(); if (QuickFW_Cacher_SysSlot::is_use('config')) $C->save($data); return $data; commit 38326e7a12bfcc71dcf8f6c205e8f6e6e082f882 Author: Ivan Borzenkov <iva...@li...> Date: Tue Sep 27 12:59:43 2011 +0400 В конфиге баг с несуществующим файлом diff --git a/QFW/QuickFW/Config.php b/QFW/QuickFW/Config.php index 7d81ec4..96414fe 100644 --- a/QFW/QuickFW/Config.php +++ b/QFW/QuickFW/Config.php @@ -37,7 +37,7 @@ class QuickFW_Config implements ArrayAccess $files[] = $prefix.'.host.'.$_SERVER['HTTP_HOST'].'.php'; return array( 'files' => $files, - 'key' => $prefix + 'key' => $prefix. (isset($_SERVER['SERVER_NAME']) ? $_SERVER['SERVER_NAME'] : ''). (isset($_SERVER['HTTP_HOST']) ? $_SERVER['HTTP_HOST'] : ''), ); @@ -50,7 +50,17 @@ class QuickFW_Config implements ArrayAccess */ static public function main() { - return new self(self::loadFromFiles(self::files(false)), APPPATH.'/config'); + try { + $data = self::loadFromFiles(self::files(false)); + } + catch(Exception $e) + { + if ($e->getMessage() == 'Not Exist Config File') + $data = array(); + else + throw $e; + } + return new self($data, APPPATH.'/config'); } private $data = array(); @@ -94,7 +104,17 @@ class QuickFW_Config implements ArrayAccess public function offsetGet($offset) { if ($this->dir && !isset($this->data[$offset])) - $this->data[$offset] = $this->load($offset); + { + try { + $this->data[$offset] = $this->load($offset); + } + catch(Exception $e) + { + if ($e->getMessage() == 'Not Exist Config File') + return false; + throw $e; + } + } return $this->data[$offset]; } public function offsetExists($offset) { return isset($this->data[$offset]); } @@ -125,19 +145,24 @@ class QuickFW_Config implements ArrayAccess $C = new QuickFW_Cacher_SysSlot('config_'.$info['key']); if ($data = $C->load()) return $data; - } + }; $data = array(); + $empty = true; foreach($info['files'] as $file) { - $new = array(); + $new = false; if (is_file($file)) $new = include($file); + if ($new !== false) + $empty = false; if ($new === 1 && isset($config)) $new = $config; if (!empty($new)) $data = (is_array($data) && is_array($new)) ? array_replace_recursive($data, $new) : $new; } + if ($empty) + throw new Exception('Not Exist Config File', 42); if (QuickFW_Cacher_SysSlot::is_use('config')) $C->save($data); return $data; commit 777d8260cd06f839515d160b2250e90f36a88cc9 Author: Ivan Borzenkov <iva...@li...> Date: Tue Sep 27 12:59:08 2011 +0400 Системное кеширование отключено по умолчанию diff --git a/QFW/QuickFW/Cacher/SysSlot.php b/QFW/QuickFW/Cacher/SysSlot.php index 3fdd2ea..af8cbdf 100644 --- a/QFW/QuickFW/Cacher/SysSlot.php +++ b/QFW/QuickFW/Cacher/SysSlot.php @@ -9,8 +9,8 @@ class QuickFW_Cacher_SysSlot extends Dklab_Cache_Frontend_Slot protected function _getBackend() { - //return Cache::get('Null'); - return Cache::get('Apc'); + return Cache::get('Null'); + //return Cache::get('Apc'); } public static function is_use($where=false) ----------------------------------------------------------------------- Summary of changes: QFW/QuickFW/Cacher/SysSlot.php | 4 ++-- QFW/QuickFW/Config.php | 33 ++++++++++++++++++++++++++++----- QFW/QuickFW/Plugs.php | 2 +- QFW/Templater/PlainView.php | 2 +- QFW/Templater/Proxy.php | 2 +- QFW/Templater/Smarty.php | 2 +- QFW/Templater/Twig.php | 2 +- 7 files changed, 35 insertions(+), 12 deletions(-) hooks/post-receive -- quickfw |