Overview

Namespaces

  • Sleepy
  • Module
    • Authentication
    • CSV
    • DB
    • FormBuilder
    • FSDB
    • IP2Country
    • Mailer
    • MobiDetect
    • Navigation
    • StaticCache
  • PHP

Classes

  • DB
  • Grid
  • Record
  • Overview
  • Namespace
  • Class
  • Tree
  • Deprecated
  • Todo

Class DB

Implements a singleton database class

This abstract class is to ensure that only one PDO instance is used. You get a instance of the database with:

Usage

\Module\DB\DB::$dbhost = 'localhost';
  \Module\DB\DB::$dbname = 'db';
  \Module\DB\DB::$dbuser = 'username';
  \Module\DB\DB::$dbpass = 'itsmeopenup';
  $db = \Module\DB\DB::getInstance();

Changelog

Version 1.12

  • Added the date section to the documentation
Abstract
Namespace: Module\DB
License: http://opensource.org/licenses/MIT
Author: Jaime A. Rodriguez hi.i.am.jaime@gmail.com
Version: 1.2
Date: August 13, 2014
Located at class.db.php
Methods summary
private
# __construct( )

Sets constructor to private, prevents new instances

Sets constructor to private, prevents new instances

private
# __clone( )

Sets __clone to private, prevents clones

Sets __clone to private, prevents clones

public static object
# getInstance( )

Gets the DB instance or creates an initial connection

Gets the DB instance or creates an initial connection

Returns

object
(PDO)
Properties summary
private static $instance

PDO The single instance is stored here.

PDO The single instance is stored here.

Private

# NULL
public static $dbhost

string The database host

string The database host

# DBHOST
public static $dbname

string The database name

string The database name

# DBNAME
public static $dbuser

string The database user

string The database user

# DBUSER
public static $dbpass

string The database password

string The database password

# DBPASS
sleepyMUSTACHE v.0.8 API documentation generated by ApiGen