Advertisement
Guest User

Untitled

a guest
Jun 10th, 2019
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.21 KB | None | 0 0
  1. <?php
  2. /*
  3. *
  4. * @ This file is created by http://DeZender.Net
  5. * @ deZender (PHP5 Decoder for ionCube Encoder)
  6. *
  7. * @ Version : 3.5.0.0
  8. * @ Author : DeZender
  9. * @ Release on : 22.06.2018
  10. * @ Official site : http://DeZender.Net
  11. *
  12. */
  13.  
  14. namespace WHMCS\Module;
  15.  
  16. abstract class AbstractModule
  17. {
  18. protected $type = '';
  19. protected $loadedmodule = '';
  20. protected $metaData = array();
  21. protected $moduleParams = array();
  22. protected $usesDirectories = true;
  23. protected $cacheActiveModules = null;
  24.  
  25. const TYPE_ADMIN = 'admin';
  26. const TYPE_ADDON = 'addons';
  27. const TYPE_FRAUD = 'fraud';
  28. const TYPE_GATEWAY = 'gateways';
  29. const TYPE_NOTIFICATION = 'notifications';
  30. const TYPE_REGISTRAR = 'registrars';
  31. const TYPE_REPORT = 'reports';
  32. const TYPE_SECURITY = 'security';
  33. const TYPE_SERVER = 'servers';
  34. const TYPE_SOCIAL = 'social';
  35. const TYPE_SUPPORT = 'support';
  36. const TYPE_WIDGET = 'widgets';
  37. const ALL_TYPES = null;
  38. const FUNCTIONDOESNTEXIST = '!Function not found in module!';
  39.  
  40. public function getType()
  41. {
  42. return $this->type;
  43. }
  44.  
  45. protected function setLoadedModule($module)
  46. {
  47. $this->loadedmodule = $module;
  48. }
  49.  
  50. public function getLoadedModule()
  51. {
  52. return $this->loadedmodule;
  53. }
  54.  
  55. public function getList($type = '')
  56. {
  57. if ($type) {
  58. $this->setType($type);
  59. }
  60.  
  61. $base_dir = $this->getBaseModuleDir();
  62.  
  63. if (is_dir($base_dir)) {
  64. $modules = array();
  65. $dh = opendir($base_dir);
  66.  
  67. while (false !== ($module = readdir($dh))) {
  68. if (!$this->usesDirectories) {
  69. $module = str_replace('.php', '', $module);
  70. }
  71.  
  72. if (is_file($this->getModulePath($module))) {
  73. $modules[] = $module;
  74. }
  75. }
  76. sort($modules);
  77.  
  78. return $modules;
  79. }
  80.  
  81. return false;
  82. }
  83.  
  84. protected function getBaseModulesDir()
  85. {
  86. return ROOTDIR . DIRECTORY_SEPARATOR . 'modules';
  87. }
  88.  
  89. public function getBaseModuleDir()
  90. {
  91. return $this->getBaseModulesDir() . DIRECTORY_SEPARATOR . $this->getType();
  92. }
  93.  
  94. public function getModuleDirectory($module)
  95. {
  96. return $this->getBaseModuleDir() . DIRECTORY_SEPARATOR . $module;
  97. .............................................................................
  98. ............................................
  99. ............
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement