PHP Class Phergie_Plugin_Db, phergie

Inheritance: extends Phergie_Plugin_Abstract
Afficher le fichier Open project: phergie/phergie

Méthodes publiques

Méthode 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

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

Method Details

createTable() public méthode

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

createTablesFromSchema() public méthode

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
Résultat void

dropTable() public méthode

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

hasTable() public méthode

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

init() public méthode

@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
Résultat object

isResourceDirectory() public méthode

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
Résultat void

isSchemaFile() public méthode

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
Résultat void

onLoad() public méthode

@return void
public onLoad ( ) : void
Résultat void

validateSqlType() public méthode

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
Résultat boolean