PHP Class Habari\Version

Base class for managing metadata about various Habari objects
Show file Open project: habari/system Class Usage Examples

Public Methods

Method Description
get_apiversion ( ) : integer Get the API version
get_dbversion ( ) : integer Get the database version
get_git_short_hash ( String $path = null ) : String Attempt to return the shortened git hash of any path Habari can access
get_habariversion ( ) : string Get the Habari version
is_devel ( ) : boolean Determine whether this might possibly have a .git directory, based solely on the existence of a hyphen in the release version string.
requires_upgrade ( ) : boolean Determine if the database needs to be updated based on the source database version being newer than the schema last applied to the database
save_dbversion ( ) Store the current database version in the options table

Method Details

get_apiversion() public static method

Get the API version
public static get_apiversion ( ) : integer
return integer The revision in which the most recent API change took place

get_dbversion() public static method

Get the database version
public static get_dbversion ( ) : integer
return integer The revision in which the most recent database change took place

get_git_short_hash() public static method

Attempt to return the shortened git hash of any path Habari can access
public static get_git_short_hash ( String $path = null ) : String
$path String Where to check for a .git directory
return String The first 7 chars of the revision hash

get_habariversion() public static method

Get the Habari version
See also: version_compare
public static get_habariversion ( ) : string
return string A version_compare()-compatible string of this version of Habari

is_devel() public static method

Determine whether this might possibly have a .git directory, based solely on the existence of a hyphen in the release version string.
public static is_devel ( ) : boolean
return boolean True if this is a development version, false if not

requires_upgrade() public static method

Determine if the database needs to be updated based on the source database version being newer than the schema last applied to the database
public static requires_upgrade ( ) : boolean
return boolean True if an update is needed

save_dbversion() public static method

Store the current database version in the options table
public static save_dbversion ( )