Mercurial > defr > DualBlog
annotate includes/class.factory.php @ 60:46be148257ae
Ces fichiers n'auraient pas du se trouver là...
| author | Franck Deroche <webmaster@defr.org> |
|---|---|
| date | Tue, 11 Mar 2008 14:55:20 +0100 |
| parents | bdf116822fc6 |
| children |
| rev | line source |
|---|---|
| webmaster@11 | 1 <?php |
| webmaster@11 | 2 class Factory { |
| webmaster@11 | 3 private static $db = null; |
| webmaster@11 | 4 private static $mainTemplate = null; |
| webmaster@11 | 5 private static $skeleton = null; |
| webmaster@28 | 6 private static $request = null; |
| webmaster@11 | 7 |
| webmaster@11 | 8 public static function getDB() { |
| webmaster@11 | 9 if(is_null(Factory::$db)) |
| webmaster@11 | 10 Factory::$db = new DataAccess(); |
| webmaster@11 | 11 return Factory::$db; |
| webmaster@11 | 12 } |
| webmaster@11 | 13 |
| webmaster@11 | 14 public static function getSkeleton() { |
| webmaster@11 | 15 if(is_null(Factory::$skeleton)) |
| webmaster@11 | 16 Factory::$skeleton = new Skeleton(); |
| webmaster@11 | 17 return Factory::$skeleton; |
| webmaster@11 | 18 } |
| webmaster@28 | 19 |
| webmaster@28 | 20 public static function getRequete() { |
| webmaster@28 | 21 if(is_null(Factory::$request)) |
| webmaster@28 | 22 Factory::$request = new Requete(); |
| webmaster@28 | 23 return Factory::$request; |
| webmaster@28 | 24 } |
| webmaster@11 | 25 } |
| webmaster@11 | 26 |
