PHP Class Alternative_Heap

Show file Open project: anttiviljami/wp-safe-updates Class Usage Examples

Public Properties

Property Type Description
$instance

Public Methods

Method Description
__construct ( )
clone_wp_tables ( $alt_heap ) Clones all WordPress original tables to an alternative heap namespace
create_alt_plugins_dir ( $alt_heap = "" ) Create a new plugins directory with symlinks to live plugins
delete_alt_plugins_dirs ( $alt_heap = "" ) Deletes the temp plugins dir for an alternative heap
delete_tmp_wp_tables ( $alt_heap = "" ) Delete temp tables from an alternative heap namespace
fix_plugins_url ( $url, $path = "", $plugin = "" ) plugins_url() fix
get_alt_plugins_dirs ( $alt_heap = "" ) Returns existing alt plugins dir(s) as an array. If $alt_heap is defined, we return only that alt dir
get_alt_prefix ( $alt_heap = "" ) Returns the table prefix for an alternative heap
get_alt_suffix ( $alt_heap = "" ) Returns the plugins dir suffix for an alternative heap
get_tmp_wp_tables ( $alt_heap = "" ) Gets all our alternative WordPress tables
get_wp_tables ( ) Gets all the live WordPress prefixed tables (not our alternative ones)
init ( )
maybe_create_alt_heap ( ) if $_GET[alt_heap] is defined and (@TODO: user has permissions), create that heap and return to it
render_alternative_heap_indicator ( ) Display a notice at the bottom of the window when in an alternative heap

Method Details

__construct() public method

public __construct ( )

clone_wp_tables() public method

Clones all WordPress original tables to an alternative heap namespace
public clone_wp_tables ( $alt_heap )

create_alt_plugins_dir() public method

Create a new plugins directory with symlinks to live plugins
public create_alt_plugins_dir ( $alt_heap = "" )

delete_alt_plugins_dirs() public method

Deletes the temp plugins dir for an alternative heap
public delete_alt_plugins_dirs ( $alt_heap = "" )

delete_tmp_wp_tables() public method

Delete temp tables from an alternative heap namespace
public delete_tmp_wp_tables ( $alt_heap = "" )

fix_plugins_url() public method

When symlinked, the plugins still think they are being run in their realpath. This may cause issues for plugins_url since plugin_basename will not work correctly. Since we can't hook directly there, we'll do it in here.
public fix_plugins_url ( $url, $path = "", $plugin = "" )

get_alt_plugins_dirs() public static method

Returns existing alt plugins dir(s) as an array. If $alt_heap is defined, we return only that alt dir
public static get_alt_plugins_dirs ( $alt_heap = "" )

get_alt_prefix() public static method

Returns the table prefix for an alternative heap
public static get_alt_prefix ( $alt_heap = "" )

get_alt_suffix() public static method

Returns the plugins dir suffix for an alternative heap
public static get_alt_suffix ( $alt_heap = "" )

get_tmp_wp_tables() public static method

Gets all our alternative WordPress tables
public static get_tmp_wp_tables ( $alt_heap = "" )

get_wp_tables() public static method

Gets all the live WordPress prefixed tables (not our alternative ones)
public static get_wp_tables ( )

init() public static method

public static init ( )

maybe_create_alt_heap() public method

if $_GET[alt_heap] is defined and (@TODO: user has permissions), create that heap and return to it

render_alternative_heap_indicator() public method

Display a notice at the bottom of the window when in an alternative heap

Property Details

$instance public static property

public static $instance