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;
}