PHP Class Phergie_Plugin_Db, phergie

Inheritance: extends Phergie_Plugin_Abstract
Show file Open project: phergie/phergie

Public Methods

Method Description
createTable ( String $db, String $sql ) : void Creates database table
createTablesFromSchema ( String $db, String $file ) : void Loads the schema file into array then searches for each table and if not found creates the table
dropTable ( string $db, string $name ) : boolean Drops a table
hasTable ( String $db, String $name ) : boolean Validates that database table exists
init ( string $directory, string $dbFile, string $schemaFile ) : object Initializes database and creates directories if needed
isResourceDirectory ( string $directory ) : void fully specified file name as string used to check that the resource directory does exist
isSchemaFile ( string $file ) : void fully specified file name as string used to check that the schema file does exist
onLoad ( ) : void Checks to see if the necessary extensions are loaded.
validateSqlType ( string $sql, string $type ) : boolean Supply sql statement and one word type parameter (IE, create, update, insert, delete) and the method will validate that the sql contains that syntax

Private Methods

Method Description
_debug ( String $message ) : void Jared's crap debug method
_doesPdoExist ( ) : void Validates that the Pdo Extenstion Exists.

Method Details

createTable() public method

@param String $db database reference
public createTable ( String $db, String $sql ) : void
$db String
$sql String create table sql statement @return void
return void

createTablesFromSchema() public method

Loads the schema file into array then searches for each table and if not found creates the table
public createTablesFromSchema ( String $db, String $file ) : void
$db String Database Table
$file String Filename
return void

dropTable() public method

TODO Desc
public dropTable ( string $db, string $name ) : boolean
$db string Database name
$name string Table name
return boolean True on success

hasTable() public method

@param String $db database name
public hasTable ( String $db, String $name ) : boolean
$db String
$name String table name @return bool
return boolean

init() public method

@param string $directory plugin name
public init ( string $directory, string $dbFile, string $schemaFile ) : object
$directory string
$dbFile string database name @param string $schemaFile schema filename @return object
$schemaFile string
return object

isResourceDirectory() public method

fully specified file name as string used to check that the resource directory does exist
public isResourceDirectory ( string $directory ) : void
$directory string Directory to check
return void

isSchemaFile() public method

fully specified file name as string used to check that the schema file does exist
public isSchemaFile ( string $file ) : void
$file string File to check
return void

onLoad() public method

@return void
public onLoad ( ) : void
return void

validateSqlType() public method

Supply sql statement and one word type parameter (IE, create, update, insert, delete) and the method will validate that the sql contains that syntax
public validateSqlType ( string $sql, string $type ) : boolean
$sql string TODO Desc
$type string TODO Desc
return boolean