Fix php4 legacy calls

Reviewed-by: Robin Appelman
Reviewboard: http://git.reviewboard.kde.org/r/101549/
This commit is contained in:
Thomas Zander 2011-06-08 23:12:06 +02:00
parent 1ea43dd7f9
commit 80194daec7
4 changed files with 12 additions and 24 deletions

View File

@ -639,7 +639,7 @@ class MDB2
*/
static function isError($data, $code = null)
{
if (is_a($data, 'MDB2_Error')) {
if ($data instanceof MDB2_Error) {
if (is_null($code)) {
return true;
} elseif (is_string($code)) {
@ -666,7 +666,7 @@ class MDB2
*/
static function isConnection($value)
{
return is_a($value, 'MDB2_Driver_Common');
return ($value instanceof MDB2_Driver_Common);
}
// }}}
@ -683,7 +683,7 @@ class MDB2
*/
static function isResult($value)
{
return is_a($value, 'MDB2_Result');
return $value instanceof MDB2_Result;
}
// }}}
@ -700,7 +700,7 @@ class MDB2
*/
static function isResultCommon($value)
{
return is_a($value, 'MDB2_Result_Common');
return ($value instanceof MDB2_Result_Common);
}
// }}}
@ -717,7 +717,7 @@ class MDB2
*/
static function isStatement($value)
{
return is_a($value, 'MDB2_Statement_Common');
return $value instanceof MDB2_Statement_Common;
}
// }}}

View File

@ -127,13 +127,6 @@ class MDB2_Schema_Parser extends XML_Parser
$this->val =new MDB2_Schema_Validate($fail_on_invalid_names, $valid_types, $force_defaults);
}
function MDB2_Schema_Parser($variables, $fail_on_invalid_names = true,
$structure = false, $valid_types = array(),
$force_defaults = true)
{
$this->__construct($variables, $fail_on_invalid_names, $structure, $valid_types, $force_defaults);
}
function startHandler($xp, $element, $attribs)
{
if (strtolower($element) == 'variable') {
@ -503,7 +496,7 @@ class MDB2_Schema_Parser extends XML_Parser
$this->element = implode('-', $this->elements);
}
function &raiseError($msg = null, $xmlecode = 0, $xp = null, $ecode = MDB2_SCHEMA_ERROR_PARSE,$a=null,$b=null,$c=null)
function raiseError($msg = null, $xmlecode = 0, $xp = null, $ecode = MDB2_SCHEMA_ERROR_PARSE,$a=null,$b=null,$c=null)
{
if (is_null($this->error)) {
$error = '';

View File

@ -91,11 +91,6 @@ class MDB2_Schema_Validate
$this->force_defaults = $force_defaults;
}
function MDB2_Schema_Validate($fail_on_invalid_names = true, $valid_types = array(), $force_defaults = true)
{
$this->__construct($fail_on_invalid_names, $valid_types, $force_defaults);
}
// }}}
// {{{ raiseError()

View File

@ -249,7 +249,7 @@ class PEAR
*/
static function isError($data, $code = null)
{
if (is_a($data, 'PEAR_Error')) {
if ($data instanceof PEAR_Error) {
if (is_null($code)) {
return true;
} elseif (is_string($code)) {
@ -305,7 +305,7 @@ class PEAR
function setErrorHandling($mode = null, $options = null)
{
if (isset($this) && is_a($this, 'PEAR')) {
if (isset($this) && $this instanceof PEAR) {
$setmode = &$this->_default_error_mode;
$setoptions = &$this->_default_error_options;
} else {
@ -557,7 +557,7 @@ class PEAR
$code = null,
$userinfo = null)
{
if (isset($this) && is_a($this, 'PEAR')) {
if (isset($this) && $this instanceof PEAR) {
return $this->raiseError($message, $code, null, null, $userinfo);
} else {
return PEAR::raiseError($message, $code, null, null, $userinfo);
@ -653,7 +653,7 @@ class PEAR
function pushErrorHandling($mode, $options = null)
{
$stack = &$GLOBALS['_PEAR_error_handler_stack'];
if (isset($this) && is_a($this, 'PEAR')) {
if (isset($this) && $this instanceof PEAR) {
$def_mode = &$this->_default_error_mode;
$def_options = &$this->_default_error_options;
} else {
@ -662,7 +662,7 @@ class PEAR
}
$stack[] = array($def_mode, $def_options);
if (isset($this) && is_a($this, 'PEAR')) {
if (isset($this) && $this instanceof PEAR) {
$this->setErrorHandling($mode, $options);
} else {
PEAR::setErrorHandling($mode, $options);
@ -687,7 +687,7 @@ class PEAR
array_pop($stack);
list($mode, $options) = $stack[sizeof($stack) - 1];
array_pop($stack);
if (isset($this) && is_a($this, 'PEAR')) {
if (isset($this) && $this instanceof PEAR) {
$this->setErrorHandling($mode, $options);
} else {
PEAR::setErrorHandling($mode, $options);