Checks if directory is vendor directory.

@param string $sModuleDir dir path

@return bool
510171
protected function _isVendorDir($sModuleDir)
    {
        if (!is_dir($sModuleDir)) {
            return false;
        }

        $currentDirectoryContents = scandir($sModuleDir);
        $currentDirectoryContents = array_diff($currentDirectoryContents, ['.', '..']);
        foreach ($currentDirectoryContents as $entry) {
            if (is_dir("$sModuleDir/$entry") && file_exists("$sModuleDir/$entry/metadata.php")) {
                return true;
            }
        }

        return false;
    }
452637
public function dir_closedir()
    {
        if ($this->dirHandle === null) {
            return false;
        } else {
            self::restore();
            closedir($this->dirHandle);
            self::register();
            $this->dirHandle = null;
            return true;
        }
    }
723306
public static function isVendorFile($pathOrFileObject)
    {
        $path = ($pathOrFileObject instanceof \SplFileInfo) ? $pathOrFileObject->getPathname() : $pathOrFileObject;
        if (!file_exists($path)) {
            $message = '"' . $path . '" does not reference a file or directory.';
            throw new \InvalidArgumentException($message);
        }
        // The file path must start with the vendor directory.
        return strpos($path, static::getVendorDirectory()) === 0;
    }
790602
function _is_dir($dir)
    {
        $dirs = explode('/', preg_replace('#^/|/(?=/)|/$#', '', $dir));

        $temp = &$this->dirs;
        foreach ($dirs as $dir) {
            if (!isset($temp[$dir])) {
                return false;
            }
            $temp = &$temp[$dir];
        }
    }
284187
public function getModuleFullPath($sModuleId = null)
    {
        if (!$sModuleId) {
            $sModuleId = $this->getId();
        }

        if ($sModuleDir = $this->getModulePath($sModuleId)) {
            return \OxidEsales\Eshop\Core\Registry::getConfig()->getModulesDir() . $sModuleDir;
        }

        return false;
    }
1278940
public function hasDirectory()
    {
        if (!is_dir($this->getPath()) && !mkdir($this->getPath(), 0775, true)) {
            throw new InvalidCacheDirectoryException('Unable to create cache directory ');
        } elseif (
            !is_readable($this->getPath()) ||
            !is_writable($this->getPath())
        ) {
            if (!chmod($this->getPath(), 0775)) {
                throw new InvalidCacheDirectoryException(
                    'Cache Path Error '.$this->getPath().' directory must be writable'
                );
            }
        }

        return true;
    }
541670
private function isDir($directory)
    {
        if ('/' === $directory) {
            return true;
        }

        if (!@ftp_chdir($this->getConnection(), $directory)) {
            return false;
        }

        // change directory again to return in the base directory
        ftp_chdir($this->getConnection(), $this->directory);

        return true;
    }
717020
public function isIn($dir) {
		if(!$this->formatPath($dir))
			return false;
		return strpos($this->formatPath($this->src()), $this->formatPath($dir)) === 0;
	}
690379
static function findSubdirs( $dir, $includeHidden = false, $excludeItems = false )
    {
        return eZDir::findSubitems( $dir, 'd', false, $includeHidden, $excludeItems );
    }
181809
protected function _isMaildir($dirname)
    {
        if (file_exists($dirname . '/new') && !is_dir($dirname . '/new')) {
            return false;
        }
        if (file_exists($dirname . '/tmp') && !is_dir($dirname . '/tmp')) {
            return false;
        }
        return is_dir($dirname . '/cur');
    }
438907
public function isDirectory($directory)
	{
		$directory = Util::normalizePath($directory);

		return (bool) $this->adapter->isDirectory($directory);
	}
586740
public function is(string $mode): bool
    {
        $rel_dir = $this->getUtilities()->fileSystem->relativeDir();

        return
            ('package' === $mode && $rel_dir) ||
            ('theme' === $mode && !$rel_dir);
    }
536490
public function rmdir($dir)
    {
        return ($this->isConnected() === true) ? ftp_rmdir($this->getConnection(), $dir) : false;
    }
1280335
public function load($sModuleId)
    {
        $sModulePath = $this->getModuleFullPath($sModuleId);
        $sMetadataPath = $sModulePath . "/metadata.php";

        if ($sModulePath && is_readable($sMetadataPath)) {
            $this->includeModuleMetaData($sMetadataPath);
            $this->_blRegistered = true;
            $this->_blMetadata = true;
            $this->_aModule['active'] = $this->isActive();

            return true;
        }

        return false;
    }
478914
protected static function isWordPressThemeDirectory( $directory ) {
		$composer = Composer::getComposerJson( $directory );

		if ( ! $composer ) {
			return false;
		}

		if ( $composer['type'] !== 'wordpress-theme' ) {
			return false;
		}

		return true;
	}
44861
static function isFileInDir($file,$dir) {
		if (!Strings::endsWith($dir, "/")) $dir.="/";
		return Strings::startsWith($file, $dir);
	}
431667
protected function _deleteModuleFiles($sModuleId)
    {
        $aFiles = (array) \OxidEsales\Eshop\Core\Registry::getConfig()->getConfigParam('aModuleFiles');
        unset($aFiles[$sModuleId]);

        $this->_saveToConfig('aModuleFiles', $aFiles);
    }