Skip to content

Instantly share code, notes, and snippets.

@thefuxia
Last active January 1, 2016 13:39
Show Gist options
  • Save thefuxia/8152820 to your computer and use it in GitHub Desktop.
Save thefuxia/8152820 to your computer and use it in GitHub Desktop.
interface Mlp_Module_Manager
interface Module_Manager {
/**
* Register a module.
*
* @param array $module Required: slug, description and display_name
* @return bool TRUE if the module is active, FALSE if it isn't.
*/
public function register( Array $module );
/**
* Remove a module from list. Does not remove the entry in the option.
*
* @param string $slug
*/
public function unregister( $slug );
/**
* Check whether a module is active.
*
* @param string $slug
* @return bool
*/
public function is_active( $slug );
/**
* Update activation status of a module.
*
* @param string $slug
* @return array
*/
public function activate( $slug );
/**
* Deactivate a module
*
* @param string $slug
*/
public function deactivate( $slug );
/**
* Update one single module.
*
* @param string $slug
* @param string $key
* @param string $value
* @return array Complete module data.
*/
public function update_module( $slug, $key, $value );
/**
* Get all modules or specific states.
*
* @param string $status 'all', 'active' or 'inactive'.
* @return array
*/
public function get_modules( $status = 'all' );
/**
* Get all data of one module.
*
* @param string $slug
* @return array
*/
public function get_module( $slug );
/**
* Check if we have any registered modules.
*
* @return bool
*/
public function has_modules();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment