summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--system/libraries/Cache/Cache.php38
-rw-r--r--system/libraries/Driver.php2
-rw-r--r--user_guide_src/source/changelog.rst1
3 files changed, 19 insertions, 22 deletions
diff --git a/system/libraries/Cache/Cache.php b/system/libraries/Cache/Cache.php
index ba732ee8e..53f9f81a7 100644
--- a/system/libraries/Cache/Cache.php
+++ b/system/libraries/Cache/Cache.php
@@ -68,7 +68,7 @@ class CI_Cache extends CI_Driver_Library {
*
* @param string
*/
- protected $_backup_driver;
+ protected $_backup_driver = 'dummy';
/**
* Constructor
@@ -102,6 +102,22 @@ class CI_Cache extends CI_Driver_Library {
$this->_backup_driver = $config['backup'];
}
}
+
+ // If the specified adapter isn't available, check the backup.
+ if ( ! $this->is_supported($this->_adapter))
+ {
+ if ( ! $this->is_supported($this->_backup_driver))
+ {
+ // Backup isn't supported either. Default to 'Dummy' driver.
+ log_message('error', 'Cache adapter "'.$this->_adapter.'" and backup "'.$this->_backup_driver.'" are both unavailable. Cache is now using "Dummy" adapter.');
+ $this->_adapter = 'dummy';
+ }
+ else
+ {
+ // Backup is supported. Set it to primary.
+ $this->_adapter = $this->_backup_driver;
+ }
+ }
}
// ------------------------------------------------------------------------
@@ -206,26 +222,6 @@ class CI_Cache extends CI_Driver_Library {
return $support[$driver];
}
- // ------------------------------------------------------------------------
-
- /**
- * __get()
- *
- * @param child
- * @return object
- */
- public function __get($child)
- {
- $obj = parent::__get($child);
-
- if ( ! $this->is_supported($child))
- {
- $this->_adapter = $this->_backup_driver;
- }
-
- return $obj;
- }
-
}
/* End of file Cache.php */
diff --git a/system/libraries/Driver.php b/system/libraries/Driver.php
index c79698c7b..d67ee2549 100644
--- a/system/libraries/Driver.php
+++ b/system/libraries/Driver.php
@@ -51,7 +51,7 @@ class CI_Driver_Library {
*
* @var string
*/
- protected static $lib_name;
+ protected $lib_name;
/**
* The first time a child is used it won't exist, so we instantiate it
diff --git a/user_guide_src/source/changelog.rst b/user_guide_src/source/changelog.rst
index de4af7efe..587e56ea7 100644
--- a/user_guide_src/source/changelog.rst
+++ b/user_guide_src/source/changelog.rst
@@ -224,6 +224,7 @@ Bug fixes for 3.0
- Fixed a bug (#319) - SQLSRV's affected_rows() method failed due to a scrollable cursor being created for write-type queries.
- Fixed a bug (#356) - PostgreSQL driver didn't have an _update_batch() method, which resulted in fatal error being triggered when update_batch() is used with it.
- Fixed a bug (#862) - create_table() failed on SQLSRV/MSSQL when used with 'IF NOT EXISTS'.
+- Fixed a bug (#1419) - libraries/Driver.php had a static variable that was causing an error.
Version 2.1.1
=============