Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
phpbb/db/tools service replacement- phpBB 3.1
<?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
You can’t perform that action at this time.