HTML Logo by World Wide Web Consortium (www.w3.org). Click to learn more about our commitment to accessibility and standards.

ocPortal Developer's Guide: Version information

» Return to Contents



The sources/version.php file is not the largest of source code files, but it does contain the whole identity of the portal ;)

sources/version.php

Global_functions_version.php

Function summary

integer ocp_version ()
string ocp_version_minor ()
float ocp_version_number ()
integer ocp_version_time ()
integer ocp_version_time_major ()

integer ocp_version()

Get the major version of your installation.

Parameters…

Returns…

Description The major version number of your installation
Type integer

Return to the function index for this class Expand: View the source code to this function

string ocp_version_minor()

Get the minor/patch version of your installation. This changes with each release, including bug fix releases. It generally consists of 'a' or 'a.b', where 'a' increments represent major changes and 'b' increments represent tiny changes or alpha/beta/RC numbering.

Parameters…

Returns…

Description The minor/patch version number of your installation (e.g. 0.1 or 1.1 or RC1 or 1 RC1)
Type string

Return to the function index for this class Expand: View the source code to this function

float ocp_version_number()

Get the general version number of your installation (incorporates major and minor verson number).

Parameters…

Returns…

Description The general version number of your installation
Type float

Return to the function index for this class Expand: View the source code to this function

integer ocp_version_time()

Get the timestamp at which this version was released.

Parameters…

Returns…

Description The timestamp at which this version was released.
Type integer

Return to the function index for this class Expand: View the source code to this function

integer ocp_version_time_major()

Get the timestamp at which this MAJOR version was released.

Parameters…

Returns…

Description The timestamp at which this MAJOR version was released.
Type integer

Return to the function index for this class Expand: View the source code to this function

sources/version2.php

Global_functions_version2.php

Function summary

tempcode get_future_version_information ()
string get_version_branch (?float general)
string get_version_dotted (?integer main, ?string minor)
string get_version_dotted__from_anything (string any_format)
array get_version_components__from_dotted (string dotted)
string get_version_pretty__from_dotted (string pretty)
string ocp_version_pretty ()

tempcode get_future_version_information()

Get information about new versions of ocPortal (or more accurately, what's wrong with this version).

Parameters…

Returns…

Description Information about the installed ocPortal version
Type tempcode

Return to the function index for this class Expand: View the source code to this function

string get_version_branch(?float general)

Get branch version number for an ocPortal version.

Parameters…

Name general
Description General version number (NULL: on disk version)
Default value
Type ?float

Returns…

Description Branch version number (NULL: on disk version)
Type string

Return to the function index for this class Expand: View the source code to this function

string get_version_dotted(?integer main, ?string minor)

Get dotted version from given ocPortal-version-registry (version.php) supplied components.

Parameters…

Name main
Description Main version number (NULL: on disk version)
Default value
Type ?integer

Name minor
Description Minor version number (NULL: on disk version)
Default value
Type ?string

Returns…

Description Dotted version number
Type string

Return to the function index for this class Expand: View the source code to this function

string get_version_dotted__from_anything(string any_format)

Gets any random way of writing a version number (in all of ocPortal's history) and makes it a dotted style like "3.2.beta2".Note that the dotted format is compatible with PHP's version_compare function.

Parameters…

Name any_format
Description Any reasonable input
Type string

Returns…

Description Pretty version number
Type string

Return to the function index for this class Expand: View the source code to this function

array get_version_components__from_dotted(string dotted)

Analyse a dotted version number into components.

Parameters…

Name dotted
Description Dotted version number
Type string

Returns…

Description Tuple of components: dotted basis version (i.e. with no alpha/beta/RC component and no trailing zeros), qualifier (blank, or alpha, or beta, or RC), qualifier number (NULL if not an alpha/beta/RC), dotted version number with trailing zeros to always cover 3 components
Type array

Return to the function index for this class Expand: View the source code to this function

string get_version_pretty__from_dotted(string pretty)

Get a pretty version number for an ocPortal version.This pretty style is not used in ocPortal code per se, but is shown to users and hence ocPortal may need to recognise it when searching news posts, download databases, etc.

Parameters…

Name pretty
Description Pretty version number
Type string

Returns…

Description Dotted version number
Type string

Return to the function index for this class Expand: View the source code to this function

string ocp_version_pretty()

Get the full string version of ocPortal that you are running, in 'pretty' format.This is (and must be kept) equivalent to get_version_pretty__from_dotted(get_version_dotted())

Parameters…

Returns…

Description The string saying the full ocPortal version number
Type string

Return to the function index for this class Expand: View the source code to this function