Back to ChangeSet class

Method getSchema

public string
getSchema
()
Gets the current database schema, based on the highest version number.
Returns
  • string the schema version for the database
Since
  • 2.5
Class: ChangeSet
Project: Joomla

Method getSchema - Source code

/**
 * Gets the current database schema, based on the highest version number.
 * Note that the .sql files are named based on the version and date, so
 * the file name of the last file should match the database schema version
 * in the #__schemas table.
 *
 * @return  string  the schema version for the database
 *
 * @since   2.5
 */
public function getSchema()
{
    $updateFiles = $this->getUpdateFiles();
    // No schema files found - abort and return empty string
    if (empty($updateFiles)) {
        return '';
    }
    $result = new \SplFileInfo(array_pop($updateFiles));
    return $result->getBasename('.sql');
}