Upgrade CodeIgniter 3.1.9 => 3.1.11
This commit is contained in:
@@ -6,7 +6,7 @@
|
||||
*
|
||||
* This content is released under the MIT License (MIT)
|
||||
*
|
||||
* Copyright (c) 2014 - 2018, British Columbia Institute of Technology
|
||||
* Copyright (c) 2014 - 2019, 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,8 +29,8 @@
|
||||
* @package CodeIgniter
|
||||
* @author EllisLab Dev Team
|
||||
* @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/)
|
||||
* @copyright Copyright (c) 2014 - 2018, British Columbia Institute of Technology (http://bcit.ca/)
|
||||
* @license http://opensource.org/licenses/MIT MIT License
|
||||
* @copyright Copyright (c) 2014 - 2019, British Columbia Institute of Technology (https://bcit.ca/)
|
||||
* @license https://opensource.org/licenses/MIT MIT License
|
||||
* @link https://codeigniter.com
|
||||
* @since Version 2.0.0
|
||||
* @filesource
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
*
|
||||
* This content is released under the MIT License (MIT)
|
||||
*
|
||||
* Copyright (c) 2014 - 2018, British Columbia Institute of Technology
|
||||
* Copyright (c) 2014 - 2019, 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,8 +29,8 @@
|
||||
* @package CodeIgniter
|
||||
* @author EllisLab Dev Team
|
||||
* @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/)
|
||||
* @copyright Copyright (c) 2014 - 2018, British Columbia Institute of Technology (http://bcit.ca/)
|
||||
* @license http://opensource.org/licenses/MIT MIT License
|
||||
* @copyright Copyright (c) 2014 - 2019, British Columbia Institute of Technology (https://bcit.ca/)
|
||||
* @license https://opensource.org/licenses/MIT MIT License
|
||||
* @link https://codeigniter.com
|
||||
* @since Version 2.0.0
|
||||
* @filesource
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
*
|
||||
* This content is released under the MIT License (MIT)
|
||||
*
|
||||
* Copyright (c) 2014 - 2018, British Columbia Institute of Technology
|
||||
* Copyright (c) 2014 - 2019, 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,8 +29,8 @@
|
||||
* @package CodeIgniter
|
||||
* @author EllisLab Dev Team
|
||||
* @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/)
|
||||
* @copyright Copyright (c) 2014 - 2018, British Columbia Institute of Technology (http://bcit.ca/)
|
||||
* @license http://opensource.org/licenses/MIT MIT License
|
||||
* @copyright Copyright (c) 2014 - 2019, British Columbia Institute of Technology (https://bcit.ca/)
|
||||
* @license https://opensource.org/licenses/MIT MIT License
|
||||
* @link https://codeigniter.com
|
||||
* @since Version 2.0
|
||||
* @filesource
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
*
|
||||
* This content is released under the MIT License (MIT)
|
||||
*
|
||||
* Copyright (c) 2014 - 2018, British Columbia Institute of Technology
|
||||
* Copyright (c) 2014 - 2019, 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,8 +29,8 @@
|
||||
* @package CodeIgniter
|
||||
* @author EllisLab Dev Team
|
||||
* @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/)
|
||||
* @copyright Copyright (c) 2014 - 2018, British Columbia Institute of Technology (http://bcit.ca/)
|
||||
* @license http://opensource.org/licenses/MIT MIT License
|
||||
* @copyright Copyright (c) 2014 - 2019, British Columbia Institute of Technology (https://bcit.ca/)
|
||||
* @license https://opensource.org/licenses/MIT MIT License
|
||||
* @link https://codeigniter.com
|
||||
* @since Version 2.0
|
||||
* @filesource
|
||||
@@ -276,7 +276,7 @@ class CI_Cache_file extends CI_Driver {
|
||||
|
||||
if ($data['ttl'] > 0 && time() > $data['time'] + $data['ttl'])
|
||||
{
|
||||
unlink($this->_cache_path.$id);
|
||||
file_exists($this->_cache_path.$id) && unlink($this->_cache_path.$id);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
*
|
||||
* This content is released under the MIT License (MIT)
|
||||
*
|
||||
* Copyright (c) 2014 - 2018, British Columbia Institute of Technology
|
||||
* Copyright (c) 2014 - 2019, 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,8 +29,8 @@
|
||||
* @package CodeIgniter
|
||||
* @author EllisLab Dev Team
|
||||
* @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/)
|
||||
* @copyright Copyright (c) 2014 - 2018, British Columbia Institute of Technology (http://bcit.ca/)
|
||||
* @license http://opensource.org/licenses/MIT MIT License
|
||||
* @copyright Copyright (c) 2014 - 2019, British Columbia Institute of Technology (https://bcit.ca/)
|
||||
* @license https://opensource.org/licenses/MIT MIT License
|
||||
* @link https://codeigniter.com
|
||||
* @since Version 2.0
|
||||
* @filesource
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
*
|
||||
* This content is released under the MIT License (MIT)
|
||||
*
|
||||
* Copyright (c) 2014 - 2018, British Columbia Institute of Technology
|
||||
* Copyright (c) 2014 - 2019, 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,8 +29,8 @@
|
||||
* @package CodeIgniter
|
||||
* @author EllisLab Dev Team
|
||||
* @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/)
|
||||
* @copyright Copyright (c) 2014 - 2018, British Columbia Institute of Technology (http://bcit.ca/)
|
||||
* @license http://opensource.org/licenses/MIT MIT License
|
||||
* @copyright Copyright (c) 2014 - 2019, British Columbia Institute of Technology (https://bcit.ca/)
|
||||
* @license https://opensource.org/licenses/MIT MIT License
|
||||
* @link https://codeigniter.com
|
||||
* @since Version 3.0.0
|
||||
* @filesource
|
||||
@@ -76,6 +76,13 @@ class CI_Cache_redis extends CI_Driver
|
||||
*/
|
||||
protected $_serialized = array();
|
||||
|
||||
/**
|
||||
* del()/delete() method name depending on phpRedis version
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected static $_delete_name;
|
||||
|
||||
// ------------------------------------------------------------------------
|
||||
|
||||
/**
|
||||
@@ -97,6 +104,10 @@ class CI_Cache_redis extends CI_Driver
|
||||
return;
|
||||
}
|
||||
|
||||
isset(static::$_delete_name) OR static::$_delete_name = version_compare(phpversion('phpredis'), '5', '>=')
|
||||
? 'del'
|
||||
: 'delete';
|
||||
|
||||
$CI =& get_instance();
|
||||
|
||||
if ($CI->config->load('redis', TRUE, TRUE))
|
||||
@@ -135,10 +146,6 @@ class CI_Cache_redis extends CI_Driver
|
||||
{
|
||||
log_message('error', 'Cache: Redis connection refused ('.$e->getMessage().')');
|
||||
}
|
||||
|
||||
// Initialize the index of serialized values.
|
||||
$serialized = $this->_redis->sMembers('_ci_redis_serialized');
|
||||
empty($serialized) OR $this->_serialized = array_flip($serialized);
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------
|
||||
@@ -153,7 +160,7 @@ class CI_Cache_redis extends CI_Driver
|
||||
{
|
||||
$value = $this->_redis->get($key);
|
||||
|
||||
if ($value !== FALSE && isset($this->_serialized[$key]))
|
||||
if ($value !== FALSE && $this->_redis->sIsMember('_ci_redis_serialized', $key))
|
||||
{
|
||||
return unserialize($value);
|
||||
}
|
||||
@@ -184,9 +191,8 @@ class CI_Cache_redis extends CI_Driver
|
||||
isset($this->_serialized[$id]) OR $this->_serialized[$id] = TRUE;
|
||||
$data = serialize($data);
|
||||
}
|
||||
elseif (isset($this->_serialized[$id]))
|
||||
else
|
||||
{
|
||||
$this->_serialized[$id] = NULL;
|
||||
$this->_redis->sRemove('_ci_redis_serialized', $id);
|
||||
}
|
||||
|
||||
@@ -203,16 +209,12 @@ class CI_Cache_redis extends CI_Driver
|
||||
*/
|
||||
public function delete($key)
|
||||
{
|
||||
if ($this->_redis->delete($key) !== 1)
|
||||
if ($this->_redis->{static::$_delete_name}($key) !== 1)
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if (isset($this->_serialized[$key]))
|
||||
{
|
||||
$this->_serialized[$key] = NULL;
|
||||
$this->_redis->sRemove('_ci_redis_serialized', $key);
|
||||
}
|
||||
$this->_redis->sRemove('_ci_redis_serialized', $key);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
@@ -228,7 +230,7 @@ class CI_Cache_redis extends CI_Driver
|
||||
*/
|
||||
public function increment($id, $offset = 1)
|
||||
{
|
||||
return $this->_redis->incr($id, $offset);
|
||||
return $this->_redis->incrBy($id, $offset);
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------
|
||||
@@ -242,7 +244,7 @@ class CI_Cache_redis extends CI_Driver
|
||||
*/
|
||||
public function decrement($id, $offset = 1)
|
||||
{
|
||||
return $this->_redis->decr($id, $offset);
|
||||
return $this->_redis->decrBy($id, $offset);
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
*
|
||||
* This content is released under the MIT License (MIT)
|
||||
*
|
||||
* Copyright (c) 2014 - 2018, British Columbia Institute of Technology
|
||||
* Copyright (c) 2014 - 2019, 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,8 +29,8 @@
|
||||
* @package CodeIgniter
|
||||
* @author EllisLab Dev Team
|
||||
* @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/)
|
||||
* @copyright Copyright (c) 2014 - 2018, British Columbia Institute of Technology (http://bcit.ca/)
|
||||
* @license http://opensource.org/licenses/MIT MIT License
|
||||
* @copyright Copyright (c) 2014 - 2019, British Columbia Institute of Technology (https://bcit.ca/)
|
||||
* @license https://opensource.org/licenses/MIT MIT License
|
||||
* @link https://codeigniter.com
|
||||
* @since Version 3.0.0
|
||||
* @filesource
|
||||
|
||||
Reference in New Issue
Block a user