summaryrefslogtreecommitdiffstats
path: root/app/class/database.class.php (unfollow)
AgeCommit message (Collapse)AuthorFilesLines
2018-09-22database: Fix bug in function checkConfig()Malf Furious1-7/+4
Because of how this function was implemented, any failure during database instance construction is treated the same way. IE. we cannot tell the difference between 'no db config' (as is the initial default state) and a 'bad db config' (either bogus data, or the server happens to be down). Because of this, if, after the database access is initially set up, access to the db becomes unavailable or someone makes a bad edit to the dbconfig.php file, Scrott behaves as if it is being configured for the first time. This is *dangerous* behavior! (unexpected, at the least) The implication of this is that if Scrott's database access is ever incidentially interrupted, the very next visitor to the site is offered the chance to (silently) reconfigure the server to point to any database of his choosing. This patch updates the checkConfig() function to only 'soft fail' (return false) in the case where the configuration is _actually_ missing. IE. $_SCROTT['conf'] is not defined. This function will otherwise passthrough any and all exceptions which result from instanciating the database instance and will only return true if both of these steps succeed.
2017-07-06Add function database::setConfig()Malf Furious1-0/+51
2017-02-13Add function database::checkConfig()Malf Furious1-0/+17
2017-02-13Implement function database::getInstance()Malf Furious1-2/+30
2017-02-06Update database APIMalf Furious1-5/+22
The abstract functions of database have been made protected and their names prefixed with '_'. The database class has been given new static functions query() and esc(), which call the _query() and _esc() function from the database instance object. This change was made to address the use of db routines from static contexes. Calls like `database::get()->query()` which mix static and instance function access operators, can now be `database::query()`, and all singleton is abstracted away; the instance's destructor continues to close the db connection.
2017-01-14Add database classMalf Furious1-0/+58
2017-01-14Reset working directory for clean Scrott implementationMalf Furious1-73/+0
2017-01-14Partial commit of initObj function -- this class needs reworked again...Malf Furious1-0/+26
2016-10-23Add mysql classMalf Furious1-0/+1
2016-10-23Add database classMalf Furious1-0/+46