Plugin API » Utilities

Version

OpenVBX believes in uptime, so we’ve exposed a number of versioning methods to allow developers to keep track of running installations, schemas, upcoming upgrade versions, and twilio api versions.

OpenVBX::version( )

Get the version string of OpenVBX.

Arguments

None

Returns

  • string of OpenVBX version

Usage

OpenVBX::version();

OpenVBX::schemaVersion( )

Get the current installed schema version. Use this when you depend on specific versions of the schema and want your plugins to work many versions.

Arguments

None

Returns

  • Integer of SchemaVersion

Usage

OpenVBX::schemaVersion();

Examples

Use a feature that works in newer schema versions of OpenVBX.

$currentSchemaVersion = OpenVBX::schemaVersion();

if($currentSchemaVersion > 26) {
	/* Do something only supported in schemas newer than version 26. */
}

OpenVBX::getLatestSchemaVersion( )

Get the latest schema version available in the installation. This is not the current schema version installed. This is the version of the schema that is available for upgrade, but hasn’t been done so. You may want to write an upgrade utility using this.

Arguments

None

Returns

  • Integer of SchemaVersion

Usage

OpenVBX::getLatestSchemaVersion();

Examples

Compare versions of the schema to see if the installation is up to date.

$latestSchemaVersion = OpenVBX::getLatestSchemaVersion();
$currentSchemaVersion = OpenVBX::schemaVersion();

if($latestSchemaVersion > $currentSchemaVersion) {
	error_log('You are out of date');
}

OpenVBX::getTwilioApiVersion( )

Gets the date of the current Twilio API.

Arguments

None

Returns

  • string of Twilio API version

Usage

OpenVBX::getTwilioApiVersion();

Examples

echo OpenVBX::getTwilioApiVersion();

Output

Returns a date version of the twilio api.

2010-04-01