Plugin API » Utilities
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.
Get the version string of OpenVBX.
None
OpenVBX::version();
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.
None
OpenVBX::schemaVersion();
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. */
}
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.
None
OpenVBX::getLatestSchemaVersion();
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');
}
Gets the date of the current Twilio API.
None
OpenVBX::getTwilioApiVersion();
echo OpenVBX::getTwilioApiVersion();
Returns a date version of the twilio api.
2010-04-01