Categories


Loading feed
Loading feed
Loading feed

Blueprint for PHP Applications: Bootstrapping (part 2)

In Part 1 of this article I talked a lot about funneling. Sending every request to one PHP file that then controls the flow of the request into our application code. This one PHP file is called the “Bootstrapper” and deals with everything in common for every request our application receives. The bootstrapper can setup, configure and gift wrap everything that all pages have in common. It can make sure the include path is setup correctly, that the environment is configured correctly, all PHP settings are set, that common model objects are loaded, and that the front controller is invoked to begin your MVC processing. If you setup the bootstrapper correctly your application code will be more manageable and consistent, along with being easier to write in the first place. Now that all requests are headed its way, we can dig deeper into the Bootstrapper itself.

Blueprint for PHP Applications: Bootstrapping (part 1)

Bootstrapping alludes to a German legend about Baron Munchhausen, who was able to lift himself out of a swamp by pulling himself up by his own hair. In later versions he was using his own boot straps to pull himself out of the sea which gave rise to the term bootstrapping.
That definition from Wikipedia has more flair to it than I can probably give this article, but nonetheless bootstrapping is an incredibly important part of a PHP web application. It is the ignition, the launch-pad, the booster rockets, and even the safety gear for our trip through PHP Best Practices. Without a well designed bootstrap, our application will never get off the ground.

Blueprint for PHP Applications: Cornerstone

Bringing together a library of PHP best practices is no small feat. Even though there are numerous repositories of PHP information spread throughout blogs, Wikis, magazines and PHP web sites; it is not easy to pull together a consistent and complete picture. The detail provided doesn’t always fit with the detail provided by someone else. Nor is the context always present to give you the Why, What and How in one bundle of knowledge. In order for us to do this blueprint building and to provide that full view, we will need to have clearly stated goals and focus. This “cornerstone” of the blueprint process is just that.

PHP Best Practices: Creating a Blueprint for PHP Applications

What is the one true path to creating a successful PHP application? Does it exist? Does everyone know what it is? What dangers should I avoid? What works, what doesn’t? Is there a guide that will lead me down this path?
You may find the answer to these questions if you scour the net, know what you are looking for, and know who is right and who is wrong, or proven and unproven if you want to look at it another way. You may also find a web of entanglement mixing old and new information with many different versions of PHP and related products. You may also come up empty handed with no clear picture to be your guide. We can do better.