/** * Gets our instance of the database. * * Session constructor. */ public function __construct() { parent::__construct(); if (parent::GetInstance() == null) { return false; } else { $capsule = parent::GetInstance(); if ($capsule != null) { return true; } } $this->query = new Manager(parent::GetInstance(), "active_sessions"); return false; }
/** * When we have a child. * * Database constructor. */ public function __construct() { /** * Please don't make me! */ if (get_called_class() == null) { return false; } /** * If we already have an instance. */ if (self::$this_class != null) { return false; } /** * If we don't have an instance, create one. */ if (Database::GetInstance() == null) { Database::CreateInstance(); } else { return Database::GetInstance(); } /** * Populate this class into the global spectrum. */ self::$this_class->{$this}; /** * Initialize our database connection. */ self::InitializeInstance(); /** * Return true if our instance is not null */ if (Database::GetInstance() != null) { return true; } /** * Return false if so. */ return false; }