[BlueOnyx:25680] Re: BlueOnyx 5211R development - progress report

Michael Stauber mstauber at blueonyx.it
Thu Nov 10 02:36:19 -05 2022


Hi Ernie,

> just curious, were most of the changes caused by the jump to Php 8.1 or the
> jump to the new CodeIgniter version?

There were just a handful of compatibility issues going from PHP-7.2 to 
PHP-8.1 and these were quickly found and easily fixed.

By far the most code changes were related to the differences that the 
newer CodeIgniter introduced. Some of these changes were outright silly, 
some are a great help, so I'm not complaining.

One of the benefits of using a framework is that you don't have to 
reinvent the wheel for basic stuff such as reading/setting cookies, 
dealing with CSRF, input filtering and parsing, file operations, session 
management and other lower level functions.

But: Between CI3 and CI4 they renamed a lot of these internal functions 
and/or they now behave slightly different or have other parameters.

It wasn't all bad, though. They introduced something called 
BaseController, which is one central controller script that can easily 
be called from any CodeIgniter page or class. In the old CI3 I hacked 
something similar into our third party routing module to use it as 
central storage for a lot of session related data that we needed to 
access from all parts of the GUI: Helpers, Libraries and GUI pages.

Now with the BaseController in CI4 and its much tighter integration I 
could consolidate many time saving functions into it and that also made 
it easy to implement the CODB cache that helps us to speed up the GUI.

Additionally I could trim down a lot of redundant baggage from 
individual GUI pages by offloading repetitive stuff into the central 
BaseController.

For example see:

https://www.blueonyx.it/uploads/images/5211R/5211R-vs-5210R-vsiteMod.png

Left side:  New /vsite/vsiteMod on 5211R
Right side: Old /vsite/vsiteMod on 5210R

Loading and initializing libraries, firing up CCE and 
ServerScriptHelper, determining language and locales, getting the System 
and User Objects, Cookies and ACL's of the logged in users? POST and GET 
results or UserAgent strings? BaseController has already done all that 
for us and we can simply call or process the results wherever we have to.

While that stripped a fair chunk of excess baggage off individual GUI 
pages, it also required that I had to rewrite all of them. But 
eventually I sort of templated it as most GUI pages follow a certain 
principle anyway.

-- 
With best regards

Michael Stauber



More information about the Blueonyx mailing list