Return the path to Module $module, or false
if not found

@param  string       $module Module name or Namespace
@return string|false
359976
public function getPath($module)
    {
        $dir = $this->dir . DIRECTORY_SEPARATOR . $module;

        if (!is_dir($dir)) {
            return false;
        }

        $find = new Finder();
        $files = $find->files()
            ->in($dir)
            ->name('slender.*');

        if ($files->count() < 1) {
            return false;
        }

        $filesIterator = iterator_to_array($files->getIterator());
        $iterator = array_shift($filesIterator);

        return $iterator->getPath();
    }
1174706
public static function getModuleAlias($module) {
        if (NULL !== $alias = static::getConfig('modules', $module, 'alias', false)) {
            return $alias;
        }

        return Util::camelToHyphen($module);
    }
172239
public function getModuleCustomTable($module)
    {
        $sugarBean = $this->getBean($module);
        $customTable = $sugarBean->get_custom_table_name();
        $data = $this->db->query("SHOW TABLES LIKE '$customTable'");
        if (empty($data)) {
            return '';
        }

        return $customTable;
    }
157945
def find_module_path():
    """"""
    master_modname = __name__.split(".", 1)[0]
    master_module = sys.modules[master_modname]
    #return os.path.dirname(os.path.realpath(os.path.join(inspect.getsourcefile(endpoints), "..")))
    path = os.path.dirname(inspect.getsourcefile(master_module))
    return path
880740
public function getModuleTable($module)
    {
        $sugarBean = $this->getBean($module);
        $tableName = $sugarBean->table_name;
        if (empty($tableName)) {
            throw new SugarException("$module returns an empty table name");
        }

        return $sugarBean->table_name;
    }
289926
public function isCoreModule($module)
    {
        if (!is_string($module)) {
            throw new InvalidArgumentException(sprintf(
                'Module name must be a string, not "%s"', gettype($module)
            ));
        }

        return in_array($module, $this->coreModules);
    }
583008
protected function autoFindController($module, &$path)
    {
        $dir = $this->app->getAppPath() . ($module ? $module . '/' : '') . $this->rule->getConfig('url_controller_layer');
        $suffix = $this->app->getSuffix() || $this->rule->getConfig('controller_suffix') ? ucfirst($this->rule->getConfig('url_controller_layer')) : '';

        $item = [];
        $find = false;

        foreach ($path as $val) {
            $item[] = $val;
            $file = $dir . '/' . str_replace('.', '/', $val) . $suffix . '.php';
            $file = pathinfo($file, PATHINFO_DIRNAME) . '/' . Loader::parseName(pathinfo($file, PATHINFO_FILENAME), 1) . '.php';
            if (is_file($file)) {
                $find = true;
                break;
            } else {
                $dir .= '/' . Loader::parseName($val);
            }
        }

        if ($find) {
            $controller = implode('.', $item);
            $path = array_slice($path, count($item));
        } else {
            $controller = array_shift($path);
        }

        return $controller;
    }
774839
public function getModuleNameByNamespace($namespace = null)
    {
        $defaultNamespace = 'app';
        $currentRoute = app('router')->getCurrentRoute();

        if (is_null($namespace) and !is_null($currentRoute)) {
            $namespace = $currentRoute->getAction()['namespace'];
        }

        if (is_null($namespace)) {
            return $defaultNamespace;
        }

        foreach ($this->moduleLoader->getRegisteredModules() as $module) {
            if (!empty($moduleNamespace = $module->getNamespace())) {
                if (strpos($namespace, $moduleNamespace) === 0) {
                    return $module->getKey();
                }
            }
        }

        return $defaultNamespace;
    }
683928
protected function buildPathFromNamespace($namespace)
    {
        // Prepare the namespace
        $namespace = Framework::prepareNamespace($namespace);
        
        // Load the module
        $moduleManager = $this->framework->getModuleManager();
        $module = $moduleManager->getModule($namespace);
        if ($module === false) {
            return false;
        }
        
        return $module->getDirectory();
    }
990235
protected function getModuleCommands($module)
    {
        $prefix = $module instanceof Application ? '' : $module->getUniqueId() . '/';

        $commands = [];
        foreach (array_keys($module->controllerMap) as $id) {
            $commands[] = $prefix . $id;
        }

        $controllerPath = $module->getControllerPath();
        if (is_dir($controllerPath)) {
            $files = scandir($controllerPath);
            foreach ($files as $file) {
                if (!empty($file) && substr_compare($file, 'Controller.php', -14, 14) === 0) {
                    $controllerClass = $module->controllerNamespace . '\\' . substr(basename($file), 0, -4);
                    if ($this->validateControllerClass($controllerClass)) {
                        $commands[] = $prefix . Inflector::camel2id(substr(basename($file), 0, -14));
                    }
                }
            }
        }

        return $commands;
    }
74397
public function module(Module $module)
    {
        $vars = $this->model::generate_page($module, 'setting');
        
        return $this->makeResponse('module', $vars);
    }
85986
public static function exists($module)
	{
		if (array_key_exists($module, static::$modules))
		{
			return static::$modules[$module];
		}
		else
		{
			$paths = \Config::get('module_paths', array());

			foreach ($paths as $path)
			{
				if (is_dir($path.$module))
				{
					return $path.$module.DS;
				}
			}
		}

		return false;
	}
173381
public static function getModuleInfo($module=null, $parent=null)
	{
		define('DS', DIRECTORY_SEPARATOR);
		if($module != null) {
			$modulePath = Yii::getPathOfAlias('application.modules.'.$module);
			$moduleFile = $module.'.yaml';
			if($parent != null) {
				$modulePath = Yii::getPathOfAlias('application.modules.'.$parent);
				$module = $parent.'-'.$module;
				$moduleFile = $module.'.yaml';
			}
			$YMLPath = $modulePath.'/'.$moduleFile;

			if(!file_exists($YMLPath)) {
				$modulePath = Yii::getPathOfAlias('ommu.'.$module);
				if($parent != null) {
					$modulePath = Yii::getPathOfAlias('ommu.'.$parent);
				}
				$YMLPath = $modulePath.'/'.$moduleFile;
			}
			
		} else
			$YMLPath = Yii::getPathOfAlias('application.libraries.core').DS.'core.yaml';
			
		if(file_exists($YMLPath)) {
			$moduleInfo = self::getArrayFromYML($YMLPath);
			
			return $moduleInfo;
			
		} else
			return false;
	}
981230
def get_module_path(module):
    """"""
    return pathlib.Path(
        os.path.dirname(os.path.abspath(inspect.getfile(module))))
71397
public function module($module = null)
    {
        if (!is_null($module)) {
            $this->module = $module;
            return $this;
        } else {
            return $this->module ?: '';
        }
    }
1363451
public function isDefaultModule($module=null)
	{
	    $mname = '';
	    if (!$module) {
	        $mname = $this->getCurrentModule()->getName();
	    } else {
	        if (is_string($module)) {
	            $mname = $module;
	        } elseif ($module instanceof Module) {
	            $mname = $module->getName();
	        }
	    }
	    
	    return $mname == $this->getDefaultModule()->getName();
	}
460643
private function get_relative_path( $path ) {
            $module_root_dir = $this->get_module_root_dir_path();
            if ( 0 === strpos( $path, $module_root_dir ) ) {
                $path = substr( $path, strlen( $module_root_dir ) );
            }

            return $path;
        }