Fix cache redis ttl to work * backported redis cache ttl does not work from https://github.com/bcit-ci/CodeIgniter/pull/6231
Fix "Serialization of 'ReflectionMethod' is not allowed" * With 0925b50 there have been proper fixes for CI_Migration and CI_Xmlrpcs classes. But for CI_Codeigniter the former is_callable check has been removed without any substitution. * This is another fix for PHP8 8.1 compatibility layer php
Fixes bcit-ci#6175 fix $this->uri->ruri_string() generates in PHP 8.1 * it coplements prevous commit and related to commit ad1a30755626c1cee0b03bb95ccac2d894306288 is not the proper way but compatible with https://github.com/bcit-ci/CodeIgniter/pull/6117 and solves https://github.com/bcit-ci/CodeIgniter/issues/6120
... | ... | @@ -435,7 +435,7 @@ if ( ! is_php('5.4')) |
435 | 435 | * ReflectionMethod::isConstructor() is the ONLY reliable check,
|
436 | 436 | * knowing which method will be executed as a constructor.
|
437 | 437 | */
|
438 | - else
|
|
438 | + elseif ( ! in_array($method, get_class_methods($class)))
|
|
439 | 439 | {
|
440 | 440 | $reflection = new ReflectionMethod($class, $method);
|
441 | 441 | if ( ! $reflection->isPublic() OR $reflection->isConstructor())
|
... | ... | @@ -645,7 +645,7 @@ class CI_URI { |
645 | 645 | */
|
646 | 646 | public function ruri_string()
|
647 | 647 | {
|
648 | - return ltrim(load_class('Router', 'core')->directory, '/').implode('/', $this->rsegments);
|
|
648 | + return ltrim((string) load_class('Router', 'core')->directory, '/').implode('/', $this->rsegments);
|
|
649 | 649 | }
|
650 | 650 | |
651 | 651 | } |
... | ... | @@ -214,6 +214,10 @@ class CI_Cache_redis extends CI_Driver |
214 | 214 | $this->_redis->{static::$_sRemove_name}('_ci_redis_serialized', $id);
|
215 | 215 | }
|
216 | 216 | |
217 | + if (is_numeric($ttl)) {
|
|
218 | + $this->_redis->expireAt($id, time() + $ttl);
|
|
219 | + }
|
|
220 | + |
|
217 | 221 | return $this->_redis->set($id, $data, $ttl);
|
218 | 222 | }
|
219 | 223 |
—
View it on GitLab.
You're receiving this email because of your account on gitlab.com. Manage all notifications · Help