PHP Class RTDBUpdate, rtMedia

Mostrar archivo Open project: rtCamp/rtMedia Class Usage Examples

Public Properties

Property Type Description
$db_version String
$db_version_option_name
$install_db_version
$mu_single_table
$plugin_path
$rt_plugin_info
$schema_path

Public Methods

Method Description
__construct ( $current_version = false, $plugin_path = false, $schema_path = false, $mu_single_table = false ) Set db current and installed version and also plugin info in rt_plugin_info variable.
check_upgrade ( ) : boolean Check upgrade by comparing version db_version.
create_table ( string $sql ) : void Create table using dbDelta.
do_upgrade ( ) : void Do upgrade by comparing version db_version.
genrate_sql ( string $file_name, string $file_content ) : string Genrate sql query.
genrate_table_name ( string $file_name ) : string Genrate table_name.
get_db_version_option_name ( ) : string Get db_version option name.
get_install_db_version ( ) : string Get installed db_version.
table_exists ( string $table ) : boolean Check if table_exists.

Method Details

__construct() public method

Set db current and installed version and also plugin info in rt_plugin_info variable.
public __construct ( $current_version = false, $plugin_path = false, $schema_path = false, $mu_single_table = false )

check_upgrade() public method

Check upgrade by comparing version db_version.
public check_upgrade ( ) : boolean
return boolean

create_table() public method

Create table using dbDelta.
public create_table ( string $sql ) : void
$sql string
return void

do_upgrade() public method

If db_version > install_db_version, then perform.
public do_upgrade ( ) : void
return void

genrate_sql() public method

Genrate sql query.
public genrate_sql ( string $file_name, string $file_content ) : string
$file_name string
$file_content string
return string sql query

genrate_table_name() public method

Genrate table_name.
public genrate_table_name ( string $file_name ) : string
$file_name string
return string

get_db_version_option_name() public method

Get db_version option name.

get_install_db_version() public method

Get installed db_version.
public get_install_db_version ( ) : string
return string

table_exists() static public method

Check if table_exists.
static public table_exists ( string $table ) : boolean
$table string
return boolean

Property Details

$db_version public_oe property

String
public $db_version

$db_version_option_name public_oe property

public $db_version_option_name

$install_db_version public_oe property

public $install_db_version

$mu_single_table public_oe property

public $mu_single_table

$plugin_path public_oe property

public $plugin_path

$rt_plugin_info public_oe property

public $rt_plugin_info

$schema_path public_oe property

public $schema_path