// Lower framework classes
$lowerClasses = array(
- 0 => 'exceptions', // Exceptions
- 1 => 'interfaces', // Interfaces
- 2 => 'main', // General main classes
- 3 => 'middleware' // The middleware
+ 'exceptions', // Exceptions
+ 'interfaces', // Interfaces
+ 'main', // General main classes
+ 'middleware' // The middleware
);
// Load all classes
foreach ($lowerClasses as $className) {
// Try to load the framework classes
- ClassLoader::getInstance()->scanClassPath(sprintf("inc/classes/%s/", $className));
+ ClassLoader::getInstance()->scanClassPath('inc/classes/' . $className . '/');
} // END - foreach
// Clean up the global namespace
}
/**
- * Runs a "select" statement on the database layer with given table name
+ * Runs a 'select' statement on the database layer with given table name
* and criteria. If this doesn't fail the result will be returned
*
- * @param $tableName Name of the "table" we shall query
+ * @param $tableName Name of the 'table' we shall query
* @param $criteriaInstance An instance of a Criteria class
* @return $result The result as an array
*/
$this->dbLayer->connectToDatabase();
// Get result from query
- $result = $this->dbLayer->querySelect("array", $tableName, $criteriaInstance);
+ $result = $this->dbLayer->querySelect('array', $tableName, $criteriaInstance);
// Return the result
return $result;
}
/**
- * "Inserts" a data set instance into a local file database folder
+ * 'Inserts' a data set instance into a local file database folder
*
* @param $dataSetInstance A storeable data set
* @return void
}
/**
- * "Updates" a data set instance with a database layer
+ * 'Updates' a data set instance with a database layer
*
* @param $dataSetInstance A storeable data set
* @return void
* browser or debug lines for a log file, etc. to the registered debug
* output instance.
*
- * @param $outStream Data we shall "stream" out to the world
+ * @param $outStream Data we shall 'stream' out to the world
* @return void
*/
public final function output ($outStream) {
$cfg = FrameworkConfiguration::getInstance();
// Generate FQFN for the database layer
-$INC = sprintf("%sinc/database/lib-%s.php",
+$fqfn = sprintf("%sinc/database/lib-%s.php",
$cfg->readConfig('base_path'),
$cfg->readConfig('db_type')
);
// Load the database layer include
-if ((file_exists($INC)) && (is_file($INC)) && (is_readable($INC))) {
+if ((file_exists($fqfn)) && (is_file($fqfn)) && (is_readable($fqfn))) {
// Load the layer
- require_once($INC);
+ require_once($fqfn);
} else {
// Layer is missing!
ApplicationEntryPoint::app_die(sprintf("[Main:] Database layer is missing! (%s) -> R.I.P.",
}
// Clean it up
-unset($INC);
+unset($fqfn);
// Prepare database instance
$db = DatabaseConnection::createDatabaseConnection(DebugMiddleware::getInstance(), $layerInstance);
$cfg = FrameworkConfiguration::getInstance();
// Include the class loader function
-require(sprintf("%sinc/loader/class_ClassLoader.php", $cfg->readConfig('base_path')));
+require($cfg->readConfig('base_path') . 'inc/loader/class_ClassLoader.php');
// Shall we include additional configs where you can configure some things? Then
// Load matching config
/**
* Is the devel package included?
*/
-if (is_dir(sprintf("%sdevel", $cfg->readConfig('base_path')))) {
+if (is_dir($cfg->readConfig('base_path') . "devel")) {
/**
* Load all development includes
*/
// Try to load these includes in the given order
$configAppIncludes = array(
- sprintf("class_%s", $cfg->readConfig('app_helper_class')), // The ApplicationHelper class
+ 'class_' . $cfg->readConfig('app_helper_class'), // The ApplicationHelper class
'config', // The application's own configuration
'data', // Application data
'init', // The application initializer