PageRenderTime 58ms CodeModel.GetById 25ms RepoModel.GetById 0ms app.codeStats 0ms

/wp-content/plugins/broken-link-checker/includes/module-base.php

https://bitbucket.org/lgorence/quickpress
PHP | 73 lines | 21 code | 9 blank | 43 comment | 0 complexity | 89a5c2aa3b8f3878e0a53096f158414b MD5 | raw file
Possible License(s): GPL-2.0, LGPL-2.1, AGPL-1.0
  1. <?php
  2. /**
  3. * @author Janis Elsts
  4. * @copyright 2010
  5. */
  6. /**
  7. * Base class for BLC modules.
  8. *
  9. * @package Broken Link Checker
  10. * @author Janis Elsts
  11. * @access public
  12. */
  13. class blcModule {
  14. var $module_id; //The ID of this module. Usually a lowercase string.
  15. var $cached_header; //An associative array containing the header data of the module file.
  16. /** @var blcConfigurationManager $plugin__conf */
  17. var $plugin_conf; //A reference to the plugin's global configuration object.
  18. var $module_manager; //A reference to the module manager.
  19. /**
  20. * Class constructor
  21. *
  22. * @param string $module_id
  23. * @param array $cached_header
  24. * @param blcConfigurationManager $plugin_conf
  25. * @param blcModuleManager $module_manager
  26. * @return void
  27. */
  28. function blcModule($module_id, $cached_header, &$plugin_conf, &$module_manager){
  29. $this->module_id = $module_id;
  30. $this->cached_header = $cached_header;
  31. $this->plugin_conf = &$plugin_conf;
  32. $this->module_manager = &$module_manager;
  33. $this->init();
  34. }
  35. /**
  36. * Module initializer. Called when the module is first instantiated.
  37. * The default implementation does nothing. Override it in a subclass to
  38. * specify some sort of start-up behaviour.
  39. *
  40. * @return void
  41. */
  42. function init(){
  43. //Should be overridden in a sub-class.
  44. }
  45. /**
  46. * Called when the module is activated.
  47. * Should be overridden in a sub-class.
  48. *
  49. * @return void
  50. */
  51. function activated(){
  52. //Should be overridden in a sub-class.
  53. }
  54. /**
  55. * Called when the module is deactivated.
  56. * Should be overridden in a sub-class.
  57. *
  58. * @return void
  59. */
  60. function deactivated(){
  61. //Should be overridden in a sub-class.
  62. }
  63. }
  64. ?>