DJJob.php
protected static function getConnection() {
        if (self::$db === null) {
            try {
                self::$db = new PDO(self::$dsn, self::$user, self::$password);
                self::$db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
            } catch (PDOException $e) {
                throw new Exception("DJJob couldn't connect to the database. PDO said [{$e->getMessage()}]");
            }
        }
        return self::$db;
    }
protected static function getConnection() {
        if (self::$db === null) {
            try {
                self::$db = new PDO(self::$dsn, self::$user, self::$password);
                self::$db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
            } catch (PDOException $e) {
                throw new Exception("DJJob couldn't connect to the database. PDO said [{$e->getMessage()}]");
            }
        }
        return self::$db;
    }
protected static function getConnection ( ) { if ( self :: $ db === null ) { try { self :: $ db = new PDO ( self :: $ dsn , self :: $ user , self :: $ password ) ; self :: $ db -> setAttribute ( PDO :: ATTR_ERRMODE , PDO :: ERRMODE_EXCEPTION ) ; } catch ( PDOException $ e ) { throw new Exception ( "DJJob couldn't connect to the database. PDO said [{$e->getMessage()}]" ) ; } } return self :: $ db ; }
Returns the connection DJBase knows about.

Tries to connect if no connection is present.

@return null|PDO The connection if a valid connection is present.
@throws Exception
Returns the connection DJBase knows about .