diff options
| author | 2013-07-27 17:07:44 +0200 | |
|---|---|---|
| committer | 2013-07-27 17:07:44 +0200 | |
| commit | f6d730f9d1ce7957001bd981f04b32d67ebb44e6 (patch) | |
| tree | 1431d9b1f649eea9eb4531b8b39cd9e2c27f6ec9 /lib | |
| parent | 2c2c57f837c8546b480900631698ba7402396102 (diff) | |
Fix issue #106 : modif nom classes Cache et Log
Passage en Minz_Cache et Minz_Log
Permet d'éviter les redondances quand ces classes sont déjà définies
Je n'utilise pas d'espace de nom parce que beaucoup de boulot et
nécessite obligatoirement php 5.3
Si d'autres classes nécessitent cette modification je le ferai au fur et
à mesure qu'on me remontera les soucis
La version de Minz pour FreshRSS n'est plus compatible avec la version
distribuée à part
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/minz/Cache.php | 2 | ||||
| -rw-r--r-- | lib/minz/Dispatcher.php | 6 | ||||
| -rwxr-xr-x | lib/minz/FrontController.php | 6 | ||||
| -rwxr-xr-x | lib/minz/Log.php | 14 | ||||
| -rwxr-xr-x | lib/minz/View.php | 12 |
5 files changed, 20 insertions, 20 deletions
diff --git a/lib/minz/Cache.php b/lib/minz/Cache.php index 69143a70c..6848e3350 100644 --- a/lib/minz/Cache.php +++ b/lib/minz/Cache.php @@ -7,7 +7,7 @@ /** * La classe Cache permet de gérer facilement les pages en cache */ -class Cache { +class Minz_Cache { /** * $expire timestamp auquel expire le cache de $url */ diff --git a/lib/minz/Dispatcher.php b/lib/minz/Dispatcher.php index 9d08c142b..0cfdd8e75 100644 --- a/lib/minz/Dispatcher.php +++ b/lib/minz/Dispatcher.php @@ -41,14 +41,14 @@ class Dispatcher { * @exception MinzException */ public function run () { - $cache = new Cache(); + $cache = new Minz_Cache(); // Le ob_start est dupliqué : sans ça il y a un bug sous Firefox // ici on l'appelle avec 'ob_gzhandler', après sans. // Vraisemblablement la compression fonctionne mais c'est sale // J'ignore les effets de bord :( ob_start ('ob_gzhandler'); - if (Cache::isEnabled () && !$cache->expired ()) { + if (Minz_Cache::isEnabled () && !$cache->expired ()) { ob_start (); $cache->render (); $text = ob_get_clean(); @@ -80,7 +80,7 @@ class Dispatcher { } } - if (Cache::isEnabled ()) { + if (Minz_Cache::isEnabled ()) { $cache->cache ($text); } } diff --git a/lib/minz/FrontController.php b/lib/minz/FrontController.php index ab951263d..489e3fa33 100755 --- a/lib/minz/FrontController.php +++ b/lib/minz/FrontController.php @@ -45,13 +45,13 @@ class FrontController { $this->router = new Router (); $this->router->init (); } catch (RouteNotFoundException $e) { - Log::record ($e->getMessage (), Log::ERROR); + Minz_Log::record ($e->getMessage (), Minz_Log::ERROR); Error::error ( 404, array ('error' => array ($e->getMessage ())) ); } catch (MinzException $e) { - Log::record ($e->getMessage (), Log::ERROR); + Minz_Log::record ($e->getMessage (), Minz_Log::ERROR); $this->killApp (); } @@ -94,7 +94,7 @@ class FrontController { $this->dispatcher->run (); Response::send (); } catch (MinzException $e) { - Log::record ($e->getMessage (), Log::ERROR); + Minz_Log::record ($e->getMessage (), Minz_Log::ERROR); if ($e instanceof FileNotExistException || $e instanceof ControllerNotExistException || diff --git a/lib/minz/Log.php b/lib/minz/Log.php index 30e4eb6a4..c6f23d900 100755 --- a/lib/minz/Log.php +++ b/lib/minz/Log.php @@ -7,7 +7,7 @@ /** * La classe Log permet de logger des erreurs */ -class Log { +class Minz_Log { /** * Les différents niveau de log * ERROR erreurs bloquantes de l'application @@ -33,19 +33,19 @@ class Log { if (! ($env == Configuration::SILENT || ($env == Configuration::PRODUCTION - && ($level == Log::WARNING || $level == Log::NOTICE)))) { + && ($level == Minz_Log::WARNING || $level == Minz_Log::NOTICE)))) { if (is_null ($file_name)) { $file_name = LOG_PATH . '/application.log'; } switch ($level) { - case Log::ERROR : + case Minz_Log::ERROR : $level_label = 'error'; break; - case Log::WARNING : + case Minz_Log::WARNING : $level_label = 'warning'; break; - case Log::NOTICE : + case Minz_Log::NOTICE : $level_label = 'notice'; break; default : @@ -86,7 +86,7 @@ class Log { $msg_get = str_replace("\n", '', '$_GET content : ' . print_r($_GET, true)); $msg_post = str_replace("\n", '', '$_POST content : ' . print_r($_POST, true)); - self::record($msg_get, Log::NOTICE, $file_name); - self::record($msg_post, Log::NOTICE, $file_name); + self::record($msg_get, Minz_Log::NOTICE, $file_name); + self::record($msg_post, Minz_Log::NOTICE, $file_name); } } diff --git a/lib/minz/View.php b/lib/minz/View.php index 2bb747aa9..1bfa0a61f 100755 --- a/lib/minz/View.php +++ b/lib/minz/View.php @@ -69,9 +69,9 @@ class View { if (file_exists ($this->view_filename)) { include ($this->view_filename); } else { - Log::record ('File doesn\'t exist : `' + Minz_Log::record ('File doesn\'t exist : `' . $this->view_filename . '`', - Log::NOTICE); + Minz_Log::NOTICE); } } @@ -87,9 +87,9 @@ class View { if (file_exists ($fic_partial)) { include ($fic_partial); } else { - Log::record ('File doesn\'t exist : `' + Minz_Log::record ('File doesn\'t exist : `' . $fic_partial . '`', - Log::WARNING); + Minz_Log::WARNING); } } @@ -105,9 +105,9 @@ class View { if (file_exists ($fic_helper)) { include ($fic_helper); } else { - Log::record ('File doesn\'t exist : `' + Minz_Log::record ('File doesn\'t exist : `' . $fic_helper . '`', - Log::WARNING); + Minz_Log::WARNING); } } |
