Skip to content
This repository
branch: staging
Fetching contributors…

Cannot retrieve contributors at this time

file 85 lines (78 sloc) 2.061 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85
<?php
/**
* @package Joomla.Platform
* @subpackage Database
*
* @copyright Copyright (C) 2005 - 2013 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE
*/

defined('JPATH_PLATFORM') or die;

/**
* Database connector class.
*
* @package Joomla.Platform
* @subpackage Database
* @since 11.1
* @deprecated 13.3
*/
abstract class JDatabase
{
/**
* Gets the error message from the database connection.
*
* @param boolean $escaped True to escape the message string for use in JavaScript.
*
* @return string The error message for the most recent query.
*
* @deprecated 13.3
* @since 11.1
*/
public function getErrorMsg($escaped = false)
{
JLog::add('JDatabase::getErrorMsg() is deprecated, use exception handling instead.', JLog::WARNING, 'deprecated');

if ($escaped)
{
return addslashes($this->errorMsg);
}
else
{
return $this->errorMsg;
}
}

/**
* Gets the error number from the database connection.
*
* @return integer The error number for the most recent query.
*
* @since 11.1
* @deprecated 13.3
*/
public function getErrorNum()
{
JLog::add('JDatabase::getErrorNum() is deprecated, use exception handling instead.', JLog::WARNING, 'deprecated');

return $this->errorNum;
}

/**
* Return the most recent error message for the database connector.
*
* @param boolean $showSQL True to display the SQL statement sent to the database as well as the error.
*
* @return string The error message for the most recent query.
*
* @since 11.1
* @deprecated 13.3
*/
public function stderr($showSQL = false)
{
JLog::add('JDatabase::stderr() is deprecated.', JLog::WARNING, 'deprecated');

if ($this->errorNum != 0)
{
return JText::sprintf('JLIB_DATABASE_ERROR_FUNCTION_FAILED', $this->errorNum, $this->errorMsg)
. ($showSQL ? "<br />SQL = <pre>$this->sql</pre>" : '');
}
else
{
return JText::_('JLIB_DATABASE_FUNCTION_NOERROR');
}
}
}
Something went wrong with that request. Please try again.