PHP Core
On most of my websites, I include a few "core" files which keep a few handy functions and features to hand.
Some of them, like the "goto" function, have their own dedicated page. But if your interested, please feel free to look around at some of the other features available.
-
core -
A collection of quick, simple, functions. It also sets a couple of handy variables, like an automatically generated 'tplPageTitle'.
-
assets -
Pulls in the CSS files, creates the JS <script> tags, and other useful toys - very dependent on the 'core' file.
-
database -
A very simple database wrapper for the MySQL function calls. It performs a lazy connection to the database, and has an internal cache of the returned query resource. It is not intended to be database independent.
-
error -
Provides the 'exit_with_error' function - call this when something goes wrong. The script will die with an error message for the user... but will also send in an email to the admin, and make a note in the database.
-
debug -
When enabled, ideally only in development, it will latch onto the 'database' object, and analyse every SELECT query... the result will be shown at the bottom of the page.
Any feedback would be greatly appreciated. If you would like to use this code, please read the licence it is released under.