Skip to content

Commit b14db3c

Browse files
committed
refactor: towards PHP 8.4 and PHP 8.5
Signed-off-by: otengkwame <developerkwame@gmail.com>
1 parent b2c71d6 commit b14db3c

3 files changed

Lines changed: 4 additions & 10 deletions

File tree

CodeIgniter/Framework/core/CI.php

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -133,14 +133,8 @@ protected function basepath()
133133
*/
134134
protected function charset()
135135
{
136-
ini_set('default_charset', $charset = strtoupper(config_item('charset')));
137-
136+
$charset = strtoupper(config_item('charset')); // Define $charset
138137
defined('MB_ENABLED') || define('MB_ENABLED', extension_loaded('mbstring'));
139-
140-
$encoding = 'mbstring.internal_encoding';
141-
142-
! ini_get($encoding) && ini_set($encoding, $charset);
143-
144138
$this->iconv();
145139
}
146140

CodeIgniter/Framework/core/Common.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -846,7 +846,7 @@ function set_status_header($code = 200, $text = '')
846846
}
847847
}
848848

849-
if (strpos(PHP_SAPI, 'cgi') === 0) {
849+
if (PHP_SAPI === "cgi") {
850850
header('Status: ' . $code . ' ' . $text, true);
851851
return;
852852
}

Core/core/Http/HttpCurl.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -801,7 +801,7 @@ public function execute()
801801
}
802802

803803
// Success
804-
curl_close($this->session);
804+
unset($this->session);
805805
$this->lastResponse = $this->processResponse($this->lastResponseRaw);
806806
$this->reset();
807807
$this->hasError = false;
@@ -849,7 +849,7 @@ private function handleError()
849849
$this->errorString = curl_error($this->session);
850850
$this->hasError = true;
851851

852-
curl_close($this->session);
852+
unset($this->session);
853853
$this->reset();
854854
}
855855

0 commit comments

Comments
 (0)