Implementing the Database class.

* Updated the Database class to work like a Singleton with a getInstance() method.

 * The Database class does not have a private constructor so it can still be instantiated in case someone needs to do so.

 * Replaced Logger class with Log class.

 * Updated Module to have an instance of the Database object as well as the Model class.

 * In my perfect vision for usage, the Module classes should never talk directly to the database, but do so via Models, but I know that's asking a lot, so I'm leaving in some options for folks.

 * Updated documentation.
This commit is contained in:
Josh Sherman 2010-03-16 22:54:21 -04:00
parent 8c1ecea92b
commit cda9c7d28e
43 changed files with 1672 additions and 789 deletions

View file

@ -28,6 +28,14 @@
*/
class Module extends Object
{
/**
* Database
*
* @access protected
* @var object
*/
protected $db = null;
/**
* Page title
*
@ -132,6 +140,8 @@ class Module extends Object
{
parent::__construct();
$this->db = Database::getInstance();
if ($autorun === true)
{
$this->__default();