Permalink
Browse files

Fixing up all references to legacy JDatabase classes so that they work

natively with the new JDatabaseDriver classes.
  • Loading branch information...
1 parent 978f8a7 commit 17119eb955ba2163413d5e8daf34d3bdf167edd8 @LouisLandry LouisLandry committed Feb 20, 2012
Showing with 141 additions and 156 deletions.
  1. +2 −2 libraries/cms/table/content.php
  2. +2 −2 libraries/joomla/application/application.php
  3. +5 −5 libraries/joomla/application/component/model.php
  4. +7 −7 libraries/joomla/factory.php
  5. +4 −4 libraries/joomla/form/fields/databaseconnection.php
  6. +0 −1 libraries/joomla/form/rules/color.php
  7. +0 −1 libraries/joomla/form/rules/options.php
  8. +0 −1 libraries/joomla/form/rules/rules.php
  9. +0 −1 libraries/joomla/form/rules/tel.php
  10. +0 −1 libraries/joomla/form/rules/url.php
  11. +0 −1 libraries/joomla/form/rules/username.php
  12. +4 −4 libraries/joomla/installer/adapters/component.php
  13. +6 −6 libraries/joomla/installer/adapters/file.php
  14. +2 −2 libraries/joomla/installer/adapters/language.php
  15. +1 −1 libraries/joomla/installer/adapters/library.php
  16. +14 −14 libraries/joomla/installer/adapters/module.php
  17. +1 −1 libraries/joomla/installer/adapters/package.php
  18. +3 −3 libraries/joomla/installer/adapters/plugin.php
  19. +6 −15 libraries/joomla/installer/adapters/template.php
  20. +9 −9 libraries/joomla/installer/installer.php
  21. +3 −3 libraries/joomla/log/loggers/database.php
  22. +4 −4 libraries/joomla/session/storage/database.php
  23. +1 −1 libraries/joomla/table/asset.php
  24. +1 −1 libraries/joomla/table/category.php
  25. +3 −3 libraries/joomla/table/extension.php
  26. +1 −1 libraries/joomla/table/language.php
  27. +1 −1 libraries/joomla/table/menu.php
  28. +5 −5 libraries/joomla/table/menutype.php
  29. +1 −1 libraries/joomla/table/module.php
  30. +9 −9 libraries/joomla/table/nested.php
  31. +4 −4 libraries/joomla/table/session.php
  32. +23 −23 libraries/joomla/table/table.php
  33. +2 −2 libraries/joomla/table/update.php
  34. +8 −8 libraries/joomla/table/user.php
  35. +5 −5 libraries/joomla/table/usergroup.php
  36. +1 −1 libraries/joomla/table/viewlevel.php
  37. +1 −1 libraries/joomla/updater/adapters/collection.php
  38. +1 −1 libraries/joomla/updater/adapters/extension.php
  39. +1 −1 libraries/joomla/updater/updater.php
@@ -21,7 +21,7 @@ class JTableContent extends JTable
/**
* Constructor
*
- * @param JDatabase &$db A database connector object
+ * @param JDatabaseDriver &$db A database connector object
*
* @since 11.1
*/
@@ -338,7 +338,7 @@ public function publish($pks = null, $state = 1, $userId = 0)
$query->set($this->_db->quoteName('state') . ' = ' . (int) $state);
$query->where('(' . $where . ')' . $checkin);
$this->_db->setQuery($query);
- $this->_db->query();
+ $this->_db->execute();
// Check for a database error.
if ($this->_db->getErrorNum())
@@ -1009,7 +1009,7 @@ protected function _createSession($name)
->where($query->qn('time') . ' < ' . $query->q((int) ($time - $session->getExpire())));
$db->setQuery($query);
- $db->query();
+ $db->execute();
}
// Check to see the the session already exists.
@@ -1073,7 +1073,7 @@ public function checkSession()
}
// If the insert failed, exit the application.
- if (!$db->query())
+ if (!$db->execute())
{
jexit($db->getErrorMSG());
}
@@ -332,7 +332,7 @@ protected function _getList($query, $limitstart = 0, $limit = 0)
protected function _getListCount($query)
{
$this->_db->setQuery($query);
- $this->_db->query();
+ $this->_db->execute();
return $this->_db->getNumRows();
}
@@ -365,9 +365,9 @@ protected function _createTable($name, $prefix = 'Table', $config = array())
}
/**
- * Method to get the database connector object
+ * Method to get the database driver object
*
- * @return JDatabase JDatabase connector object
+ * @return JDatabaseDriver
*/
public function getDbo()
{
@@ -468,9 +468,9 @@ protected function populateState()
}
/**
- * Method to set the database connector object
+ * Method to set the database driver object
*
- * @param object &$db A JDatabase based object
+ * @param JDatabaseDriver &$db A JDatabaseDriver based object
*
* @return void
*
@@ -65,7 +65,7 @@
public static $acl = null;
/**
- * @var JDatabase
+ * @var JDatabaseDriver
* @since 11.1
*/
public static $database = null;
@@ -290,11 +290,11 @@ public static function getACL()
/**
* Get a database object.
*
- * Returns the global {@link JDatabase} object, only creating it if it doesn't already exist.
+ * Returns the global {@link JDatabaseDriver} object, only creating it if it doesn't already exist.
*
- * @return JDatabase object
+ * @return JDatabaseDriver
*
- * @see JDatabase
+ * @see JDatabaseDriver
* @since 11.1
*/
public static function getDbo()
@@ -588,9 +588,9 @@ protected static function createSession(array $options = array())
/**
* Create an database object
*
- * @return JDatabase object
+ * @return JDatabaseDriver
*
- * @see JDatabase
+ * @see JDatabaseDriver
* @since 11.1
*/
protected static function createDbo()
@@ -607,7 +607,7 @@ protected static function createDbo()
$options = array('driver' => $driver, 'host' => $host, 'user' => $user, 'password' => $password, 'database' => $database, 'prefix' => $prefix);
- $db = JDatabase::getInstance($options);
+ $db = JDatabaseDriver::getInstance($options);
if ($db instanceof Exception)
{
@@ -18,7 +18,7 @@
*
* @package Joomla.Platform
* @subpackage Form
- * @see JDatabase
+ * @see JDatabaseDriver
* @since 11.3
*/
class JFormFieldDatabaseConnection extends JFormFieldList
@@ -35,18 +35,18 @@ class JFormFieldDatabaseConnection extends JFormFieldList
* Method to get the list of database options.
*
* This method produces a drop down list of available databases supported
- * by JDatabase drivers that are also supported by the application.
+ * by JDatabaseDriver classes that are also supported by the application.
*
* @return array The field option objects.
*
* @since 11.3
- * @see JDatabase
+ * @see JDatabaseDriver
*/
protected function getOptions()
{
// Initialize variables.
// This gets the connectors available in the platform and supported by the server.
- $available = JDatabase::getConnectors();
+ $available = JDatabaseDriver::getConnectors();
/**
* This gets the list of database types supported by the application.
@@ -32,7 +32,6 @@ class JFormRuleColor extends JFormRule
* @return boolean True if the value is valid, false otherwise.
*
* @since 11.2
- * @throws JException on invalid rule.
*/
public function test(&$element, $value, $group = null, &$input = null, &$form = null)
{
@@ -32,7 +32,6 @@ class JFormRuleOptions extends JFormRule
* @return boolean True if the value is valid, false otherwise.
*
* @since 11.1
- * @throws JException on invalid rule.
*/
public function test(&$element, $value, $group = null, &$input = null, &$form = null)
{
@@ -32,7 +32,6 @@ class JFormRuleRules extends JFormRule
* @return boolean True if the value is valid, false otherwise.
*
* @since 11.1
- * @throws JException on invalid rule.
*/
public function test(&$element, $value, $group = null, &$input = null, &$form = null)
{
@@ -32,7 +32,6 @@ class JFormRuleTel extends JFormRule
* @return boolean True if the value is valid, false otherwise.
*
* @since 11.1
- * @throws JException on invalid rule.
*/
public function test(&$element, $value, $group = null, &$input = null, &$form = null)
{
@@ -32,7 +32,6 @@ class JFormRuleUrl extends JFormRule
* @return boolean True if the value is valid, false otherwise.
*
* @since 11.1
- * @throws JException on invalid rule.
* @link http://www.w3.org/Addressing/URL/url-spec.txt
* @see Jstring
*/
@@ -32,7 +32,6 @@ class JFormRuleUsername extends JFormRule
* @return boolean True if the value is valid, false otherwise.
*
* @since 11.1
- * @throws JException on invalid rule.
*/
public function test(&$element, $value, $group = null, &$input = null, &$form = null)
{
@@ -1127,7 +1127,7 @@ public function uninstall($id)
$query = $db->getQuery(true);
$query->delete()->from('#__schemas')->where('extension_id = ' . $id);
$db->setQuery($query);
- $db->query();
+ $db->execute();
// Remove the component container in the assets table.
$asset = JTable::getInstance('Asset');
@@ -1141,7 +1141,7 @@ public function uninstall($id)
$query->delete()->from('#__categories')->where('extension=' . $db->quote($element), 'OR')
->where('extension LIKE ' . $db->quote($element . '.%'));
$db->setQuery($query);
- $db->query();
+ $db->execute();
// Check for errors.
if ($db->getErrorNum())
@@ -1558,7 +1558,7 @@ public function discover_install()
{
$this->parent->extension->store();
}
- catch (JException $e)
+ catch (RuntimeException $e)
{
JError::raiseWarning(101, JText::_('JLIB_INSTALLER_ERROR_COMP_DISCOVER_STORE_DETAILS'));
return false;
@@ -1814,7 +1814,7 @@ public function refreshManifestCache()
{
return $this->parent->extension->store();
}
- catch (JException $e)
+ catch (RuntimeException $e)
{
JError::raiseWarning(101, JText::_('JLIB_INSTALLER_ERROR_COMP_REFRESH_MANIFEST_CACHE'));
return false;
@@ -206,9 +206,9 @@ public function install()
$db->setQuery($query);
try
{
- $db->Query();
+ $db->execute();
}
- catch (JException $e)
+ catch (RuntimeException $e)
{
// Install failed, roll back changes
$this->parent->abort(
@@ -507,7 +507,7 @@ public function uninstall($id)
->from('#__schemas')
->where('extension_id = ' . $row->extension_id);
$db->setQuery($query);
- $db->Query();
+ $db->execute();
// Set root folder names
$packagePath = $this->parent->getPath('source');
@@ -603,9 +603,9 @@ protected function extensionExistsInSystem($extension = null)
try
{
- $db->Query();
+ $db->execute();
}
- catch (JException $e)
+ catch (RuntimeException $e)
{
// Install failed, roll back changes
$this->parent->abort(JText::sprintf('JLIB_INSTALLER_ABORT_FILE_ROLLBACK', $db->stderr(true)));
@@ -741,7 +741,7 @@ public function refreshManifestCache()
{
return $this->parent->extension->store();
}
- catch (JException $e)
+ catch (RuntimeException $e)
{
JError::raiseWarning(101, JText::_('JLIB_INSTALLER_ERROR_PACK_REFRESH_MANIFEST_CACHE'));
return false;
@@ -537,7 +537,7 @@ public function uninstall($eid)
$query->set('params=' . $db->quote($registry));
$query->where('id=' . (int) $user->id);
$db->setQuery($query);
- $db->query();
+ $db->execute();
$count++;
}
}
@@ -625,7 +625,7 @@ public function discover_install()
{
$this->parent->extension->store();
}
- catch (JException $e)
+ catch (RuntimeException $e)
{
JError::raiseWarning(101, JText::_('JLIB_INSTALLER_ERROR_LANG_DISCOVER_STORE_DETAILS'));
return false;
@@ -417,7 +417,7 @@ public function refreshManifestCache()
{
return $this->parent->extension->store();
}
- catch (JException $e)
+ catch (RuntimeException $e)
{
JError::raiseWarning(101, JText::_('JLIB_INSTALLER_ERROR_LIB_REFRESH_MANIFEST_CACHE'));
return false;
@@ -218,9 +218,9 @@ public function install()
try
{
- $db->Query();
+ $db->execute();
}
- catch (JException $e)
+ catch (RuntimeException $e)
{
// Install failed, roll back changes
$this->parent
@@ -825,7 +825,7 @@ public function uninstall($id)
$query = $db->getQuery(true);
$query->delete()->from('#__schemas')->where('extension_id = ' . $row->extension_id);
$db->setQuery($query);
- $db->Query();
+ $db->execute();
// Remove other files
$this->parent->removeFiles($this->manifest->media);
@@ -842,7 +842,7 @@ public function uninstall($id)
{
$modules = $db->loadColumn();
}
- catch (JException $e)
+ catch (RuntimeException $e)
{
$modules = array();
}
@@ -859,9 +859,9 @@ public function uninstall($id)
$db->setQuery($query);
try
{
- $db->query();
+ $db->execute();
}
- catch (JException $e)
+ catch (RuntimeException $e)
{
JError::raiseWarning(100, JText::sprintf('JLIB_INSTALLER_ERROR_MOD_UNINSTALL_EXCEPTION', $db->stderr(true)));
$retval = false;
@@ -873,9 +873,9 @@ public function uninstall($id)
try
{
- $db->query();
+ $db->execute();
}
- catch (JException $e)
+ catch (RuntimeException $e)
{
JError::raiseWarning(100, JText::sprintf('JLIB_INSTALLER_ERROR_MOD_UNINSTALL_EXCEPTION', $db->stderr(true)));
$retval = false;
@@ -890,9 +890,9 @@ public function uninstall($id)
try
{
// Clean up any other ones that might exist as well
- $db->Query();
+ $db->execute();
}
- catch (JException $e)
+ catch (RuntimeException $e)
{
// Ignore the error...
}
@@ -930,9 +930,9 @@ protected function _rollback_menu($arg)
try
{
- return $db->query();
+ return $db->execute();
}
- catch (JException $e)
+ catch (RuntimeException $e)
{
return false;
}
@@ -958,9 +958,9 @@ protected function _rollback_module($arg)
$db->setQuery($query);
try
{
- return $db->query();
+ return $db->execute();
}
- catch (JException $e)
+ catch (RuntimeException $e)
{
return false;
}
@@ -561,7 +561,7 @@ public function refreshManifestCache()
{
return $this->parent->extension->store();
}
- catch (JException $e)
+ catch (RuntimeException $e)
{
JError::raiseWarning(101, JText::_('JLIB_INSTALLER_ERROR_PACK_REFRESH_MANIFEST_CACHE'));
return false;
Oops, something went wrong.

0 comments on commit 17119eb

Please sign in to comment.