- added "import" for BaseMiddleware class
- changed one-line comment to doc-tag as this is propper here
Signed-off-by: Roland Häder <roland@mxchange.org>
// Import framework stuff
use CoreFramework\Factory\ObjectFactory;
// Import framework stuff
use CoreFramework\Factory\ObjectFactory;
+use CoreFramework\Middleware\BaseMiddleware;
/**
* Middleware class for selecting the right compressor channel
/**
* Middleware class for selecting the right compressor channel
// Import framework stuff
use CoreFramework\Registry\Registerable;
// Import framework stuff
use CoreFramework\Registry\Registerable;
+use CoreFramework\Middleware\BaseMiddleware;
/**
* Database selector class
/**
* Database selector class
* Array for connection data
*/
private $connectData = array(
* Array for connection data
*/
private $connectData = array(
- 'login' => '',
- 'pass' => '',
- 'dbase' => '',
- 'host' => ''
+ 'login' => '',
+ 'pass' => '',
+ 'dbase' => '',
+ 'host' => ''
- // The real database layer
+ /**
+ * The real database layer
+ */
- // An instance of this class
+ /**
+ * An instance of this class
+ */
private static $selfInstance = NULL;
/**
* Protected constructor
private static $selfInstance = NULL;
/**
* Protected constructor
*/
protected function __construct () {
// Call parent constructor
parent::__construct(__CLASS__);
}
*/
protected function __construct () {
// Call parent constructor
parent::__construct(__CLASS__);
}
- // Create new database connection layer
+ /**
+ * Creates a new database connection layer
+ *
+ * @param $debugInstance An instance of a DebugMiddleware class
+ * @param $dbLayer An instance of a DatabaseBackend class
+ */
public static final function createDatabaseConnection (DebugMiddleware $debugInstance, DatabaseBackend $dbLayer) {
// Get instance
$databaseInstance = new DatabaseConnection();
public static final function createDatabaseConnection (DebugMiddleware $debugInstance, DatabaseBackend $dbLayer) {
// Get instance
$databaseInstance = new DatabaseConnection();
return $databaseInstance;
}
return $databaseInstance;
}
- // Get an instance of this class
+ /**
+ * Getter for this class
+ *
+ * @return $selfInstance An instance of this class
+ */
public static final function getSelfInstance () {
return self::$selfInstance;
}
public static final function getSelfInstance () {
return self::$selfInstance;
}
- // Public setter for database connection
- public final function setConnectionData ($login, $pass, $dbase, $host='localhost') {
+ /**
+ * Setter for all database connection data. All these parameters may be
+ * supported by the underlaying backend.
+ *
+ * @param $login Login name to database
+ * @param $pass Passwort for above login
+ * @param $dbase Name of used database
+ * @param $host Host to connect to (default: 127.0.0.1)
+ * @return void
+ */
+ public final function setConnectionData ($login, $pass, $dbase, $host = '127.0.0.1') {
// Transfer connection data
$this->connectData['login'] = (string) $login;
$this->connectData['pass'] = (string) $pass;
// Transfer connection data
$this->connectData['login'] = (string) $login;
$this->connectData['pass'] = (string) $pass;
// Import framework stuff
use CoreFramework\Factory\ObjectFactory;
// Import framework stuff
use CoreFramework\Factory\ObjectFactory;
+use CoreFramework\Middleware\BaseMiddleware;
/**
* The middlware debug output system. A *real* or concrete output class shall
/**
* The middlware debug output system. A *real* or concrete output class shall
// Import framework stuff
use CoreFramework\Factory\ObjectFactory;
use CoreFramework\Generic\FrameworkInterface;
// Import framework stuff
use CoreFramework\Factory\ObjectFactory;
use CoreFramework\Generic\FrameworkInterface;
+use CoreFramework\Middleware\BaseMiddleware;
/**
* This is a file IO handler. It handles reading from and writing to files.
/**
* This is a file IO handler. It handles reading from and writing to files.