User:Michaeltwofish/installer refactor

From Habari Project

Jump to: navigation, search
<?php
DatabaseInstaller class 
{
 
	/**
	 * Returns the appropriate type of Connection class for the connect string passed or null on failure
	 *
	 * @param db The name of the database
	 * @return  mixed returns appropriate DatabaseInstaller child class instance or errors out if requiring the db class fails
	 */
	public static function InstallerFactory( $db ) {}
 
	/**
	 * Custom getter
	 *
	 * @param name The property to get
	 * @return  mixed The value of the property
	 * 
	 * Valid properties
	 * - connection_string
	 */
	public static function __get( $name ) {}
 
	/**
	 * Returns form fields required by this database
	 *
	 * @return  string HTML form fields
	 * @todo Use FormUI
	 */
	public function get_form_fields() {}
 
	/**
	 * Check if the supplied credentials can connect to a database
	 *
	 * @return  mixed Boolean true if the supplied credentials connect successfully, an array of errors if not
	 */
	public function check_credentials( $params ) {}
 
	/**
	 * Attempt to install the database
	 *
	 */
	public function install() {}
 
	/**
	 * Perform post installation tasks
	 *
	 */
	public function post_install( $params ) {}
}
 
MySQLInstaller extends DatabaseInstaller {
 
	/**
	 * Check if the supplied credentials can connect to a database
	 *
	 * @return  mixed Boolean true if the supplied credentials connect successfully, an array of errors if not
	 */
	public function check_credentials( $params ) {}
 
}
 
SQLiteInstaller extends DatabaseInstaller {
 
	/**
	 * Check if the supplied credentials can connect to a database
	 *
	 * @return  mixed Boolean true if the supplied credentials connect successfully, an array of errors if not
	 */
	public function check_credentials( $params ) {}
 
	/**
	 * Perform post installation tasks
	 *
	 * Secure database
	 *
	 */
	public function post_install( $params ) {}
}
?>
Personal tools