Return the list of registered modules.
@param string $hook
@return array
484753
public function getModules($hook = null)
    {
        if (isset($hook) && in_array($hook, array_keys($this->modules))) {
            return $this->modules[$hook];
        }

        return $this->modules;
    }
1141701
public function format( $hook ): array {

		$callbacks = [];

		if ( $hook instanceof \WP_Hook ) {
			$hook = $hook->callbacks;
		}

		if ( empty( $hook ) ) {
			return $callbacks;
		}

		ksort( $hook );

		$functions = array_merge( ...$hook );

		foreach ( $functions as $function ) {
			$callback = $this->get_callback_name( $function['function'], $function['accepted_args'] );

			if ( false !== strpos( $callback, 'Hook_Collector' ) ) {
				continue;
			}

			$callbacks[] = $callback;
		}

		return $callbacks;
	}
1058498
public function getModules($current_module = '')
    {
        $st_dir = Config::$dataPath . $this->statisticDir;
        $modules_name_array = array();
        foreach(glob($st_dir."/*", GLOB_ONLYDIR) as $module_file)
        {
            $tmp = explode("/", $module_file);
            $module = end($tmp);
            $modules_name_array[$module] = array();
            if($current_module == $module)
            {
                $st_dir = $st_dir.$current_module.'/';
                $all_interface = array();
                foreach(glob($st_dir."*") as $file)
                {
                    if(is_dir($file))
                    {
                        continue;
                    }
                    list($interface, $date) = explode(".", basename($file));
                    $all_interface[$interface] = $interface;
                }
                $modules_name_array[$module] = $all_interface;
            }
        }
        return $modules_name_array;
    }
749038
public function getModuleHooks($module)
    {
        $hooks = $this->getHooksDefinitionsFromSugar($module);
        if (empty($hooks)) {
            return array();
        }

        $sortedHooks = array();
        $hooksDef = $this->getHooksDefinitionsFromFiles($module);

        // Process hooks in a specific order
        foreach ($this->modulesLogicHooksDef as $type => $hookDesc) {
            if (!array_key_exists($type, $hooks) || empty($hooks[$type])) {
                continue;
            }

            $i = 0;
            foreach ($hooks[$type] as $hook) {
                $num = str_pad($hook[0], 20, 0, \STR_PAD_LEFT) . '_' . $i;
                $sortedHooks[$type][$num] = array(
                    'Weight' => $hook[0],
                    'Description' => $hook[1],
                    'File' => $hook[2],
                    'Class' => $hook[3],
                    'Method' => $hook[4],
                    'Defined In' => $this->findHookInDefinition($hooksDef, $type, $hook[2], $hook[3], $hook[4]),
                );
                $i++;
            }
            ksort($sortedHooks[$type]);
            unset($hooks[$type]);
        }

        // Have I lost some hooks ?
        if (!empty($hooks)) {
            foreach ($hooks as $type => $hooks) {
                foreach ($hooks as $hook) {
                    if (empty($hook)) {
                        continue;
                    }
                    $sortedHooks[$type][] = array(
                        'Weight' => $hook[0],
                        'Description' => $hook[1],
                        'File' => $hook[2],
                        'Class' => $hook[3],
                        'Method' => $hook[4],
                        'Defined In' => $this->findHookInDefinition($hooksDef, $type, $hook[2], $hook[3], $hook[4]),
                    );
                }
            }
        }

        return $sortedHooks;
    }
545467
private function getModules()
    {
        $modules = (array)$this->xml->xpath('/draggy/module');

        $r = '';

        foreach ($modules as $module) {
            $moduleAttributes = (array)$module;
            $moduleAttributes = (array)$moduleAttributes['@attributes'];

            $this->checkMandatoryAttributes('Modules', $moduleAttributes, ['name', 'left', 'top', 'width', 'height']);

            $moduleName = $moduleAttributes['name'];

            $r .= 'var o = new Container(\'' . str_replace('\\', '\\\\', $moduleName) . '\');' . PHP_EOL;
            $r .= 'o.moveTo(\'' . ( $moduleAttributes['left'] - 1 ) . 'px\',\'' . ( $moduleAttributes['top'] - 1 ) . 'px\',\'' . $moduleAttributes['width'] . 'px\',\'' . $moduleAttributes['height'] . 'px\')' . PHP_EOL;

            $this->modules[]                    = $moduleName;
            $this->insideClasses[$moduleName]   = [];
            $this->insideAbstracts[$moduleName] = [];
        }

        return $r;
    }
920800
public static function getHookCommand(string $hook) : string
    {
        if (!self::isValid($hook)) {
            throw new RuntimeException(sprintf('Hook \'%s\' is not supported', $hook));
        }
        return Hooks::getValidHooks()[$hook];
    }
110849
public function getModules(){
        if($this->loadModules != 'ALL'){
            $this->connection->select('name');
            $this->connection->from($this->tableModule);
            $modules= $this->connection->get()->fetchAll(\PDO::FETCH_ASSOC);
            foreach ($modules as $module) {
                $this->getModule($module['name']);
            }
            $this->loadModules= 'ALL';
        }
        return $this->modules;
    }
1283297
function listHookData() {
    // We may come here several times, so cache this.
    if (!empty($this->hook_data)) {
      return $this->hook_data;
    }

    $this->hook_data = $this->environment->getStorage()->retrieve('hooks');
    return $this->hook_data;
  }
326640
public function getRegistered($getBundled = true)
    {
        if ($getBundled) {
            $bundeled = $this->getBundeled();
            self::$registered = array_merge(self::$registered, $bundeled);
        }

        return apply_filters('Modularity/Modules', self::$registered);
    }
328863
public function getModuleIds()
    {
        $aModuleIdsFromExtensions = $this->_getModuleIdsFromExtensions($this->getModulesWithExtendedClass());
        $aModuleIdsFromFiles = array_keys($this->getModuleConfigParametersByKey(static::MODULE_KEY_FILES));

        return array_unique(array_merge($aModuleIdsFromExtensions, $aModuleIdsFromFiles));
    }
319320
public function getAllModules()
    {
        $modules = array_map(function ($value) {
            return $this->loadModule($value);
        }, $this->registry->getMap());

        return array_filter($modules, function ($module) {
            return !is_null($module);
        });
    }
679248
function listHookNamesOptions() {
    $data = $this->getHookDeclarations();

    $return = array();
    foreach ($data as $hook_name => $hook_info) {
      $return[$hook_name] = $hook_info['description'];
    }

    return $return;
  }
1348959
public static function getRegisteredHooks()
    {
        $subscribed = array_keys(self::$hooks);
        $called = array_keys(self::$counters);
        $all = array_merge($subscribed, $called);
        return array_unique($all);
    }
1341844
public static function execute($hook, $params = array())
    {
        $html = '';
        $modules = Hook::getModulesByName($hook);
        if (!$modules || !is_array($modules) || !count($modules))
            return $html;
        else
        {
            foreach ($modules as $module)
            {
                // check module is exists

                if (\File::exists(app_path('Modules/' . $module->author . '/' . $module->name . '/Module.php')))
                {
                    $object = Module::getInstance($module->author, $module->name);
                    if (method_exists($object, 'hook' . ucfirst($hook)))
                    {
                        $html .= $object->{'hook' . ucfirst($hook)}($params);
                    }
                }

            }
        }
        return $html;
    }
1299716
protected function getModuleInfo(): array
    {
        if ($this->moduleInfo === null) {
            $this->moduleInfo = $this->package()->getExtra()['module'] ?? [];
        }

        return $this->moduleInfo;
    }
1154016
private function dispatchModules($hook)
    {
        foreach ($this->modules[$hook] as $module) {
            if (method_exists($module, 'run')) {
                $module->run();
            }
        }
    }
948382
protected function getMyModules()
    {
        $all = array_keys( app()->getLoadedProviders() );
        $modules = [];
        foreach($all as $provider) {
            $parts = explode('\\', $provider);
            if ($parts[0] === 'ErenMustafaOzdal' && array_search($parts[1],$modules) === false) {
                array_push($modules, snake_case($parts[1], '-'));
            }
        }
        return $modules;
    }