Subversion Repositories oidplus

Compare Revisions

Regard whitespace Rev 385 → Rev 386

/trunk/includes/db_updates/update202.inc.php
17,18 → 17,17
* limitations under the License.
*/
 
// DATABASE UPDATE 202 -> 203
// This script will be included by OIDplusDatabaseConnection.class.php inside function afterConnect().
// Parameters: $this is the OIDplusDatabaseConnection class
// $version is the current version (this script MUST increase the number by 1 when it is done)
/**
* This function will be called by OIDplusDatabaseConnection.class.php at method afterConnect().
* @param OIDplusDatabaseConnection $db is the OIDplusDatabaseConnection class
* @param string $version is the current version (this script MUST increase the number by 1 when it is done)
* @throws OIDplusException
*/
function oidplus_dbupdate_202_203(OIDplusDatabaseConnection $db, string &$version) {
if ($db->transaction_supported()) $db->transaction_begin();
 
if (!isset($version)) throw new OIDplusException(_L('Argument "%1" is missing; was the file included in a wrong way?','version'));
if (!isset($this)) throw new OIDplusException(_L('Argument "%1" is missing; was the file included in a wrong way?','this'));
 
if ($this->transaction_supported()) $this->transaction_begin();
 
if ($this->getSlang()::id() == 'mssql') {
$this->query("CREATE FUNCTION [dbo].[getOidArc] (@strList varchar(512), @maxArcLen int, @occurence int)
if ($db->getSlang()::id() == 'mssql') {
$db->query("CREATE FUNCTION [dbo].[getOidArc] (@strList varchar(512), @maxArcLen int, @occurence int)
RETURNS varchar(512) AS
BEGIN
DECLARE @intPos int
68,6 → 67,7
}
 
$version = 203;
$this->query("UPDATE ###config SET value = ? WHERE name = 'database_version'", array($version));
$db->query("UPDATE ###config SET value = ? WHERE name = 'database_version'", array($version));
 
if ($this->transaction_supported()) $this->transaction_commit();
if ($db->transaction_supported()) $db->transaction_commit();
}