Skip to content

Commit ae21d51

Browse files
committed
Rename DB to Database
1 parent 7d642a5 commit ae21d51

33 files changed

+46
-45
lines changed

extern.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@
5757

5858
namespace FeatherBB;
5959
use FeatherBB\Core\Cache;
60-
use FeatherBB\Core\DB;
60+
use FeatherBB\Core\Database as DB;
6161
use FeatherBB\Core\Url;
6262
use FeatherBB\Core\Utils;
6363

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -38,16 +38,17 @@
3838
*/
3939

4040
namespace FeatherBB\Core;
41+
4142
use ArrayAccess;
4243
use ArrayIterator;
4344
use Countable;
45+
use InvalidArgumentException;
4446
use IteratorAggregate;
4547
use PDO;
4648
use Serializable;
4749

48-
{
49-
50-
class DB implements ArrayAccess
50+
{
51+
class Database implements ArrayAccess
5152
{
5253
// ----------------------- //
5354
// --- CLASS CONSTANTS --- //
@@ -240,7 +241,7 @@ public static function reset_config()
240241
* Despite its slightly odd name, this is actually the factory
241242
* method used to acquire instances of the class. It is named
242243
* this way for the sake of a readable interface, ie
243-
* DB::for_table('table_name')->find_one()-> etc. As such,
244+
* self::for_table('table_name')->find_one()-> etc. As such,
244245
* this will normally be the first method called in a chain.
245246
* @param string $table_name
246247
* @param string $connection_name Which connection to use
@@ -318,7 +319,7 @@ public static function reset_db()
318319
/**
319320
* Detect and initialise the character used to quote identifiers
320321
* (table names, column names etc). If this has been specified
321-
* manually using DB::configure('identifier_quote_character', 'some-char'),
322+
* manually using self::configure('identifier_quote_character', 'some-char'),
322323
* this will do nothing.
323324
* @param string $connection_name Which connection to use
324325
*/
@@ -333,7 +334,7 @@ protected static function _setup_identifier_quote_character($connection_name)
333334
/**
334335
* Detect and initialise the limit clause style ("SELECT TOP 5" /
335336
* "... LIMIT 5"). If this has been specified manually using
336-
* DB::configure('limit_clause_style', 'top'), this will do nothing.
337+
* self::configure('limit_clause_style', 'top'), this will do nothing.
337338
* @param string $connection_name Which connection to use
338339
*/
339340
public static function _setup_limit_clause_style($connection_name)
@@ -381,9 +382,9 @@ protected static function _detect_limit_clause_style($connection_name)
381382
case 'sqlsrv':
382383
case 'dblib':
383384
case 'mssql':
384-
return DB::LIMIT_STYLE_TOP_N;
385+
return self::LIMIT_STYLE_TOP_N;
385386
default:
386-
return DB::LIMIT_STYLE_LIMIT;
387+
return self::LIMIT_STYLE_LIMIT;
387388
}
388389
}
389390

@@ -579,7 +580,7 @@ public static function get_connection_names()
579580

580581
/**
581582
* "Private" constructor; shouldn't be called directly.
582-
* Use the DB::for_table factory method instead.
583+
* Use the self::for_table factory method instead.
583584
*/
584585
protected function __construct($table_name, $data = array(), $connection_name = self::DEFAULT_CONNECTION)
585586
{
@@ -1800,7 +1801,7 @@ protected function _build_select_start()
18001801
$result_columns = join(', ', $this->_result_columns);
18011802

18021803
if (!is_null($this->_limit) &&
1803-
self::$_config[$this->_connection_name]['limit_clause_style'] === DB::LIMIT_STYLE_TOP_N
1804+
self::$_config[$this->_connection_name]['limit_clause_style'] === self::LIMIT_STYLE_TOP_N
18041805
) {
18051806
$fragment .= "TOP {$this->_limit} ";
18061807
}
@@ -1896,7 +1897,7 @@ protected function _build_limit()
18961897
{
18971898
$fragment = '';
18981899
if (!is_null($this->_limit) &&
1899-
self::$_config[$this->_connection_name]['limit_clause_style'] == DB::LIMIT_STYLE_LIMIT
1900+
self::$_config[$this->_connection_name]['limit_clause_style'] == self::LIMIT_STYLE_LIMIT
19001901
) {
19011902
if (self::get_db($this->_connection_name)->getAttribute(PDO::ATTR_DRIVER_NAME) == 'firebird') {
19021903
$fragment = 'ROWS';
@@ -2498,7 +2499,7 @@ public static function __callStatic($name, $arguments)
24982499
{
24992500
$method = strtolower(preg_replace('/([a-z])([A-Z])/', '$1_$2', $name));
25002501

2501-
return call_user_func_array(array('DB', $method), $arguments);
2502+
return call_user_func_array(array('Database', $method), $arguments);
25022503
}
25032504
}
25042505

@@ -2744,7 +2745,7 @@ public function unserialize($serialized)
27442745
* Call a method on all models in a result set. This allows for method
27452746
* chaining such as setting a property on all models in a result set or
27462747
* any other batch operation across models.
2747-
* @example DB::for_table('Widget')->find_many()->set('field', 'value')->save();
2748+
* @example self::for_table('Widget')->find_many()->set('field', 'value')->save();
27482749
* @param string $method
27492750
* @param array $params
27502751
* @return \IdiormResultSet

featherbb/Core/Preferences.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
namespace FeatherBB\Core;
1111
use FeatherBB\Core\Error;
12-
use FeatherBB\Core\DB;
12+
use FeatherBB\Core\Database as DB;
1313

1414
class Preferences
1515
{

featherbb/Middleware/Auth.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414
namespace FeatherBB\Middleware;
1515

16-
use FeatherBB\Core\DB;
16+
use FeatherBB\Core\Database as DB;
1717
use FeatherBB\Core\Error;
1818
use FeatherBB\Core\Random;
1919
use FeatherBB\Core\Track;

featherbb/Middleware/Core.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
namespace FeatherBB\Middleware;
1515

1616
use FeatherBB\Controller\Install;
17-
use FeatherBB\Core\DB;
17+
use FeatherBB\Core\Database as DB;
1818
use FeatherBB\Core\Email;
1919
use FeatherBB\Core\Hooks;
2020
use FeatherBB\Core\Parser;

featherbb/Model/Admin/Bans.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
namespace FeatherBB\Model\Admin;
1111

12-
use FeatherBB\Core\DB;
12+
use FeatherBB\Core\Database as DB;
1313
use FeatherBB\Core\Error;
1414
use FeatherBB\Core\Url;
1515
use FeatherBB\Core\Utils;

featherbb/Model/Admin/Categories.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
namespace FeatherBB\Model\Admin;
1111

12-
use FeatherBB\Core\DB;
12+
use FeatherBB\Core\Database as DB;
1313

1414
class Categories
1515
{

featherbb/Model/Admin/Censoring.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
namespace FeatherBB\Model\Admin;
1111

12-
use FeatherBB\Core\DB;
12+
use FeatherBB\Core\Database as DB;
1313
use FeatherBB\Core\Error;
1414
use FeatherBB\Core\Url;
1515
use FeatherBB\Core\Utils;

featherbb/Model/Admin/Forums.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
namespace FeatherBB\Model\Admin;
1111

12-
use FeatherBB\Core\DB;
12+
use FeatherBB\Core\Database as DB;
1313

1414
class Forums
1515
{

featherbb/Model/Admin/Groups.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
namespace FeatherBB\Model\Admin;
1111

12-
use FeatherBB\Core\DB;
12+
use FeatherBB\Core\Database as DB;
1313
use FeatherBB\Core\Error;
1414
use FeatherBB\Core\Url;
1515
use FeatherBB\Core\Utils;

0 commit comments

Comments
 (0)