FOF30\Database\Installer::findSchemaXml PHP Méthode

findSchemaXml() protected méthode

Find an suitable schema XML file for this database type and return the SimpleXMLElement holding its information
protected findSchemaXml ( ) : null | SimpleXMLElemen\SimpleXMLElement
Résultat null | SimpleXMLElemen\SimpleXMLElement Null if no suitable schema XML file is found
    protected function findSchemaXml()
    {
        $xml = null;
        // Do we have a forced file?
        if ($this->forcedFile) {
            $xml = $this->openAndVerify($this->forcedFile);
            if ($xml !== false) {
                return $xml;
            }
        }
        class_exists('\\JFolder') || \JLoader::import('joomla.filesystem.folder');
        // Get all XML files in the schema directory
        $xmlFiles = \JFolder::files($this->xmlDirectory, '\\.xml$');
        if (empty($xmlFiles)) {
            return $xml;
        }
        foreach ($xmlFiles as $baseName) {
            // Remove any accidental whitespace
            $baseName = trim($baseName);
            // Get the full path to the file
            $fileName = $this->xmlDirectory . '/' . $baseName;
            $xml = $this->openAndVerify($fileName);
            if ($xml !== false) {
                return $xml;
            }
        }
        return null;
    }