本文整理匯總了PHP中JInstaller::setSchemaVersion方法的典型用法代碼示例。如果您正苦於以下問題:PHP JInstaller::setSchemaVersion方法的具體用法?PHP JInstaller::setSchemaVersion怎麽用?PHP JInstaller::setSchemaVersion使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類JInstaller
的用法示例。
在下文中一共展示了JInstaller::setSchemaVersion方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: parseQueries
/**
* Method to parse the queries specified in the `<sql>` tags
*
* @return void
*
* @since 3.4
* @throws RuntimeException
*/
protected function parseQueries()
{
// Let's run the queries for the extension
if (in_array($this->route, array('install', 'discover_install', 'uninstall'))) {
// This method may throw an exception, but it is caught by the parent caller
if (!$this->doDatabaseTransactions()) {
throw new RuntimeException(JText::sprintf('JLIB_INSTALLER_ABORT_SQL_ERROR', JText::_('JLIB_INSTALLER_' . strtoupper($this->route)), $this->db->stderr(true)));
}
// Set the schema version to be the latest update version
if ($this->getManifest()->update) {
$this->parent->setSchemaVersion($this->getManifest()->update->schemas, $this->extension->extension_id);
}
} elseif ($this->route == 'update') {
if ($this->getManifest()->update) {
$result = $this->parent->parseSchemaUpdates($this->getManifest()->update->schemas, $this->extension->extension_id);
if ($result === false) {
// Install failed, rollback changes
throw new RuntimeException(JText::sprintf('JLIB_INSTALLER_ABORT_SQL_ERROR', JText::_('JLIB_INSTALLER_' . strtoupper($this->route)), $this->db->stderr(true)));
}
}
}
}