1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-08-19 23:11:45 +02:00

oh boy...

- Migrate code base to PHP 5.1+


git-svn-id: file:///svn/phpbb/trunk@8295 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
David M
2008-01-03 17:00:40 +00:00
parent 0f26ffbade
commit 85055ac97f
77 changed files with 827 additions and 3121 deletions

View File

@@ -48,7 +48,7 @@ class dbal_oracle extends dbal
$connect = $sqlserver . (($port) ? ':' . $port : '') . '/' . $database;
}
$this->db_connect_id = ($new_link) ? @ocinlogon($this->user, $sqlpassword, $connect, 'UTF8') : (($this->persistency) ? @ociplogon($this->user, $sqlpassword, $connect, 'UTF8') : @ocilogon($this->user, $sqlpassword, $connect, 'UTF8'));
$this->db_connect_id = ($new_link) ? @oci_new_connect($this->user, $sqlpassword, $connect, 'UTF8') : (($this->persistency) ? @oci_pconnect($this->user, $sqlpassword, $connect, 'UTF8') : @oci_connect($this->user, $sqlpassword, $connect, 'UTF8'));
return ($this->db_connect_id) ? $this->db_connect_id : $this->sql_error('');
}
@@ -58,7 +58,7 @@ class dbal_oracle extends dbal
*/
function sql_server_info()
{
return @ociserverversion($this->db_connect_id);
return @oci_server_version($this->db_connect_id);
}
/**
@@ -74,11 +74,11 @@ class dbal_oracle extends dbal
break;
case 'commit':
return @ocicommit($this->db_connect_id);
return @oci_commit($this->db_connect_id);
break;
case 'rollback':
return @ocirollback($this->db_connect_id);
return @oci_rollback($this->db_connect_id);
break;
}
@@ -308,14 +308,14 @@ class dbal_oracle extends dbal
break;
}
$this->query_result = @ociparse($this->db_connect_id, $query);
$this->query_result = @oci_parse($this->db_connect_id, $query);
foreach ($array as $key => $value)
{
@ocibindbyname($this->query_result, $key, $array[$key], -1);
@oci_bind_by_name($this->query_result, $key, $array[$key], -1);
}
$success = @ociexecute($this->query_result, OCI_DEFAULT);
$success = @oci_execute($this->query_result, OCI_DEFAULT);
if (!$success)
{
@@ -375,7 +375,7 @@ class dbal_oracle extends dbal
*/
function sql_affectedrows()
{
return ($this->query_result) ? @ocirowcount($this->query_result) : false;
return ($this->query_result) ? @oci_num_rows($this->query_result) : false;
}
/**
@@ -398,9 +398,9 @@ class dbal_oracle extends dbal
if ($query_id !== false)
{
$row = array();
$result = @ocifetchinto($query_id, $row, OCI_ASSOC + OCI_RETURN_NULLS);
$row = @oci_fetch_array($query_id, OCI_ASSOC + OCI_RETURN_NULLS);
if (!$result || !$row)
if (!$row)
{
return false;
}
@@ -453,7 +453,7 @@ class dbal_oracle extends dbal
}
// Reset internal pointer
@ociexecute($query_id, OCI_DEFAULT);
@oci_execute($query_id, OCI_DEFAULT);
// We do not fetch the row for rownum == 0 because then the next resultset would be the second row
for ($i = 0; $i < $rownum; $i++)
@@ -479,13 +479,13 @@ class dbal_oracle extends dbal
if (preg_match('#^INSERT[\t\n ]+INTO[\t\n ]+([a-z0-9\_\-]+)#is', $this->last_query_text, $tablename))
{
$query = 'SELECT ' . $tablename[1] . '_seq.currval FROM DUAL';
$stmt = @ociparse($this->db_connect_id, $query);
@ociexecute($stmt, OCI_DEFAULT);
$stmt = @oci_parse($this->db_connect_id, $query);
@oci_execute($stmt, OCI_DEFAULT);
$temp_result = @ocifetchinto($stmt, $temp_array, OCI_ASSOC + OCI_RETURN_NULLS);
@ocifreestatement($stmt);
$temp_array = @oci_fetch_array($stmt, OCI_ASSOC + OCI_RETURN_NULLS);
@oci_free_statement($stmt);
if ($temp_result)
if ($temp_array)
{
return $temp_array['CURRVAL'];
}
@@ -519,7 +519,7 @@ class dbal_oracle extends dbal
if (isset($this->open_queries[(int) $query_id]))
{
unset($this->open_queries[(int) $query_id]);
return @ocifreestatement($query_id);
return @oci_free_statement($query_id);
}
return false;
@@ -553,9 +553,9 @@ class dbal_oracle extends dbal
*/
function _sql_error()
{
$error = @ocierror();
$error = (!$error) ? @ocierror($this->query_result) : $error;
$error = (!$error) ? @ocierror($this->db_connect_id) : $error;
$error = @oci_error();
$error = (!$error) ? @oci_error($this->query_result) : $error;
$error = (!$error) ? @oci_error($this->db_connect_id) : $error;
if ($error)
{
@@ -575,7 +575,7 @@ class dbal_oracle extends dbal
*/
function _sql_close()
{
return @ocilogoff($this->db_connect_id);
return @oci_close($this->db_connect_id);
}
/**
@@ -594,11 +594,11 @@ class dbal_oracle extends dbal
$sql = "SELECT table_name
FROM USER_TABLES
WHERE table_name LIKE '%PLAN_TABLE%'";
$stmt = ociparse($this->db_connect_id, $sql);
ociexecute($stmt);
$stmt = oci_parse($this->db_connect_id, $sql);
oci_execute($stmt);
$result = array();
if (ocifetchinto($stmt, $result, OCI_ASSOC + OCI_RETURN_NULLS))
if ($result = oci_fetch_array($stmt, OCI_ASSOC + OCI_RETURN_NULLS))
{
$table = $result['TABLE_NAME'];
@@ -606,17 +606,17 @@ class dbal_oracle extends dbal
$statement_id = substr(md5($query), 0, 30);
// Remove any stale plans
$stmt2 = ociparse($this->db_connect_id, "DELETE FROM $table WHERE statement_id='$statement_id'");
ociexecute($stmt2);
ocifreestatement($stmt2);
$stmt2 = oci_parse($this->db_connect_id, "DELETE FROM $table WHERE statement_id='$statement_id'");
oci_execute($stmt2);
oci_free_statement($stmt2);
// Explain the plan
$sql = "EXPLAIN PLAN
SET STATEMENT_ID = '$statement_id'
FOR $query";
$stmt2 = ociparse($this->db_connect_id, $sql);
ociexecute($stmt2);
ocifreestatement($stmt2);
oci_execute($stmt2);
oci_free_statement($stmt2);
// Get the data from the plan
$sql = "SELECT operation, options, object_name, object_type, cardinality, cost
@@ -624,24 +624,24 @@ class dbal_oracle extends dbal
START WITH id = 0 AND statement_id = '$statement_id'
CONNECT BY PRIOR id = parent_id
AND statement_id = '$statement_id'";
$stmt2 = ociparse($this->db_connect_id, $sql);
ociexecute($stmt2);
$stmt2 = oci_parse($this->db_connect_id, $sql);
oci_execute($stmt2);
$row = array();
while (ocifetchinto($stmt2, $row, OCI_ASSOC + OCI_RETURN_NULLS))
while ($row = oci_fetch_array($stmt2, OCI_ASSOC + OCI_RETURN_NULLS))
{
$html_table = $this->sql_report('add_select_row', $query, $html_table, $row);
}
ocifreestatement($stmt2);
oci_free_statement($stmt2);
// Remove the plan we just made, we delete them on request anyway
$stmt2 = ociparse($this->db_connect_id, "DELETE FROM $table WHERE statement_id='$statement_id'");
ociexecute($stmt2);
ocifreestatement($stmt2);
$stmt2 = oci_parse($this->db_connect_id, "DELETE FROM $table WHERE statement_id='$statement_id'");
oci_execute($stmt2);
oci_free_statement($stmt2);
}
ocifreestatement($stmt);
oci_free_statement($stmt);
if ($html_table)
{
@@ -654,15 +654,15 @@ class dbal_oracle extends dbal
$endtime = explode(' ', microtime());
$endtime = $endtime[0] + $endtime[1];
$result = @ociparse($this->db_connect_id, $query);
$success = @ociexecute($result, OCI_DEFAULT);
$result = @oci_parse($this->db_connect_id, $query);
$success = @oci_execute($result, OCI_DEFAULT);
$row = array();
while (@ocifetchinto($result, $row, OCI_ASSOC + OCI_RETURN_NULLS))
while ($void = @oci_fetch_array($result, OCI_ASSOC + OCI_RETURN_NULLS))
{
// Take the time spent on parsing rows into account
}
@ocifreestatement($result);
@oci_free_statement($result);
$splittime = explode(' ', microtime());
$splittime = $splittime[0] + $splittime[1];