Update to CodeIgniter 3.19
This commit is contained in:
@@ -6,7 +6,7 @@
|
||||
*
|
||||
* This content is released under the MIT License (MIT)
|
||||
*
|
||||
* Copyright (c) 2014 - 2016, British Columbia Institute of Technology
|
||||
* Copyright (c) 2014 - 2018, British Columbia Institute of Technology
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
@@ -29,7 +29,7 @@
|
||||
* @package CodeIgniter
|
||||
* @author EllisLab Dev Team
|
||||
* @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/)
|
||||
* @copyright Copyright (c) 2014 - 2016, British Columbia Institute of Technology (http://bcit.ca/)
|
||||
* @copyright Copyright (c) 2014 - 2018, British Columbia Institute of Technology (http://bcit.ca/)
|
||||
* @license http://opensource.org/licenses/MIT MIT License
|
||||
* @link https://codeigniter.com
|
||||
* @since Version 1.3.0
|
||||
@@ -130,9 +130,9 @@ class CI_DB_postgre_driver extends CI_DB {
|
||||
*/
|
||||
foreach (array('connect_timeout', 'options', 'sslmode', 'service') as $key)
|
||||
{
|
||||
if (isset($this->$key) && is_string($this->key) && $this->key !== '')
|
||||
if (isset($this->$key) && is_string($this->$key) && $this->$key !== '')
|
||||
{
|
||||
$this->dsn .= $key."='".$this->key."' ";
|
||||
$this->dsn .= $key."='".$this->$key."' ";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -224,8 +224,8 @@ class CI_DB_postgre_driver extends CI_DB {
|
||||
* and so we'll have to fall back to running a query in
|
||||
* order to get it.
|
||||
*/
|
||||
return isset($pg_version['server'])
|
||||
? $this->data_cache['version'] = $pg_version['server']
|
||||
return (isset($pg_version['server']) && preg_match('#^(\d+\.\d+)#', $pg_version['server'], $match))
|
||||
? $this->data_cache['version'] = $match[1]
|
||||
: parent::version();
|
||||
}
|
||||
|
||||
@@ -288,7 +288,7 @@ class CI_DB_postgre_driver extends CI_DB {
|
||||
*/
|
||||
public function is_write_type($sql)
|
||||
{
|
||||
if (preg_match('#^(INSERT|UPDATE).*RETURNING\s.+(\,\s?.+)*$#i', $sql))
|
||||
if (preg_match('#^(INSERT|UPDATE).*RETURNING\s.+(\,\s?.+)*$#is', $sql))
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
@@ -299,7 +299,7 @@ class CI_DB_postgre_driver extends CI_DB {
|
||||
// --------------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* Platform-dependant string escape
|
||||
* Platform-dependent string escape
|
||||
*
|
||||
* @param string
|
||||
* @return string
|
||||
@@ -354,8 +354,7 @@ class CI_DB_postgre_driver extends CI_DB {
|
||||
*/
|
||||
public function insert_id()
|
||||
{
|
||||
$v = pg_version($this->conn_id);
|
||||
$v = isset($v['server']) ? $v['server'] : 0; // 'server' key is only available since PosgreSQL 7.4
|
||||
$v = $this->version();
|
||||
|
||||
$table = (func_num_args() > 0) ? func_get_arg(0) : NULL;
|
||||
$column = (func_num_args() > 1) ? func_get_arg(1) : NULL;
|
||||
@@ -471,7 +470,7 @@ class CI_DB_postgre_driver extends CI_DB {
|
||||
* Error
|
||||
*
|
||||
* Returns an array containing code and message of the last
|
||||
* database error that has occured.
|
||||
* database error that has occurred.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
@@ -550,13 +549,13 @@ class CI_DB_postgre_driver extends CI_DB {
|
||||
$ids = array();
|
||||
foreach ($values as $key => $val)
|
||||
{
|
||||
$ids[] = $val[$index];
|
||||
$ids[] = $val[$index]['value'];
|
||||
|
||||
foreach (array_keys($val) as $field)
|
||||
{
|
||||
if ($field !== $index)
|
||||
{
|
||||
$final[$field][] = 'WHEN '.$val[$index].' THEN '.$val[$field];
|
||||
$final[$val[$field]['field']][] = 'WHEN '.$val[$index]['value'].' THEN '.$val[$field]['value'];
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -564,12 +563,12 @@ class CI_DB_postgre_driver extends CI_DB {
|
||||
$cases = '';
|
||||
foreach ($final as $k => $v)
|
||||
{
|
||||
$cases .= $k.' = (CASE '.$index."\n"
|
||||
$cases .= $k.' = (CASE '.$val[$index]['field']."\n"
|
||||
.implode("\n", $v)."\n"
|
||||
.'ELSE '.$k.' END), ';
|
||||
}
|
||||
|
||||
$this->where($index.' IN('.implode(',', $ids).')', NULL, FALSE);
|
||||
$this->where($val[$index]['field'].' IN('.implode(',', $ids).')', NULL, FALSE);
|
||||
|
||||
return 'UPDATE '.$table.' SET '.substr($cases, 0, -2).$this->_compile_wh('qb_where');
|
||||
}
|
||||
|
@@ -6,7 +6,7 @@
|
||||
*
|
||||
* This content is released under the MIT License (MIT)
|
||||
*
|
||||
* Copyright (c) 2014 - 2016, British Columbia Institute of Technology
|
||||
* Copyright (c) 2014 - 2018, British Columbia Institute of Technology
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
@@ -29,7 +29,7 @@
|
||||
* @package CodeIgniter
|
||||
* @author EllisLab Dev Team
|
||||
* @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/)
|
||||
* @copyright Copyright (c) 2014 - 2016, British Columbia Institute of Technology (http://bcit.ca/)
|
||||
* @copyright Copyright (c) 2014 - 2018, British Columbia Institute of Technology (http://bcit.ca/)
|
||||
* @license http://opensource.org/licenses/MIT MIT License
|
||||
* @link https://codeigniter.com
|
||||
* @since Version 1.3.0
|
||||
@@ -163,7 +163,7 @@ class CI_DB_postgre_forge extends CI_DB_forge {
|
||||
*/
|
||||
protected function _attr_type(&$attributes)
|
||||
{
|
||||
// Reset field lenghts for data types that don't support it
|
||||
// Reset field lengths for data types that don't support it
|
||||
if (isset($attributes['CONSTRAINT']) && stripos($attributes['TYPE'], 'int') !== FALSE)
|
||||
{
|
||||
$attributes['CONSTRAINT'] = NULL;
|
||||
|
@@ -6,7 +6,7 @@
|
||||
*
|
||||
* This content is released under the MIT License (MIT)
|
||||
*
|
||||
* Copyright (c) 2014 - 2016, British Columbia Institute of Technology
|
||||
* Copyright (c) 2014 - 2018, British Columbia Institute of Technology
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
@@ -29,7 +29,7 @@
|
||||
* @package CodeIgniter
|
||||
* @author EllisLab Dev Team
|
||||
* @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/)
|
||||
* @copyright Copyright (c) 2014 - 2016, British Columbia Institute of Technology (http://bcit.ca/)
|
||||
* @copyright Copyright (c) 2014 - 2018, British Columbia Institute of Technology (http://bcit.ca/)
|
||||
* @license http://opensource.org/licenses/MIT MIT License
|
||||
* @link https://codeigniter.com
|
||||
* @since Version 1.3.0
|
||||
|
@@ -6,7 +6,7 @@
|
||||
*
|
||||
* This content is released under the MIT License (MIT)
|
||||
*
|
||||
* Copyright (c) 2014 - 2016, British Columbia Institute of Technology
|
||||
* Copyright (c) 2014 - 2018, British Columbia Institute of Technology
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
@@ -29,7 +29,7 @@
|
||||
* @package CodeIgniter
|
||||
* @author EllisLab Dev Team
|
||||
* @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/)
|
||||
* @copyright Copyright (c) 2014 - 2016, British Columbia Institute of Technology (http://bcit.ca/)
|
||||
* @copyright Copyright (c) 2014 - 2018, British Columbia Institute of Technology (http://bcit.ca/)
|
||||
* @license http://opensource.org/licenses/MIT MIT License
|
||||
* @link https://codeigniter.com
|
||||
* @since Version 1.3.0
|
||||
|
Reference in New Issue
Block a user