Make sure module name follows naming conventions

@param   string  $module  The element value for the extension
@return  string
966001
public function canonical($module)
	{
		$module = preg_replace('/[^A-Z0-9_\.-]/i', '', $module);
		if (substr($module, 0, strlen('mod_')) != 'mod_')
		{
			$module = 'mod_' . $module;
		}
		return $module;
	}
996339
protected function getNormalizedName(string $name): string
    {
        $name = str_replace('antaresproject/component-', 'antares/', $name);
        $name = str_replace('antaresproject/module-', 'antares/', $name);

        return str_replace('-', '_', $name);
    }
59219
public static function getLogger($module = "")
    {
        if (is_object($module))
            $module = get_class($module);
        elseif (empty($module) || strtoupper($module) === "ROOT")
            $module = "";
        $module = trim(str_replace('\\', '.', $module), ". \\");

        if (!isset(self::$module_loggers[$module]))
            self::$module_loggers[$module] = new Logger($module);

        return self::$module_loggers[$module];
    }
994162
public function checkModuleExtensionsForIncorrectNamespaceClasses(\OxidEsales\Eshop\Core\Module\Module $module)
    {
        $incorrect = $this->getIncorrectExtensions($module);
        if (!empty($incorrect)) {
            $message = $this->prepareMessage('MODULE_METADATA_PROBLEMATIC_DATA_IN_EXTEND', $incorrect);
            throw new \OxidEsales\Eshop\Core\Exception\ModuleValidationException($message);
        }
    }
782858
protected function get_module_name() {
        if (isset(self::$modulename)) {
            return self::$modulename;
        }
        self::$modulename = get_string('modulename', 'assign');
        return self::$modulename;
    }
717749
public function getModuleIdByClassName($className)
    {
        if (!\OxidEsales\Eshop\Core\NamespaceInformationProvider::isNamespacedClass($className)) {
            return $this->backwardsCompatibleGetModuleIdByClassName($className);
        }

        $moduleId = '';
        $extensions = (array) \OxidEsales\Eshop\Core\Registry::getConfig()->getConfigParam('aModuleExtensions');
        foreach ($extensions as $id => $moduleClasses) {
            if (in_array($className, $moduleClasses)) {
                $moduleId = $id;
                break;
            }
        }

        return $moduleId;
    }
1329294
function getModuleName(module) {
    var script = module.replace(/[^a-zA-Z0-9]/g, '.'),
        parts = script.split('.'),
        name = parts.shift();

    if (parts.length) {
      for (var p in parts) {
        name += parts[p].charAt(0).toUpperCase() + parts[p].substr(1, parts[p].length);
      }
    }
    return name;
  }
1280322
final public function getFunctionName(\Twig_Node_Module $module)
    {
        if (null === $this->functionNamingStrategy) {
            $this->functionNamingStrategy = new DefaultFunctionNamingStrategy();
        }

        return $this->functionNamingStrategy->getFunctionName($module);
    }
347787
function getModuleName(nameWithConditional, variation) {
			var modName;
			var conditionIndex = nameWithConditional.search(conditionalRegEx);

			// look for any "/" after the condition
			var lastSlashIndex = nameWithConditional.indexOf("/",
				nameWithConditional.indexOf("}"));

			// substitution of a folder name
			if (lastSlashIndex !== -1) {
				modName = nameWithConditional.substr(0, conditionIndex) + variation;
			}
			else {
				modName = nameWithConditional.replace(conditionalRegEx, variation);
			}

			return modName;
		}
98437
public static function loadScriptingModule($module)
    {
        $fullScriptPath = false;

        //  Remove any quotes from this passed in module
        $module = trim(str_replace(["'", '"'], null, $module), ' /');

        //  Check the configured script paths
        if (null === ($script = array_get(static::$libraries, $module))) {
            $script = $module;
        }

        foreach (static::$libraryPaths as $key => $path) {
            $checkScriptPath = $path . DIRECTORY_SEPARATOR . $script;

            if (is_file($checkScriptPath) && is_readable($checkScriptPath)) {
                $fullScriptPath = $checkScriptPath;
                break;
            }
        }

        if (!$script || !$fullScriptPath) {
            throw new InternalServerErrorException(
                'The module "' . $module . '" could not be found in any known locations.'
            );
        }

        return file_get_contents($fullScriptPath);
    }
133292
protected function getModuleNamespace()
    {
        if (null === $this->moduleNamespace) {
            $class                 = get_class($this);
            $this->moduleNamespace = substr($class, 0, strpos($class, '\\'));
        }
        return $this->moduleNamespace;
    }
392343
protected function getModuleName(string $namespacedName): ?string
    {
        $pattern = sprintf('#(%s)\\\\(?<moduleName>[\w]+)#', implode('|', static::APPLICATION_LAYERS));

        if (preg_match($pattern, $namespacedName, $matches) === 0) {
            return null;
        }

        return $matches['moduleName'];
    }
653187
public function getModuleByName($name)
    {
        foreach ($this->modules as $module) {
            /* @var $module Module */
            if ($name == $module->getValue()->getName()) {
                return $module;
            }
        }

        return false;
    }
1247224
public function getModule ($module)
	{
		
		// Load modules
		
		$this->getModules ();
		
		// Loop through the modules
		
		foreach ($this->modules as $obj)
		{
			
			// If the module names match and the class exists
			
			if (strtolower ($obj->get ('name')) == $module && class_exists ($obj->getModuleClass ()))
			{
				
				// Return the module
				
				return $obj;
				
			}
			
		}
		
		// Return FALSE
		
		return FALSE;
		
	}
842956
protected function getNameInput(): string
    {
        $name = trim($this->argument('name'));

        if (mb_strpos($name, '/') === false) {
            throw new \Exception('Module name must consist of two segments: vendor/module');
        }

        return $name;
    }
74397
public function module(Module $module)
    {
        $vars = $this->model::generate_page($module, 'setting');
        
        return $this->makeResponse('module', $vars);
    }
749206
public function getPath($module)
    {
        foreach ($this->resolvers as $resolver) {
            $path = $resolver->getPath($module);
            if ($path !==false) {
                return $path;
            }
        }

        return false;
    }