diff options
author | Andrey Andreev <narf@devilix.net> | 2016-07-28 15:40:12 +0200 |
---|---|---|
committer | Andrey Andreev <narf@devilix.net> | 2016-07-28 15:40:12 +0200 |
commit | a838279625becfba98ccb7635d35c67297129c42 (patch) | |
tree | 6ddf87407a88b84dc90503d5e7ac68c40cd07d66 /system/libraries/Session/drivers | |
parent | 1748567f5442409d6a8c1e795f56599caff8296e (diff) |
Remove dead code written for PHP 5.2
Diffstat (limited to 'system/libraries/Session/drivers')
-rw-r--r-- | system/libraries/Session/drivers/Session_files_driver.php | 15 |
1 files changed, 3 insertions, 12 deletions
diff --git a/system/libraries/Session/drivers/Session_files_driver.php b/system/libraries/Session/drivers/Session_files_driver.php index 57c3777a2..bf4df8b20 100644 --- a/system/libraries/Session/drivers/Session_files_driver.php +++ b/system/libraries/Session/drivers/Session_files_driver.php @@ -149,18 +149,9 @@ class CI_Session_files_driver extends CI_Session_driver implements SessionHandle // which re-reads session data if ($this->_file_handle === NULL) { - // Just using fopen() with 'c+b' mode would be perfect, but it is only - // available since PHP 5.2.6 and we have to set permissions for new files, - // so we'd have to hack around this ... - if (($this->_file_new = ! file_exists($this->_file_path.$session_id)) === TRUE) - { - if (($this->_file_handle = fopen($this->_file_path.$session_id, 'w+b')) === FALSE) - { - log_message('error', "Session: File '".$this->_file_path.$session_id."' doesn't exist and cannot be created."); - return $this->_failure; - } - } - elseif (($this->_file_handle = fopen($this->_file_path.$session_id, 'r+b')) === FALSE) + $this->_file_new = ! file_exists($this->_file_path.$session_id); + + if (($this->_file_handle = fopen($this->_file_path.$session_id, 'c+b')) === FALSE) { log_message('error', "Session: Unable to open file '".$this->_file_path.$session_id."'."); return $this->_failure; |