Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /*
- *
- * @ This file is created by http://DeZender.Net
- * @ deZender (PHP5 Decoder for ionCube Encoder)
- *
- * @ Version : 3.5.0.0
- * @ Author : DeZender
- * @ Release on : 22.06.2018
- * @ Official site : http://DeZender.Net
- *
- */
- namespace WHMCS\Module;
- abstract class AbstractModule
- {
- protected $type = '';
- protected $loadedmodule = '';
- protected $metaData = array();
- protected $moduleParams = array();
- protected $usesDirectories = true;
- protected $cacheActiveModules = null;
- const TYPE_ADMIN = 'admin';
- const TYPE_ADDON = 'addons';
- const TYPE_FRAUD = 'fraud';
- const TYPE_GATEWAY = 'gateways';
- const TYPE_NOTIFICATION = 'notifications';
- const TYPE_REGISTRAR = 'registrars';
- const TYPE_REPORT = 'reports';
- const TYPE_SECURITY = 'security';
- const TYPE_SERVER = 'servers';
- const TYPE_SOCIAL = 'social';
- const TYPE_SUPPORT = 'support';
- const TYPE_WIDGET = 'widgets';
- const ALL_TYPES = null;
- const FUNCTIONDOESNTEXIST = '!Function not found in module!';
- public function getType()
- {
- return $this->type;
- }
- protected function setLoadedModule($module)
- {
- $this->loadedmodule = $module;
- }
- public function getLoadedModule()
- {
- return $this->loadedmodule;
- }
- public function getList($type = '')
- {
- if ($type) {
- $this->setType($type);
- }
- $base_dir = $this->getBaseModuleDir();
- if (is_dir($base_dir)) {
- $modules = array();
- $dh = opendir($base_dir);
- while (false !== ($module = readdir($dh))) {
- if (!$this->usesDirectories) {
- $module = str_replace('.php', '', $module);
- }
- if (is_file($this->getModulePath($module))) {
- $modules[] = $module;
- }
- }
- sort($modules);
- return $modules;
- }
- return false;
- }
- protected function getBaseModulesDir()
- {
- return ROOTDIR . DIRECTORY_SEPARATOR . 'modules';
- }
- public function getBaseModuleDir()
- {
- return $this->getBaseModulesDir() . DIRECTORY_SEPARATOR . $this->getType();
- }
- public function getModuleDirectory($module)
- {
- return $this->getBaseModuleDir() . DIRECTORY_SEPARATOR . $module;
- .............................................................................
- ............................................
- ............
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement