Skip to content
This repository has been archived by the owner on Nov 26, 2017. It is now read-only.

Commit

Permalink
Make JDatabaseQuery subclasses autoloadable.
Browse files Browse the repository at this point in the history
  • Loading branch information
realityking committed Feb 13, 2012
1 parent 3ba4919 commit 7aa7a56
Show file tree
Hide file tree
Showing 12 changed files with 20 additions and 23 deletions.
7 changes: 7 additions & 0 deletions libraries/import.php
Expand Up @@ -55,3 +55,10 @@ class_exists('JLoader') or die;
// Register classes that don't follow one file per class naming conventions.
JLoader::register('JText', JPATH_PLATFORM . '/joomla/methods.php');
JLoader::register('JRoute', JPATH_PLATFORM . '/joomla/methods.php');

// Register classes where the names have been changed to fit the autoloader rules
// @deprecated 12.3
JLoader::register('JDatabaseQueryMySQL', JPATH_PLATFORM . '/database/query/mysql.php');
JLoader::register('JDatabaseQueryMySQLi', JPATH_PLATFORM . '/database/query/mysqli.php');
JLoader::register('JDatabaseQuerySQLAzure', JPATH_PLATFORM . '/database/query/sqlazure.php');
JLoader::register('JDatabaseQuerySQLSrv', JPATH_PLATFORM . '/database/query/sqlsrv.php');
5 changes: 2 additions & 3 deletions libraries/joomla/database/database/mysql.php
Expand Up @@ -9,7 +9,6 @@

defined('JPATH_PLATFORM') or die;

JLoader::register('JDatabaseQueryMySQL', __DIR__ . '/mysqlquery.php');
JLoader::register('JDatabaseExporterMySQL', __DIR__ . '/mysqlexporter.php');
JLoader::register('JDatabaseImporterMySQL', __DIR__ . '/mysqlimporter.php');

Expand Down Expand Up @@ -308,11 +307,11 @@ public function getQuery($new = false)
if ($new)
{
// Make sure we have a query class for this driver.
if (!class_exists('JDatabaseQueryMySQL'))
if (!class_exists('JDatabaseQueryMysql'))
{
throw new JDatabaseException(JText::_('JLIB_DATABASE_ERROR_MISSING_QUERY'));
}
return new JDatabaseQueryMySQL($this);
return new JDatabaseQueryMysql($this);
}
else
{
Expand Down
5 changes: 2 additions & 3 deletions libraries/joomla/database/database/mysqli.php
Expand Up @@ -10,7 +10,6 @@
defined('JPATH_PLATFORM') or die;

JLoader::register('JDatabaseMySQL', __DIR__ . '/mysql.php');
JLoader::register('JDatabaseQueryMySQLi', __DIR__ . '/mysqliquery.php');
JLoader::register('JDatabaseExporterMySQLi', __DIR__ . '/mysqliexporter.php');
JLoader::register('JDatabaseImporterMySQLi', __DIR__ . '/mysqliimporter.php');

Expand Down Expand Up @@ -278,11 +277,11 @@ public function getQuery($new = false)
if ($new)
{
// Make sure we have a query class for this driver.
if (!class_exists('JDatabaseQueryMySQLi'))
if (!class_exists('JDatabaseQueryMysqli'))
{
throw new JDatabaseException(JText::_('JLIB_DATABASE_ERROR_MISSING_QUERY'));
}
return new JDatabaseQueryMySQLi($this);
return new JDatabaseQueryMysqli($this);
}
else
{
Expand Down
6 changes: 2 additions & 4 deletions libraries/joomla/database/database/sqlazure.php
Expand Up @@ -11,8 +11,6 @@

JLoader::register('JDatabaseSQLSrv', __DIR__ . '/sqlsrv.php');

JLoader::register('JDatabaseQuerySQLAzure', __DIR__ . '/sqlazurequery.php');

/**
* SQL Server database driver
*
Expand Down Expand Up @@ -46,12 +44,12 @@ public function getQuery($new = false)
if ($new)
{
// Make sure we have a query class for this driver.
if (!class_exists('JDatabaseQuerySQLAzure'))
if (!class_exists('JDatabaseQuerySqlazure'))
{
throw new DatabaseException(JText::_('JLIB_DATABASE_ERROR_MISSING_QUERY'));
}

return new JDatabaseQuerySQLAzure($this);
return new JDatabaseQuerySqlazure($this);
}
else
{
Expand Down
2 changes: 0 additions & 2 deletions libraries/joomla/database/database/sqlsrv.php
Expand Up @@ -9,8 +9,6 @@

defined('JPATH_PLATFORM') or die;

JLoader::register('JDatabaseQuerySQLSrv', __DIR__ . '/sqlsrvquery.php');

/**
* SQL Server database driver
*
Expand Down
Expand Up @@ -16,7 +16,7 @@
* @subpackage Database
* @since 11.1
*/
class JDatabaseQueryMySQL extends JDatabaseQuery
class JDatabaseQueryMysql extends JDatabaseQuery
{
/**
* Concatenates an array of column names or values.
Expand Down
Expand Up @@ -9,15 +9,13 @@

defined('JPATH_PLATFORM') or die;

require_once __DIR__ . '/mysqlquery.php';

/**
* Query Building Class.
*
* @package Joomla.Platform
* @subpackage Database
* @since 11.1
*/
class JDatabaseQueryMySQLi extends JDatabaseQueryMySQL
class JDatabaseQueryMysqli extends JDatabaseQueryMysql
{
}
Expand Up @@ -9,16 +9,14 @@

defined('JPATH_PLATFORM') or die;

JLoader::register('JDatabaseQuerySQLSrv', dirname(__FILE__) . '/sqlsrvquery.php');

/**
* Query Building Class.
*
* @package Joomla.Platform
* @subpackage Database
* @since 11.1
*/
class JDatabaseQuerySQLAzure extends JDatabaseQuerySQLSrv
class JDatabaseQuerySqlazure extends JDatabaseQuerySqlsrv
{
/**
* The character(s) used to quote SQL statement names such as table names or field names,
Expand Down
Expand Up @@ -16,7 +16,7 @@
* @subpackage Database
* @since 11.1
*/
class JDatabaseQuerySQLSrv extends JDatabaseQuery
class JDatabaseQuerySqlsrv extends JDatabaseQuery
{
/**
* The character(s) used to quote SQL statement names such as table names or field names,
Expand Down
2 changes: 1 addition & 1 deletion tests/suite/joomla/database/JDatabaseQueryTest.php
Expand Up @@ -7,7 +7,7 @@

require_once __DIR__.'/JDatabaseQueryInspector.php';

require_once JPATH_PLATFORM.'/joomla/database/database/mysqliquery.php';
require_once JPATH_PLATFORM.'/joomla/database/query/mysqli.php';

/**
* Test class for JDatabaseQuery.
Expand Down
Expand Up @@ -11,7 +11,7 @@
require_once JPATH_PLATFORM.'/joomla/database/database.php';
require_once JPATH_PLATFORM.'/joomla/database/database/mysql.php';
require_once JPATH_PLATFORM.'/joomla/database/query.php';
require_once JPATH_PLATFORM.'/joomla/database/database/mysqlquery.php';
require_once JPATH_PLATFORM.'/joomla/database/query/mysql.php';

/**
* Test class for JDatabaseMySQL.
Expand Down
Expand Up @@ -11,7 +11,7 @@
require_once JPATH_PLATFORM.'/joomla/database/database.php';
require_once JPATH_PLATFORM.'/joomla/database/database/mysqli.php';
require_once JPATH_PLATFORM.'/joomla/database/query.php';
require_once JPATH_PLATFORM.'/joomla/database/database/mysqliquery.php';
require_once JPATH_PLATFORM.'/joomla/database/query/mysqli.php';

/**
* Test class for JDatabaseMySQL.
Expand Down

0 comments on commit 7aa7a56

Please sign in to comment.