I've just pushed out the v1.1.3038 update for the Trongate framework. This was a fairly significant update and I wanted to tell you about some of the changes that were made here. For anyone who is in a hurry, I can confirm that there are NO BREAKING CHANGES. So, if you're super busy, you can move on and continue with your life. For those of you who are still reading, I hope you find this information useful. It's healthy to be kept in the loop about what's happening with your framework. Therefore, I can confirm that v1.1.3038 brings two significant updates to the table.

We Have Ignition

For anyone who has ever tried to follow the code and figure out how any decent-sized framework works, you'll know that it's not easy. In the case of Trongate, the very first PHP file that gets loaded is index.php, which is inside the 'public' directory. That file has only one purpose: to start up the framework. Since the main workings of Trongate are contained within an 'engine' directory, it should be no surprise that index.php simply calls something from inside 'engine' and then gets out of the way. So, what this means is that - for Trongate apps - the main action kicks off when a file called 'bootstrap.php' gets loaded. This bootstrap file is critical because it basically figures out what classes need to be loaded in order for us to have a meaningful, working app.

About Bootstrapping

Did you know that 'bootstrapping' is a special word that has nothing whatsoever to do with the popular CSS framework? In web development, 'bootstrapping' refers to the process of loading the environment a program (or a script, in the case of PHP) needs to operate. In the context of PHP development, it also means funneling all web requests through a single script that performs the bootstrapping process, also called “front controller” (taken from https://www.binpress.com/php-bootstrapping-crash-course/. Now you know why our critical main class loading file was named 'bootstrap.php'. Of course, when most developers hear the word 'bootstrap' they'll immediately think about the world's most popular CSS framework: the Bootstrap framework. They probably won't be thinking about loading classes. Therefore, to give Trongate developers a little more clarity about what gets loaded first, we've decided to ditch 'bootstrap.php' and, in its place, we're going to have a new file called 'ignition.php'. This decision was made via an online poll during a recent livestream. Hopefully, 'ignition' says more about what the file actually does. It also has the added bonus of keeping the 'engine' theme going. Don't worry about your apps breaking! We're still including a 'bootstrap.php' file with the framework. Now, the 'bootstrap.php' file is simply going to 'require_once()' our ignition file. In the future, we will be getting rid of 'bootstrap.php' completely. However, we wanted to let some time pass before this happens. Remember, Trongate's highest priority is stability. Next...

A Cleaner Trongate Class

Prior to v1.1.3038, our main 'Trongate' class (which is inside Trongate.php) contained over 300 lines of code. A great deal of that code was to do with uploading of files. For some time, there have been calls to have that code moved somewhere else and I couldn't agree more. So, finally, we've stripped out all of the code that was to do with uploading of files. That code now resides inside the 'tg_helpers' directory - within either a 'file_helper' class or an 'img_helper' class. The end result is a much cleaner and more sensible structure. I've also tidied up some of the code a little bit and I'm looking forward to updating the docs and also putting out some videos for the Learning Zone - so that you can have a chance to look at this in a bit more detail. As you would expect, I've taken steps to make sure that everything is backwards compatible. So, even though I'm going to be updating the docs at some point, your older image uploading code will continue to work. I'll probably wait at least a year before removing the older code. I cannot stress enough that the highest priority for Trongate is stability. I certainly don't want anybody to have a broken app because of some framework update. So, let me assure you, we are in very good shape as far as backwards compatibility goes. Thanks for reading and remember... together we shall make PHP great again! DC