Yeah, the site's lame. But over the last two years of tweaking this code – adding considerable new features and interfaces – the code base has pretty much remained the same size.
All along I've been calling this an experiment. I want to see how to write "old style", structural code, with the following design criteria:
- No Classes.
- No use of global.
- No in-line HTML spread throughout the code.
- No in-line SQL query strings/calls spread throughout the code.
- No configuration data stored in the PHP files.
I have nearly achieved that in full in what I call the "Core Code". For the Admin code – especially the new "Admin Extensions" – I relax the no in-line HTML rule somewhat.
The code is split up into several "sections". By that I mean:
"All the DATA are 'here'. All the HTML is 'here'. All the SQL is 'here'."
With 'here' meaning a single location
- A directory of INI/JSON/XML files for DATA.
- A directory of HTML files for the HTML (or a single file of the HTML).
- All SQL query strings in one source file.
- The MySQL database schema in one source file.
Having all the HTML in one source file (as an array) turned out to be rather a pain to maintain – but now there are three ways to use HTML (strings and templates): in an array, in a function or in a files.
Which brings me to this aphorism:The DATA drives the code.
So finally, as the code has become stable, I can now start writing more about this code here.
Quothe the programmer. "Later more..."
- Though this code long ago abandoned SQL sh^Htuff.