Busy couple of weeks ...

by Lester Caine
Thursday 01 of May, 2025
Posted to Lester's Rants

Been a while since I last posted, and while there are lots of things to rant about, the main problem is with my own head and getting around my own prejudices. I never did get into 'namespaces' when they were first introduced to PHP, and even today one of my main third party libraries, ADOdb, still does not have one set, but the other key library, smarty, does and this was causing a little difficulty. In Smarty5 everything has been converted to classes, although I do not see the advantage of having individual class wrappers around every single 'one line function'. Trying to change everything to use namespaces was probably my first mistake, and so I back-peddled a bit and just worked on adding Bitweaver as a base for the various packages in the bitweaver framework using Smarty4 helped me to understand just where I was going wrong. I STILL do not like the way composer lays out things under the 'vendor' directory tree, preferring to keep the main classes in includes\classes and so I now have an 'autoload' that in addition to loading Bitweaver also handles Smarty in the bitweaver tree. Adding ADOdb to that may come but currently it's wrapped in BitAdoDb in the kernel classes.

The switch to Smarty5 was then a little easier, but while I have converted all the 'block' modifiers to classes, I have my own 'extension' that keeps the 'function' and 'modifier' code as simple function elements which are also used in the main bitweaver code. I am having to load every one into Smarty currently because of the way it insists on working, but I would prefer that the 'autoload' that I have to lazyload just the functions needed would actually work with the new Smarty5 setup. I do NOT plan on listing every package needed for each template or convert the rest of the code to individula classes. A simple function load is perfectly adaquate? And the BitweaverExtension can handle that without needing the BC one that Smary5 provides. Something to take up on the Smarty forum ...

Now I am back addressing the remaining PHP8.4 warnings and making Bitweaver5lsces clean as far as VSCode/DevsensePHP and PHP itself are conserned. That this code will perhaps not run on PHP8.3 may be a little short sighted, but stripping all the PHP7.3 dependent code is the real target and I don't see a problem with only supporting PHP8.4 at this stage of the game?