close

Welcome Guest, Not a member yet? Register   Sign In
  Error after update to 4.7.3
Posted by: randyshare - 06-19-2026, 01:51 AM - Replies (5)
Image

At V 4.7.2, my project Run smoothly


Fatal error: Uncaught ErrorException: Undefined property: Config\Format::$jsonEncodeDepth in D:\Programming\project\NGS_WebInventory_CI4\vendor\codeigniter4\framework\system\Format\JSONFormatter.php:44 Stack trace: #0 D:\Programming\project\NGS_WebInventory_CI4\vendor\codeigniter4\framework\system\Format\JSONFormatter.php(44): CodeIgniter\Debug\Exceptions->errorHandler(2, 'Undefined prope...', 'D:\\Programming\\...', 44) #1 D:\Programming\project\NGS_WebInventory_CI4\vendor\codeigniter4\framework\system\API\ResponseTrait.php(352): CodeIgniter\Format\JSONFormatter->format(Array) #2 D:\Programming\project\NGS_WebInventory_CI4\vendor\codeigniter4\framework\system\API\ResponseTrait.php(111): CodeIgniter\Debug\ExceptionHandler->format(Array) #3 D:\Programming\project\NGS_WebInventory_CI4\vendor\codeigniter4\framework\system\Debug\ExceptionHandler.php(95): CodeIgniter\Debug\ExceptionHandler->respond(Array, 500) #4 D:\Programming\project\NGS_WebInventory_CI4\vendor\codeigniter4\framework\system\Debug\Exceptions.php(151): CodeIgniter\Debug\ExceptionHandler->handle(Object(ErrorException), Object(CodeIgniter\HTTP\IncomingRequest), Object(CodeIgniter\HTTP\Response), 500, 1) #5 [internal function]: CodeIgniter\Debug\Exceptions->exceptionHandler(Object(ErrorException)) #6 {main} thrown in D:\Programming\project\NGS_WebInventory_CI4\vendor\codeigniter4\framework\system\Format\JSONFormatter.php on line 44

Fatal error: Uncaught ErrorException: Undefined property: Config\Format::$jsonEncodeDepth in D:\Programming\project\NGS_WebInventory_CI4\vendor\codeigniter4\framework\system\Format\JSONFormatter.php:44 Stack trace: #0 D:\Programming\project\NGS_WebInventory_CI4\vendor\codeigniter4\framework\system\Format\JSONFormatter.php(44): CodeIgniter\Debug\Exceptions->errorHandler(2, 'Undefined prope...', 'D:\\Programming\\...', 44) #1 D:\Programming\project\NGS_WebInventory_CI4\vendor\codeigniter4\framework\system\API\ResponseTrait.php(352): CodeIgniter\Format\JSONFormatter->format(Array) #2 D:\Programming\project\NGS_WebInventory_CI4\vendor\codeigniter4\framework\system\API\ResponseTrait.php(111): CodeIgniter\Debug\ExceptionHandler->format(Array) #3 D:\Programming\project\NGS_WebInventory_CI4\vendor\codeigniter4\framework\system\Debug\ExceptionHandler.php(95): CodeIgniter\Debug\ExceptionHandler->respond(Array, 500) #4 D:\Programming\project\NGS_WebInventory_CI4\vendor\codeigniter4\framework\system\Debug\Exceptions.php(151): CodeIgniter\Debug\ExceptionHandler->handle(Object(ErrorException), Object(CodeIgniter\HTTP\IncomingRequest), Object(CodeIgniter\HTTP\Response), 500, 1) #5 D:\Programming\project\NGS_WebInventory_CI4\vendor\codeigniter4\framework\system\Debug\Exceptions.php(270): CodeIgniter\Debug\Exceptions->exceptionHandler(Object(ErrorException)) #6 [internal function]: CodeIgniter\Debug\Exceptions->shutdownHandler() #7 {main} thrown in D:\Programming\project\NGS_WebInventory_CI4\vendor\codeigniter4\framework\system\Format\JSONFormatter.php on line 44
I was checked 
\vendor\codeigniter4\framework\system\Format\JSONFormatter.php 

Line 44

$result = json_encode($data, $options, $config->jsonEncodeDepth);
----
 $config = new Format();
No  jsonEncodeDepth there.
So i change to
        $result = json_encode($data, $options, 512);


Lightbulb Should CodeIgniter Introduce Native Stream Response Support?
Posted by: maniaba - 06-15-2026, 01:22 AM - No Replies
Image

Hello everyone,
I'd like to open a discussion about introducing native Stream Response support into CodeIgniter and see whether the community finds it valuable.
As web applications evolve, more use cases rely on streaming data instead of generating a complete response before sending it to the client. This becomes especially important when working with:

  • Large file downloads
  • Large dataset exports
  • AI/LLM streaming responses
  • Server-Sent Events (SSE)
  • Real-time progress updates
  • Proxying external streams
  • Chunked data processing
Currently, developers can implement some of these patterns manually, but having framework-level support could provide a cleaner and more consistent developer experience.
Potential benefits include:
  • Lower memory usage
  • Faster response delivery (better Time-To-First-Byte)
  • Improved scalability for large responses
  • Better support for modern application architectures
  • Easier implementation of real-time and streaming features
A possible API could look something like:
Code:
return $this->response->stream(function ($output) {
    foreach ($chunks as $chunk) {
        $output->write($chunk);
        $output->flush();
    }
});
Or dedicated helpers for common scenarios such as file streaming and SSE.
I'm interested in hearing feedback from both the community and the core team.
Would native Stream Response support be something you would use in your projects?

Share your thoughts and use cases.


  12 Hard Truths About Coding I Learned the Hard Way After 10+ Years
Posted by: php_rocs - 06-08-2026, 09:21 PM - Replies (1)
Image

(DEV.TO): https://dev.to/canro91/12-hard-truths-ab...years-124j


  PHP is 5x Faster Than NestJS? Rethinking High-Load with Swoole.
Posted by: php_rocs - 06-05-2026, 01:52 PM - Replies (3)
Image

PHP at its best (DEV.TO). https://dev.to/roman_shneer_9301c1e5f2fd...woole-31di


  Response Decorators for API Responses?
Posted by: datamweb - 06-03-2026, 11:09 PM - Replies (3)
Image

Hello everyone,
CodeIgniter currently provides: View Decorators, Transformers,Filters , ...

But there is no dedicated extension point for modifying API response payloads before formatting.

Example decorator:

PHP Code:
final class ApiVersionDecorator implements ResponseDecoratorInterface
{
    public static function 
decorate(
        
mixed $payload,
        
ResponseInterface $response,
    ): 
mixed {
        if (! 
is_array($payload)) {
            return 
$payload;
        }

        
$payload['apiVersion'] = 'v1';

        return 
$payload;
    }




PHP Code:
public array $responseDecorators = [
    
ApiVersionDecorator::class,
]; 

Controller:

PHP Code:
return $this->respond([
    
'id'   => 1,
    
'name' => 'John',
]); 

Current response:

Code:
{
    "id": 1,
    "name": "John"
}

Response with decorator:

Code:
{
    "id": 1,
    "name": "John",
    "apiVersion": "v1"
}

Do you think a dedicated API extension point like this would be useful in CodeIgniter, or are Filters already sufficient?


  Should CURLRequest support a chainable withCache() method?
Posted by: datamweb - 05-30-2026, 04:48 PM - Replies (3)
Image

Hi everyone,

I’d like to get community feedback on a small idea for `CURLRequest`.

The idea is to allow something like this:

PHP Code:
$response service('curlrequest')
    ->
withCache(3600)
    ->
get('https://api.github.com/repos/codeigniter4/shield/contributors'); 

This could help in simple cases where developers call the same external API many times and want to avoid repeated requests.

At the moment, developers usually handle this manually with cache().


  Access Control
Posted by: SoccerGuy3 - 05-26-2026, 09:46 AM - Replies (7)
Image

Looking for real world experience on handling access control for a very large app that we've created. We seem to be outgrowing our current setup for access control and starting to brain storm how to move to the next phase. Anyone with suggestions or "been there, done that" advice is greatly appreciated.
Running the latest CodeIgniter 4.x, with MariaDB handling the data. We are using one of Shield's predecessors (Lewe) currently for Security/Auth and controlling access through the routes file. We also maintain menus in a database table that uses security groups for displaying the various menu items.
System is for a large company that handles auctions. The system handles contracts, reports, invoicing, processing deposits, etc. We currently have a dozen levels of access from the Super Admins (ie the devs) down to an access level that can only see one module.
One of the issues is the client is constantly wanting finer and finer grain control over what someone can see/access. For example, they want a specific user to be able to pull admin level reports, but not have the ability to edit contracts. Currently we have a routes file with over 1,100 lines broken into 20 route groups ($routes->group) with different combinations of user levels. It is getting SUPER complicated maintaining that file and making sure someone doesn't access that they shouldn't.
We are currently evaluating ripping out the existing Auth since it is no longer supported and replacing it with Shield. Not a small undertaking! Smile
My initial thoughts run along the lines of not using security groups, but rather create the ability to assign specific functions/modules to individual users. That would eliminate the need to keep creating new groups with finer and finer permissions (and thereby having to add more route groups.
Any suggestions, insight or advice you might offer would be greatly appreciated.


  CI4Table Maker library
Posted by: rafaelwendel - 05-25-2026, 07:13 AM - Replies (1)
Image

Dear CodeIgniters community,

I would like to share with you the CI4TableMaker library, which aims to facilitate the insertion of links (like Edit/Delete/Manage) into an array/resultset to be rendered in an HTML table.

The repository and documentation are available at this link: https://github.com/rafaelwendel/CI4TableMaker

Suggestions are welcome!

Regards


  CodeIgniter 4.7.3 Released
Posted by: paulbalandan - 05-22-2026, 04:36 AM - Replies (3)
Image

CodeIgniter 4.7.3 Released!

CodeIgniter 4.7.3 is now available. This maintenance release delivers an important security fix for file upload validation, improves upgrade safety for Worker Mode deployments, and rolls up a broad set of bug fixes across the CLI, database drivers, validation, language handling, and developer tooling.

If you are upgrading from 4.7.2, please review the upgrade guide before deploying. In particular, applications using ``ext_in`` validation or FrankenPHP Worker Mode should check the updated behavior and required file changes.

GitHub Release
Changelog



Highlights & New Features
  • The ``ext_in`` file upload validation rule is now stricter and safer. It validates the client filename extension and confirms that it matches the detected MIME type.
  • The ``routes`` command now uses ``--sort-by-handler`` instead of ``-h`` to avoid conflicting with the common meaning of ``-h`` as ``--help``. The old option still works for now, but it emits a warning and will be removed in v4.8.0.
  • Worker Mode upgrades are safer: if you use FrankenPHP Worker Mode, update ``public/frankenphp-worker.php`` after upgrading by re-running ``php spark worker:install --force``.



Notable Enhancements
  • CLI output handling is more robust, including fixes for leaked ``stty`` and ``tput`` stderr output when the environment is not interactive.
  • Database behavior is more consistent across drivers, with fixes for PostgreSQL numeric ``increment()`` and ``decrement()``, SQLSRV decrement handling, and cached table list shape.
  • Developer workflows are more predictable thanks to fixes in ``Autoloader::unregister()``, ``command()`` output buffer cleanup, and ``key:generate`` environment key updates.
  • Framework internals received targeted polish in Kint worker-mode CSP handling, deep language dot-notation lookup, enum normalization, toolbar logging, and locale-independent timestamp parsing.



Security and Quality
  • Security fix: ``ext_in`` no longer accepts uploads where the client filename extension does not match the detected MIME type. Previously, the rule only checked the MIME-derived guessed extension, so mismatched filenames could pass validation.
  • The local ``serve`` command now escapes the ``--host`` option properly, preventing shell metacharacters in locally supplied input from being interpreted by ``/bin/sh``.
  • The new ``Cache.invalidHandler`` message string was added to improve framework messaging.
  • Credits to @z3moo and @teebow1e for responsibly reporting the ``ext_in`` issue.



Breaking Changes
  • ``ext_in`` validation is stricter. Before 4.7.3, a file could pass when its client filename extension did not match the detected MIME type. In 4.7.3, files with no client extension, or with an extension that does not match the detected MIME type, now fail ``ext_in`` validation.
  • If your application intentionally accepts such files, remove ``ext_in`` from that validation rule and replace it with a custom rule that matches your application's requirements.



Other Notable Changes

  1. ``Autoloader::unregister()`` now removes handlers correctly during tests instead of leaving SPL autoload closures behind.
  2. ``env`` now handles option-only invocations correctly instead of throwing a ``TypeError``.
  3. ``Validation::getValidated()`` now preserves fields whose validated value is explicitly ``null``.
  4. ``Language::getLine()`` now resolves nested dot-notation keys correctly at deeper levels.
  5. The FrankenPHP worker template no longer redeclares ``Config\Paths`` when the watcher restarts the worker script.



Thanks to Our Contributors

Thanks to everyone who contributed fixes, tests, and reports for this release:



Upgrade Guide
Report Issues

If you find a bug, please open an issue on GitHub with steps to reproduce it. For support questions and discussion, please use the CodeIgniter forum.



Note: This announcement was created with the assistance of GitHub Copilot (GPT-5.4).


  Add whereExists() and whereNotExists() to Query Builder
Posted by: maniaba - 05-20-2026, 09:52 AM - Replies (1)
Image

It would be useful if the Query Builder provided native support for `WHERE EXISTS`
and `WHERE NOT EXISTS` conditions.

Currently, this can be done by writing raw SQL inside `where()`.
However, this approach is less expressive and requires manually disabling escaping.
Proposed API

Code:
$builder->whereExists(static function ($builder) {
    $builder
        ->select('1')
        ->from('orders')
        ->where('orders.user_id = users.id', null, false);
});
Expected SQL:

Code:
WHERE EXISTS (
    SELECT 1
    FROM orders
    WHERE orders.user_id = users.id
)
A matching `whereNotExists()` method would also be helpful:

Code:
$builder->whereNotExists(static function ($builder) {
    $builder
        ->select('1')
        ->from('orders')
        ->where('orders.user_id = users.id', null, false);
});
Why This Would Be Useful `EXISTS` is supported by the major database platforms used by CodeIgniter 4 drivers, including:
  • MySQL
  • PostgreSQL
  • SQLite
  • SQL Server
  • Oracle-compatible databases
Adding explicit Query Builder methods would make these queries:
  • easier to read
  • safer than raw SQL strings
  • more consistent with other Query Builder conditional methods
  • easier to compose with subqueries
  • better suited for correlated subqueries
Suggested Method Names
Code:
whereExists()
orWhereExists()
whereNotExists()
orWhereNotExists()
Additional Notes
This feature would reduce the need for raw SQL in common relational queries and would provide a cleaner API for checking the existence or absence of related records.
Thank you for considering this feature.


Welcome, Guest
You have to register before you can post on our site.

Username
  

Password
  





Latest Threads
Error after update to 4.7...
by InsiteFX
06-22-2026, 11:03 PM
CI4 Customizing Logger fi...
by vido
06-19-2026, 02:27 PM
AssetConnect - a powerful...
by InsiteFX
06-19-2026, 01:57 AM
Access Control
by InsiteFX
06-16-2026, 09:57 PM
Should CodeIgniter Introd...
by maniaba
06-15-2026, 01:22 AM
PHP is 5x Faster Than Nes...
by demyr
06-12-2026, 07:20 AM
Response Decorators for A...
by giladsSG
06-09-2026, 08:18 PM
12 Hard Truths About Codi...
by InsiteFX
06-09-2026, 12:19 AM
Should CURLRequest suppor...
by datamweb
05-31-2026, 11:04 AM
CI4Table Maker library
by InsiteFX
05-26-2026, 02:48 AM

Forum Statistics
» Members: 218,994
» Latest member: helalankaa
» Forum threads: 78,699
» Forum posts: 380,995

Full Statistics

Search Forums

(Advanced Search)


Theme © iAndrew 2016 - Forum software by © MyBB