return path to the requested module file

@param string $sModule module name (directory name in modules dir)
@param string $sFile   file name to lookup

@throws \OxidEsales\EshopCommunity\Core\Exception\FileException

@return string
184610
public function getModulePath($sModule, $sFile = '')
    {
        if (!$sFile || ($sFile[0] != '/')) {
            $sFile = '/' . $sFile;
        }
        $oModule = oxNew(\OxidEsales\Eshop\Core\Module\Module::class);
        $sModulePath = $oModule->getModulePath($sModule);
        $sFile = $this->getConfig()->getModulesDir() . $sModulePath . $sFile;
        if (file_exists($sFile) || is_dir($sFile)) {
            return $sFile;
        } else {
            /**
             * Do not call oxNew in the exception handling of the module subsystem system, as the same module system will be
             * involved when calling oxNew
             */
            $exception = new \OxidEsales\Eshop\Core\Exception\FileException("Requested file not found for module $sModule ($sFile)");
            if ($this->getConfig()->getConfigParam('iDebug')) {
                throw $exception;
            } else {
                /**
                 * This error should be reported, as it will be the cause of an unexpected behavior of the shop an the
                 * operator should be given a chance to analyse the issue.
                 */
                \OxidEsales\Eshop\Core\Registry::getLogger()->error($exception->getMessage(), [$exception]);
                return '';
            }
        }
    }
73478
public function path($moduleFilePath = null)
    {
        if ($moduleFilePath !== null) {
            $this->_path = dirname($moduleFilePath);
        }
        return $this->_path;
    }
1153278
public function getImageUrl($sFile = null, $bSsl = null)
    {
        if ($sFile) {
            $sValue = $this->getConfig()->getImageUrl($this->isAdmin(), $bSsl, null, $sFile);
        } elseif (($sValue = $this->getViewConfigParam('imagedir')) === null) {
            $sValue = $this->getConfig()->getImageUrl($this->isAdmin(), $bSsl);
            $this->setViewConfigParam('imagedir', $sValue);
        }

        return $sValue;
    }
460272
private function loadModule($modulePath)
    {
        $module = oxNew(\OxidEsales\Eshop\Core\Module\Module::class);
        if (!$module->loadByDir($modulePath)) {
            throw new Exception("Module not found");
        }
        return $module;
    }
66278
protected function getMethodFileAddedName(File $phpCsFile): string
    {
        return $this->getModule($phpCsFile) . $this->getLayer($phpCsFile) . 'Factory';
    }
527919
public function readConfig($configFile) {
        $yamlParser   = new \Symfony\Component\Yaml\Parser();
        $userConfPath = ROOT . DS . 'app' . DS . 'config' . DS . 'modules' . DS . $configFile;
        $userCustomPath = ROOT. DS . 'app'. DS.'modules'.DS.$configFile;
        $composerConfPath = ROOT . DS . 'modules' . DS . $configFile;
        $libConfPath  = ROOT_LIB . DS . 'src' . DS . 'modules' . DS . $configFile;
        if (file_exists($userConfPath)) {
            $confPath = $userConfPath;
        } elseif (file_exists($userCustomPath)) {
            $confPath = $userCustomPath;
        } elseif (file_exists($composerConfPath)) {
            $confPath = $composerConfPath;
        } elseif (file_exists($libConfPath)) {
            $confPath = $libConfPath;
        } else {
            throw new ModuleException ("Module configuration file not found!");
        }

        try {
            $conf = $yamlParser->parse(file_get_contents($confPath));
        } catch (\Symfony\Component\Yaml\Exception\ParseException $e) {
            throw new ModuleException("Unable to parse module configuration
                                            file for AutomaticHeaderFooter module: " . $e->getMessage());
        }
        return $conf;
    }
100887
public function GetLink($sMode = '', $aAdditionalParameter = array())
    {
        if (!empty($sMode)) {
            $aAdditionalParameter[MTPkgShopWishlistCore::URL_MODE_PARAMETER_NAME] = $sMode;
        }
        $oShopConfig = TdbShop::GetInstance();

        return $oShopConfig->GetLinkToSystemPage('wishlist', $aAdditionalParameter, true);
    }
1364634
public function objectLocalPath($sBucket, $sFilename)
    {
        $sPath = $this->getPath() . $sBucket . '/' . $sFilename;

        if (is_file($sPath)) {
            return $sPath;
        } else {
            $this->setError('Could not find a valid local path for object ' . $sBucket . '/' . $sFilename);
            return false;
        }
    }
389699
public static function skins($sModule, $sSubType = ''): array
    {
        $aSkins = static::filter('skin');
        $aOut   = [];

        foreach ($aSkins as $oSkin) {

            //  Provide a url field for the skin
            if (Functions::isPageSecure()) {
                $oSkin->url = SECURE_BASE_URL . $oSkin->relativePath;
            } else {
                $oSkin->url = BASE_URL . $oSkin->relativePath;
            }

            if ($oSkin->forModule == $sModule) {
                if (!empty($sSubType) && $sSubType == $oSkin->subType) {
                    $aOut[] = $oSkin;
                } elseif (empty($sSubType)) {
                    $aOut[] = $oSkin;
                }
            }
        }

        return $aOut;
    }
1316766
public static function getInstance($configFile = null, $mode = self::APP_MODE_PROD) {
        $c = get_called_class();
        if (!isset(self::$_instances[$c])) {
            // Create an instance
            self::$_instances[$c] = new $c($configFile, $mode);
            // Setup application
            self::$_instances[$c]->setup();
        }

        return self::$_instances[$c];
    }
802292
private function getFilePath($filePath = null)
    {
        $filePath = $filePath ?? $this->filePath ?? null;

        if (null === $filePath) {
            throw NoFilePathGivenException::import();
        }

        return $filePath;
    }
934114
protected function getResource(string $sFile, array $aFields): string
    {
        if (empty(static::RESOURCE_PATH)) {
            throw new NailsException('RESOURCE_PATH is not defined');
        }
        $sResource = require static::RESOURCE_PATH . $sFile;

        foreach ($aFields as $sField => $sValue) {
            $sKey      = '{{' . strtoupper($sField) . '}}';
            $sResource = str_replace($sKey, $sValue, $sResource);
        }

        return $sResource;
    }
876680
protected static function getFilePath(\SplFileInfo $file)
    {
        $path = $file->getPathname();

        $path = trim(str_replace('\\', '/', $path));

        return $path;
    }
1332453
protected function loadModule($sAsset, $sForceType, $mModule)
    {
        if (is_array($mModule)) {
            $sModule   = !empty($mModule[0]) ? $mModule[0] : null;
            $sLocation = !empty($mModule[1]) ? $mModule[1] : null;

        } else {

            $sModule   = $mModule;
            $sLocation = null;
        }

        $sType = $this->determineType($sAsset, $sForceType);
        $sKey  = 'MODULE-' . $sModule . '-' . $sAsset;

        switch ($sType) {

            case 'CSS':

                if ($sLocation == 'BOWER') {
                    $this->aCss[$sKey] = $this->sBaseModuleUrl . $sModule . '/assets/bower_components/' . $sAsset;
                } else {
                    $this->aCss[$sKey] = $this->sBaseModuleUrl . $sModule . '/assets/css/' . $sAsset;
                }
                break;

            case 'JS':

                if ($sLocation == 'BOWER') {
                    $this->aJs[$sKey] = $this->sBaseModuleUrl . $sModule . '/assets/bower_components/' . $sAsset;
                } else {
                    $this->aJs[$sKey] = $this->sBaseModuleUrl . $sModule . '/assets/js/' . $sAsset;
                }
                break;
        }
    }
1109811
public function resolve($pathOrFile)
    {
        if (is_dir($pathOrFile)) {
            $pathOrFile .= DIRECTORY_SEPARATOR . '.docheader';
        }

        if (! is_file($pathOrFile)) {
            throw DocHeaderFileConfiguration::notFound($pathOrFile);
        }

        return $pathOrFile;
    }
558032
protected function getConfigFilename($configFile)
    {
        foreach ($this->configDirectories as $configDirectory) {
            $configPathname = sprintf('%s/%s', $configDirectory, $configFile);
            if (file_exists($configPathname)) {
                return $configPathname;
            }
        }

        return null;
    }
756515
public function findFile($filePath)
    {
        if (file_exists($filePath)) {
            return $filePath;
        }
        foreach ($this->supportedExtensions as $extension)
        {
            $extendedFilePath = $filePath.'.'.$extension;
            if (file_exists($extendedFilePath)) {
                return $extendedFilePath;
            }
            $extendedFilePath = $filePath.'.'.strtoupper($extension);
            if (file_exists($extendedFilePath)) {
                return $extendedFilePath;
            }
            $extendedFilePath = $filePath.'.'.ucfirst($extension);
            if (file_exists($extendedFilePath)) {
                return $extendedFilePath;
            }
        }
        return null;
    }