Created
February 4, 2017 01:05
-
-
Save 3D-I/eb0f2b07c00e87963c36680d54ee8bf8 to your computer and use it in GitHub Desktop.
phpbb/db/tools service replacement- phpBB 3.1
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* Your extension namespace here */ | |
namespace my_vendor\my_awesome_extension_name; | |
/* Your filename (w/extension) for this class here */ | |
class db_tools_service_replacement extends \phpbb\db\tools | |
{ | |
public function __construct(\phpbb\db\driver\driver_interface $db, $return_statements = false) | |
{ | |
parent::__construct($db); | |
/* Your DB Tools DBAL's additional replacements */ | |
$float_type = array( | |
'mysql_41' => 'float(10, 5)', | |
'mysql_40' => 'float(10, 5)', | |
'mssql' => '[float]', | |
'mssqlnative' => '[float]', | |
'oracle' => 'number(10, 5)', | |
'sqlite' => 'float(10, 5)', | |
'sqlite3' => 'float(10, 5)', | |
'postgres' => 'float(10, 5)', | |
); | |
foreach ($float_type as $sql_layer => $type) | |
{ | |
/* The name of the DB Tools addition here */ | |
$this->dbms_type_map[$sql_layer]['FLOAT'] = $type; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment