Welcome Guest, Not a member yet? Register   Sign In
CodeIgniter 4.1.6 Released
#1

Hi all! Happy New Year, and happy new version! Just released, version 4.1.6 rolls up a lot of bug fixes and small tweaks and enhancements to make way for our next big feature release. Of note in this release is full support for PHP 8.1 as well as our first real security disclosure & fix (attribution forthcoming).
Read the release notes in the User Guide for more details and help migrating between versions. A huge "THANK YOU" to the team of maintainers and our active community contributors who keep this framework moving forward.
Release: https://github.com/codeigniter4/CodeIgni...tag/v4.1.6
(Also if you haven't yet go check out Lonnie's thread for "what's next" in this upcoming year)
Reply
#2

(This post was last modified: 01-03-2022, 06:42 PM by ikesela.)

got this error

Code:
Access to undeclared static property Kint\Kint::$depth_limit

252         Kint::$depth_limit         = $config->maxDepth;

i have to comment it out to make it work;

// Kint::$depth_limit = $config->maxDepth;
Reply
#3

(This post was last modified: 01-03-2022, 07:45 PM by kenjis.)

Sorry, "codeigniter4/framework" has out of dated composer.json.

The workaround is to revert the following changes:
PHP Code:
--- a/system/CodeIgniter.php
+++ b/system/CodeIgniter.php
@@ -249,+249,@@ class CodeIgniter
          
*/
        $config config('Config\Kint');

-
        Kint::$max_depth          $config->maxDepth;
+
        Kint::$depth_limit        $config->maxDepth;
        Kint::$display_called_from $config->displayCalledFrom;
        Kint::$expanded            $config->expanded;

@@ -
261,+261,@@ class CodeIgniter
        RichRenderer
::$folder $config->richFolder;
        RichRenderer::$sort  $config->richSort;
        if (! empty($config->richObjectPlugins) && is_array($config->richObjectPlugins)) {
-
            RichRenderer::$object_plugins $config->richObjectPlugins;
+
            RichRenderer::$value_plugins $config->richObjectPlugins;
        }
        if (! empty($config->richTabPlugins) && is_array($config->richTabPlugins)) {
            RichRenderer::$tab_plugins $config->richTabPlugins

The error Access to undeclared static property Kint\Kint::$depth_limit was fixed.
v4.1.6 was re-released.

v4.1.6 has a security fix. Users of all versions prior to 4.1.6 are encouraged to update.

Deserialization of Untrusted Data in Codeigniter4 · Advisory · codeigniter4/CodeIgniter4
https://github.com/codeigniter4/CodeIgni...-wj64-mc9x
Reply
#4

thank you, it work now
Reply
#5

User Guide >  Change Logs > Version 4.1.6 — CodeIgniter 4.1.6 documentation
https://codeigniter4.github.io/CodeIgnit...4.1.6.html

Changelog
https://github.com/codeigniter4/CodeIgni...2022-01-03
Reply
#6

I have this error with PHP 8.1.1

ErrorException

number_format(): Passing null to parameter #1 ($num) of type float is deprecated

I update with composer
Reply
#7

Can you show us full stack trace?
Reply
#8

(01-03-2022, 09:18 PM)kenjis Wrote: Can you show us full stack trace?
Yeap, this is

Code:
{PHP internal code}  —  CodeIgniter\Debug\Exceptions->errorHandler ( arguments )

SYSTEMPATH/Database/BaseConnection.php : 933  —  number_format()

SYSTEMPATH/Debug/Toolbar/Collectors/Database.php : 112  —  CodeIgniter\Database\BaseConnection->getConnectDuration ()

105
106        foreach ($this->connections as $alias => $connection) {
107            // Connection Time
108            $data[] = [
109                'name'      => 'Connecting to Database: "' . $alias . '"',
110                'component' => 'Database',
111                'start'    => $connection->getConnectStart(),
112                'duration'  => $connection->getConnectDuration(),
113            ];
114        }
115
116        foreach (static::$queries as $query) {
117            $data[] = [
118                'name'      => 'Query',
119                'component' => 'Database',

SYSTEMPATH/Debug/Toolbar/Collectors/BaseCollector.php : 115  —  CodeIgniter\Debug\Toolbar\Collectors\Database->formatTimelineData ()

108      */
109    public function timelineData(): array
110    {
111        if (! $this->hasTimeline) {
112            return [];
113        }
114
115        return $this->formatTimelineData();
116    }
117
118    /**
119      * Does this Collector have data that should be shown in the
120      * 'Vars' tab?
121      */
122    public function hasVarData(): bool

SYSTEMPATH/Debug/Toolbar/Collectors/BaseCollector.php : 231  —  CodeIgniter\Debug\Toolbar\Collectors\BaseCollector->timelineData ()

224            'display'        => $this->display(),
225            'badgeValue'      => $this->getBadgeValue(),
226            'isEmpty'        => $this->isEmpty(),
227            'hasTabContent'  => $this->hasTabContent(),
228            'hasLabel'        => $this->hasLabel(),
229            'icon'            => $this->icon(),
230            'hasTimelineData' => $this->hasTimelineData(),
231            'timelineData'    => $this->timelineData(),
232        ];
233    }
234 }
235

SYSTEMPATH/Debug/Toolbar.php : 90  —  CodeIgniter\Debug\Toolbar\Collectors\BaseCollector->getAsArray ()

83        $data['totalMemory']    = number_format((memory_get_peak_usage()) / 1024 / 1024, 3);
84        $data['segmentDuration'] = $this->roundTo($data['totalTime'] / 7);
85        $data['segmentCount']    = (int) ceil($data['totalTime'] / $data['segmentDuration']);
86        $data['CI_VERSION']      = CodeIgniter::CI_VERSION;
87        $data['collectors']      = [];
88
89        foreach ($this->collectors as $collector) {
90            $data['collectors'][] = $collector->getAsArray();
91        }
92
93        foreach ($this->collectVarData() as $heading => $items) {
94            $varData = [];
95
96            if (is_array($items)) {
97                foreach ($items as $key => $value) {

SYSTEMPATH/Debug/Toolbar.php : 368  —  CodeIgniter\Debug\Toolbar->run ( arguments )

361            if ($response instanceof DownloadResponse) {
362                return;
363            }
364
365            $toolbar = Services::toolbar(config(self::class));
366            $stats  = $app->getPerformanceStats();
367            $data    = $toolbar->run(
368                $stats['startTime'],
369                $stats['totalTime'],
370                $request,
371                $response
372            );
373
374            helper('filesystem');
375

SYSTEMPATH/Filters/DebugToolbar.php : 40  —  CodeIgniter\Debug\Toolbar->prepare ( arguments )

33      * If the debug flag is set (CI_DEBUG) then collect performance
34      * and debug information and display it in a toolbar.
35      *
36      * @param array|null $arguments
37      */
38    public function after(RequestInterface $request, ResponseInterface $response, $arguments = null)
39    {
40        Services::toolbar()->prepare($request, $response);
41    }
42 }
43

SYSTEMPATH/Filters/Filters.php : 196  —  CodeIgniter\Filters\DebugToolbar->after ( arguments )

189                    continue;
190                }
191
192                return $result;
193            }
194
195            if ($position === 'after') {
196                $result = $class->after($this->request, $this->response, $this->argumentsClass[$className] ?? null);
197
198                if ($result instanceof ResponseInterface) {
199                    $this->response = $result;
200
201                    continue;
202                }
203            }

SYSTEMPATH/CodeIgniter.php : 429  —  CodeIgniter\Filters\Filters->run ( arguments )

422
423        // Never run filters when running through Spark cli
424        if (! defined('SPARKED')) {
425            $filters->setResponse($this->response);
426
427            // Run "after" filters
428            $this->benchmark->start('after_filters');
429            $response = $filters->run($uri, 'after');
430            $this->benchmark->stop('after_filters');
431        } else {
432            $response = $this->response;
433
434            // Set response code for CLI command failures
435            if (is_numeric($returned) || $returned === false) {
436                $response->setStatusCode(400);

SYSTEMPATH/CodeIgniter.php : 320  —  CodeIgniter\CodeIgniter->handleRequest ( arguments )

313            $this->response->pretend($this->useSafeOutput)->send();
314            $this->callExit(EXIT_SUCCESS);
315
316            return;
317        }
318
319        try {
320            return $this->handleRequest($routes, $cacheConfig, $returnResponse);
321        } catch (RedirectException $e) {
322            $logger = Services::logger();
323            $logger->info('REDIRECTED ROUTE at ' . $e->getMessage());
324
325            // If the route is a 'redirect' route, it throws
326            // the exception with the $to as the message
327            $this->response->redirect(base_url($e->getMessage()), 'auto', $e->getCode());

FCPATH/index.php : 46  —  CodeIgniter\CodeIgniter->run ()

39 /*
40  *---------------------------------------------------------------
41  * LAUNCH THE APPLICATION
42  *---------------------------------------------------------------
43  * Now that everything is setup, it's time to actually fire
44  * up the engines and make this app do its thang.
45  */
46 $app->run();
47
Reply
#9

@ferb
Thank you.
Can you try this fix?
https://github.com/codeigniter4/CodeIgni...1b1293e9a5
Reply
#10

(This post was last modified: 01-03-2022, 10:25 PM by ferb.)

(01-03-2022, 10:06 PM)kenjis Wrote: @ferb
Thank you.
Can you try this fix?
https://github.com/codeigniter4/CodeIgni...1b1293e9a5

Yeap, wait a moment.

tanks

(01-03-2022, 10:06 PM)kenjis Wrote: @ferb
Thank you.
Can you try this fix?
https://github.com/codeigniter4/CodeIgni...1b1293e9a5

It's work.

I have a question, i modified directly file inside package was installed from composer, this modified not affected for new updates from composer?
Reply




Theme © iAndrew 2016 - Forum software by © MyBB