PHP Класс Phergie_Plugin_Db, phergie

Автор: Jared Folkins ([email protected])
Наследование: extends Phergie_Plugin_Abstract
Показать файл Открыть проект

Открытые методы

Метод Описание
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

Приватные методы

Метод Описание
_debug ( String $message ) : void Jared's crap debug method
_doesPdoExist ( ) : void Validates that the Pdo Extenstion Exists.

Описание методов

createTable() публичный Метод

@param String $db database reference
public createTable ( String $db, String $sql ) : void
$db String
$sql String create table sql statement @return void
Результат void

createTablesFromSchema() публичный Метод

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
Результат void

dropTable() публичный Метод

TODO Desc
public dropTable ( string $db, string $name ) : boolean
$db string Database name
$name string Table name
Результат boolean True on success

hasTable() публичный Метод

@param String $db database name
public hasTable ( String $db, String $name ) : boolean
$db String
$name String table name @return bool
Результат boolean

init() публичный Метод

@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
Результат object

isResourceDirectory() публичный Метод

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
Результат void

isSchemaFile() публичный Метод

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
Результат void

onLoad() публичный Метод

@return void
public onLoad ( ) : void
Результат void

validateSqlType() публичный Метод

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
Результат boolean