* @param $code Integer code to encode in hex
* @return $hexCode The exception code in hex-decimal format
*/
- public final function getHexCode ($code = null) {
+ public final function getHexCode ($code = NULL) {
// Get the decimal code
if (is_null($code)) $code = $this->getCode();
* @param $key Optional key, if none provided, a random key will be generated
* @return $encrypted Encrypted string
*/
- function encryptString ($str, $key = null);
+ function encryptString ($str, $key = NULL);
/**
* Decrypt the string with fixed salt
* @param $key Optional key, if none provided, a random key will be generated
* @return $encrypted Encrypted string
*/
- function encryptStream ($str, $key = null);
+ function encryptStream ($str, $key = NULL);
/**
* Decrypt the string with fixed salt
* @return void
* @throws XmlParserException If an XML error was found
*/
- function renderXmlContent ($content = null);
+ function renderXmlContent ($content = NULL);
/**
* Enables or disables language support
* @param $args Arguments to send to the view helper
* @return mixed Unknown return arguments, or void
*/
- function execute (array $args = null);
+ function execute (array $args = NULL);
}
// [EOF]
/**
* The "memory cache" is simply a wrapped object array
*/
- private $dataCache = null;
+ private $dataCache = NULL;
/**
* Protected constructor
*/
public final function offsetGet ($offset) {
// Default is offset not found
- $data = null;
+ $data = NULL;
// Is the offset there?
if ($this->offsetExists($offset)) {
/**
* Instance of a request class
*/
- private $requestInstance = null;
+ private $requestInstance = NULL;
/**
* Instance of a response class
*/
- private $responseInstance = null;
+ private $responseInstance = NULL;
/**
* Search criteria instance
*/
- private $searchInstance = null;
+ private $searchInstance = NULL;
/**
* Update criteria instance
*/
- private $updateInstance = null;
+ private $updateInstance = NULL;
/**
* The file I/O instance for the template loader
*/
- private $fileIoInstance = null;
+ private $fileIoInstance = NULL;
/**
* Resolver instance
*/
- private $resolverInstance = null;
+ private $resolverInstance = NULL;
/**
* Template engine instance
*/
- private $templateInstance = null;
+ private $templateInstance = NULL;
/**
* Database result instance
*/
- private $resultInstance = null;
+ private $resultInstance = NULL;
/**
* Instance for user class
*/
- private $userInstance = null;
+ private $userInstance = NULL;
/**
* A controller instance
*/
- private $controllerInstance = null;
+ private $controllerInstance = NULL;
/**
* Instance of a RNG
*/
- private $rngInstance = null;
+ private $rngInstance = NULL;
/**
* Instance of a crypto helper
*/
- private $cryptoInstance = null;
+ private $cryptoInstance = NULL;
/**
* Instance of an Iterator class
*/
- private $iteratorInstance = null;
+ private $iteratorInstance = NULL;
/**
* Instance of the list
*/
- private $listInstance = null;
+ private $listInstance = NULL;
/**
* Instance of a menu
*/
- private $menuInstance = null;
+ private $menuInstance = NULL;
/**
* Instance of the image
*/
- private $imageInstance = null;
+ private $imageInstance = NULL;
/**
* Instance of the stacker
*/
- private $stackerInstance = null;
+ private $stackerInstance = NULL;
/**
* A Compressor instance
*/
- private $compressorInstance = null;
+ private $compressorInstance = NULL;
/**
* A Parseable instance
*/
- private $parserInstance = null;
+ private $parserInstance = NULL;
/**
* A ProtocolHandler instance
*/
- private $protocolInstance = null;
+ private $protocolInstance = NULL;
/**
* A database wrapper instance
*/
- private $databaseInstance = null;
+ private $databaseInstance = NULL;
/**
* A helper instance for the form
*/
- private $helperInstance = null;
+ private $helperInstance = NULL;
/**
* An instance of a Sourceable class
*/
- private $sourceInstance = null;
+ private $sourceInstance = NULL;
/**
* An instance of a InputStreamable class
*/
- private $inputStreamInstance = null;
+ private $inputStreamInstance = NULL;
/**
* An instance of a OutputStreamable class
*/
- private $outputStreamInstance = null;
+ private $outputStreamInstance = NULL;
/**
* Networkable handler instance
*/
- private $handlerInstance = null;
+ private $handlerInstance = NULL;
/**
* Visitor handler instance
*/
- private $visitorInstance = null;
+ private $visitorInstance = NULL;
/**
* The real class name
/**
* An instance of a database wrapper class
*/
- private $wrapperInstance = null;
+ private $wrapperInstance = NULL;
/**
* Thousands seperator
/**
* Setter for database instance
*
- * @param $dbInstance The instance for the database connection (forced DatabaseConnection)
+ * @param $databaseInstance The instance for the database connection (forced DatabaseConnection)
* @return void
*/
- public final function setDatabaseInstance (DatabaseConnection $dbInstance) {
- Registry::getRegistry()->addInstance('db_instance', $dbInstance);
+ public final function setDatabaseInstance (DatabaseConnection $databaseInstance) {
+ Registry::getRegistry()->addInstance('db_instance', $databaseInstance);
}
/**
* Getter for database layer
*
- * @return $dbInstance The database layer instance
+ * @return $databaseInstance The database layer instance
*/
public final function getDatabaseInstance () {
// Get instance
- $dbInstance = Registry::getRegistry()->getInstance('db_instance');
+ $databaseInstance = Registry::getRegistry()->getInstance('db_instance');
// Return instance
- return $dbInstance;
+ return $databaseInstance;
}
/**
* @throws NullPointerException If the discovered application
* instance is still null
*/
- protected function prepareTemplateInstance (ManageableApplication $applicationInstance = null) {
+ protected function prepareTemplateInstance (ManageableApplication $applicationInstance = NULL) {
// Is the application instance set?
if (is_null($applicationInstance)) {
// Get the current instance
*/
public final function getField ($fieldName) {
// Default field value
- $fieldValue = null;
+ $fieldValue = NULL;
// Get result instance
$resultInstance = $this->getResultInstance();
*/
public function addExtraFilters (Controller $controllerInstance, Requestable $requestInstance) {
// Default is no action
- $actionInstance = null;
+ $actionInstance = NULL;
// Get registry
$registryInstance = Registry::getRegistry();
*/
public static final function createBzip2Compressor () {
// Routines not found by default
- $compressorInstance = null;
+ $compressorInstance = NULL;
// Get new instance
if ((function_exists('bzcompress')) && (function_exists('bzdecompress'))) {
*/
public static final function createGzipCompressor () {
// Routines not found by default
- $compressorInstance = null;
+ $compressorInstance = NULL;
// Get new instance
if ((function_exists('gzcompress')) && (function_exists('gzuncompress'))) {
*/
public function getCriteriaElemnent ($criteria) {
// Default is not found
- $value = null;
+ $value = NULL;
// Is the criteria there?
if (isset($this->searchCriteria[$criteria])) {
/**
* An instance of this own clas
*/
- private static $selfInstance = null;
+ private static $selfInstance = NULL;
/**
* Instance of the crypto stream
*/
- private $cryptoStreamInstance = null;
+ private $cryptoStreamInstance = NULL;
/**
* Salt for hashing operations
* @param $key Optional key, if none provided, a random key will be generated
* @return $encrypted Encrypted string
*/
- public function encryptString ($str, $key = null) {
+ public function encryptString ($str, $key = NULL) {
// Encrypt the string through the stream
$encrypted = $this->cryptoStreamInstance->encryptStream($str, $key);
/**
* The limiter instance
*/
- private $limitInstance = null;
+ private $limitInstance = NULL;
/**
* Protected constructor
/**
* Cache instance
*/
- private $cacheInstance = null;
+ private $cacheInstance = NULL;
/**
* Current table name to use
// Status results
const RESULT_OKAY = 'ok';
- /**
- * Save path for "file database"
- */
- private $savePath = '';
-
/**
* The file's extension
*/
/**
* Last exception
*/
- private $lastException = null;
+ private $lastException = NULL;
/**
* Table information array
}
/**
- * Create an object of LocalFileDatabase and set the save path for local files.
- * This method also validates the given file path.
+ * Create an object of LocalFileDatabase and set the save path from
+ * configuration for local files.
*
- * @param $savePath The local file path string
- * @return $dbInstance An instance of LocalFileDatabase
+ * @return $databaseInstance An instance of LocalFileDatabase
*/
- public static final function createLocalFileDatabase ($savePath) {
+ public static final function createLocalFileDatabase () {
// Get an instance
$databaseInstance = new LocalFileDatabase();
- // Set save path and IO instance
- $databaseInstance->setSavePath($savePath);
+ // Get a new compressor channel instance
+ $compressorInstance = ObjectFactory::createObjectByConfiguredName('compressor_channel_class');
// Set the compressor channel
- $databaseInstance->setCompressorChannel(CompressorChannel::createCompressorChannel(
- $databaseInstance->getConfigInstance()->getConfigEntry('base_path').
- $databaseInstance->getConfigInstance()->getConfigEntry('compressor_base_path')
- ));
+ $databaseInstance->setCompressorChannel($compressorInstance);
// "Connect" to the database
$databaseInstance->connectToDatabase();
return $databaseInstance;
}
- /**
- * Setter for save path
- *
- * @param $savePath The local save path where we shall put our serialized classes
- * @return void
- */
- public final function setSavePath ($savePath) {
- // Set save path
- $this->savePath = (string) $savePath;
- }
-
- /**
- * Getter for save path
- *
- * @return $savePath The local save path where we shall put our serialized classes
- */
- public final function getSavePath () {
- return $this->savePath;
- }
-
/**
* Getter for last error message
*
*/
private final function resetLastError () {
$this->lastError = '';
- $this->lastException = null;
+ $this->lastException = NULL;
}
/**
*/
private function generateFqfnFromDataSet (Criteria $dataSetInstance, $rowName) {
// This is the FQFN
- $fqfn = $this->getSavePath() . $dataSetInstance->getTableName() . '/' . $rowName . '.' . $this->getFileExtension();
+ $fqfn = $this->getConfigInstance()->getConfigEntry('local_db_path') . $dataSetInstance->getTableName() . '/' . $rowName . '.' . $this->getFileExtension();
// Return it
return $fqfn;
*/
public function querySelect ($resultType, $tableName, LocalSearchCriteria $criteriaInstance) {
// The result is null by any errors
- $resultData = null;
+ $resultData = NULL;
// Create full path name
- $pathName = $this->getSavePath() . $tableName . '/';
+ $pathName = $this->getConfigInstance()->getConfigEntry('local_db_path') . $tableName . '/';
// A 'select' query is not that easy on local files, so first try to
// find the 'table' which is in fact a directory on the server
*/
public function queryUpdateDataSet (StoreableCriteria $dataSetInstance) {
// Create full path name
- $pathName = $this->getSavePath() . $dataSetInstance->getTableName() . '/';
+ $pathName = $this->getConfigInstance()->getConfigEntry('local_db_path') . $dataSetInstance->getTableName() . '/';
// Try all the requests
try {
*/
public function getPrimaryKeyOfTable ($tableName) {
// Default key is null
- $primaryKey = null;
+ $primaryKey = NULL;
// Does the table information exist?
if (isset($this->tableInfo[$tableName])) {
* @return void
* @throws XmlParserException If an XML error was found
*/
- public function renderXmlContent ($content = null) {
+ public function renderXmlContent ($content = NULL) {
// Call the inner class' method
$this->getTemplateInstance()->renderXmlContent($content);
}
/**
* Singleton instance
*/
- private static $selfInstance = null;
+ private static $selfInstance = NULL;
/**
* Protected constructor
/**
* Instance of a request class
*/
- private $requestInstance = null;
+ private $requestInstance = NULL;
/**
* Protected constructor
/**
* The decorated filter instance
*/
- private $filterInstance = null;
+ private $filterInstance = NULL;
/**
* Protected constructor
$alreadyTaken = true;
// Initialize instance
- $userInstance = null;
+ $userInstance = NULL;
// Get a registry instance
$registry = Registry::getRegistry();
$alreadyTaken = true;
// Initialize instance
- $userInstance = null;
+ $userInstance = NULL;
// Get a registry instance
$registry = Registry::getRegistry();
$alreadyTaken = true;
// Initialize instance
- $userInstance = null;
+ $userInstance = NULL;
// Get a registry instance
$registry = Registry::getRegistry();
$alreadyTaken = true;
// Initialize instance
- $userInstance = null;
+ $userInstance = NULL;
// Get a registry instance
$registry = Registry::getRegistry();
* @param $extraInstance An extra instance, just for better hash data
* @return void
*/
- protected final function initializeRandomNumberGenerator (FrameworkInterface $extraInstance = null) {
+ protected final function initializeRandomNumberGenerator (FrameworkInterface $extraInstance = NULL) {
// Get an RNG from factory
$this->setRngInstance(ObjectFactory::createObjectByConfiguredName('rng_class', array($extraInstance)));
}
* @param $extraInstance An extra instance, just for better hash data
* @return $captchaInstance An instance of this captcha class
*/
- public static final function createGraphicalCodeCaptcha (HelpableTemplate $helperInstance, FrameworkInterface $extraInstance = null) {
+ public static final function createGraphicalCodeCaptcha (HelpableTemplate $helperInstance, FrameworkInterface $extraInstance = NULL) {
// Get a new instance
$captchaInstance = new GraphicalCodeCaptcha();
/**
* Instance to the class which provides field values
*/
- private $valueInstance = null;
+ private $valueInstance = NULL;
/**
* Extra instance to the class which provides field values
*/
- private $extraInstance = null;
+ private $extraInstance = NULL;
/**
* Rendered content created by the helper class
* @return void
* @throws NullPointerException If recovery of requested value instance failed
*/
- public function prefetchValueInstance ($registryKey, $extraKey = null) {
+ public function prefetchValueInstance ($registryKey, $extraKey = NULL) {
//* DEBUG: */ $this->debugOutput('O:'.$registryKey.'/'.$extraKey);
try {
// Get the required instance
*/
public function addCaptcha () {
// Init instance
- $extraInstance = null;
+ $extraInstance = NULL;
try {
// Get last executed pre filter
* @return $helperInstance A prepared instance of this helper
* @throws NoConfigEntryException A deprecated exception at this point
*/
- public static final function createWebLinkHelper (CompileableTemplate $templateInstance, $linkName, $linkBase = null) {
+ public static final function createWebLinkHelper (CompileableTemplate $templateInstance, $linkName, $linkBase = NULL) {
// Get new instance
$helperInstance = new WebLinkHelper();
/**
* Image resource
*/
- private $imageResource = null;
+ private $imageResource = NULL;
/**
* Image name
*/
public final function saveFile ($fileName, $dataArray) {
// Try it five times
- $dirName = ''; $fileInstance = null;
+ $dirName = ''; $fileInstance = NULL;
for ($idx = 0; $idx < 5; $idx++) {
// Get a file output pointer
try {
/**
* The directory pointer
*/
- private $dirPointer = null;
+ private $dirPointer = NULL;
/**
* Protected constructor
/**
* The file pointer
*/
- private $filePointer = null;
+ private $filePointer = NULL;
/**
* Protected constructor
/**
* The file pointer
*/
- private $filePointer = null;
+ private $filePointer = NULL;
/**
* Protected constructor
/**
* The array-object for all language strings
*/
- private $langStrings = null;
+ private $langStrings = NULL;
/**
* An instance of this class
*/
- private static $thisInstance = null;
+ private static $thisInstance = NULL;
/**
* Protected constructor
*/
public final function getSubjectLine () {
// Default subject is null
- $subjectLine = null;
+ $subjectLine = NULL;
// Get template name
$templateName = $this->getTemplateName();
*/
public function useSubjectFromTemplate () {
// Set the subject line
- $this->setSubjectLine("{?subject?}");
+ $this->setSubjectLine('{?subject?}');
}
/**
/**
* The instance for the singleton design pattern
*/
- private static $consoleInstance = null;
+ private static $consoleInstance = NULL;
/**
* Protected constructor
/**
* The instance for the singleton design pattern
*/
- private static $webInstance = null;
+ private static $webInstance = NULL;
/**
* Protected constructor
/**
* Pre-registration filter chain
*/
- private $preRegistrationFilter = null;
+ private $preRegistrationFilter = NULL;
/**
* Pre-registration filter chain
*/
- private $postRegistrationFilter = null;
+ private $postRegistrationFilter = NULL;
/**
* Protected constructor
/**
* Instance of this class
*/
- private static $registryInstance = null;
+ private static $registryInstance = NULL;
/**
* Instance registry
*
* @return $entries An array with entries from this registry
*/
- public final function getEntries ($key = null) {
+ public final function getEntries ($key = NULL) {
// Default is whole array
$entries = $this->rawEntries;
*/
public function getInstance ($instanceKey) {
// By default the instance is not in registry
- $objectInstance = null;
+ $objectInstance = NULL;
// Is the instance there?
if ($this->instanceExists($instanceKey)) {
/**
* Instance of this class
*/
- private static $registryInstance = null;
+ private static $registryInstance = NULL;
/**
* Protected constructor
*/
public function getRequestElement ($element) {
// Initialize value
- $value = null;
+ $value = NULL;
// Is the element set?
if ($this->isRequestElementSet($element)) {
*/
public function getHeader ($headerName) {
// Default return value on error
- $headerValue = null;
+ $headerValue = NULL;
// Construct the name
$name = 'HTTP_' . strtolower($this->convertDashesToUnderscores($headerName));
*/
public final function readCookie ($cookieName) {
// Default is no cookie with that name found
- $cookieValue = null;
+ $cookieValue = NULL;
// Is the cookie set?
if (isset($_COOKIE[$cookieName])) {
*/
protected function loadAction () {
// Init action instance
- $actionInstance = null;
+ $actionInstance = NULL;
// Create action class name
$className = $this->getClassPrefix() . $this->convertToClassName($this->getActionName()) . 'Action';
/**
* Last successfull resolved action
*/
- private $lastActionInstance = null;
+ private $lastActionInstance = NULL;
/**
* Protected constructor
public function resolveActionByRequest (Requestable $requestInstance) {
// Init variables
$actionName = '';
- $actionInstance = null;
+ $actionInstance = NULL;
// This goes fine so let's resolve the action
$actionName = $requestInstance->getRequestElement('action');
*/
public function resolveAction () {
// Initiate the instance variable
- $actionInstance = null;
+ $actionInstance = NULL;
// Get action name
$actionName = $this->getActionName();
/**
* (Last) resolved instance
*/
- private $resolvedInstance = null;
+ private $resolvedInstance = NULL;
// Exception constants
const EXCEPTION_INVALID_COMMAND = 0x1d0;
public function resolveCommandByRequest (Requestable $requestInstance) {
// Init variables
$commandName = '';
- $commandInstance = null;
+ $commandInstance = NULL;
// This goes fine so let's resolve the command
$commandName = $requestInstance->getRequestElement('command');
*/
public function resolveCommand ($commandName) {
// Initiate the instance variable
- $commandInstance = null;
+ $commandInstance = NULL;
// Is the command empty? Then fall back to default command
if (empty($commandName)) {
*/
private function loadCommand ($commandName) {
// Init command instance
- $commandInstance = null;
+ $commandInstance = NULL;
// Create class name
$className = $this->getClassPrefix() . $this->convertToClassName($commandName) . 'Command';
/**
* Last successfull resolved command
*/
- private $lastCommandInstance = null;
+ private $lastCommandInstance = NULL;
/**
* Protected constructor
public function resolveCommandByRequest (Requestable $requestInstance) {
// Init variables
$commandName = '';
- $commandInstance = null;
+ $commandInstance = NULL;
// This goes fine so let's resolve the command
$commandName = $requestInstance->getRequestElement('page');
*/
public function resolveCommand ($commandName) {
// Initiate the instance variable
- $commandInstance = null;
+ $commandInstance = NULL;
// Is the command empty? Then fall back to default command
if (empty($commandName)) {
*/
private function loadCommand ($commandName) {
// Init command instance
- $commandInstance = null;
+ $commandInstance = NULL;
// Create class name
$className = $this->getClassPrefix() . $this->convertToClassName($commandName) . 'Command';
/**
* Last successfull resolved command
*/
- private $lastCommandInstance = null;
+ private $lastCommandInstance = NULL;
/**
* Protected constructor
public function resolveCommandByRequest (Requestable $requestInstance) {
// Init variables
$commandName = '';
- $commandInstance = null;
+ $commandInstance = NULL;
// This goes fine so let's resolve the command
$commandName = $requestInstance->getRequestElement('page');
*/
public function resolveCommand ($commandName) {
// Initiate the instance variable
- $commandInstance = null;
+ $commandInstance = NULL;
// Is the command empty? Then fall back to default command
if (empty($commandName)) {
*/
private function loadCommand ($commandName) {
// Init command instance
- $commandInstance = null;
+ $commandInstance = NULL;
// Is this class loaded?
if (!class_exists($this->getClassName())) {
$defaultController = $this->getConfigInstance()->getConfigEntry('default_' . strtolower($this->getClassPrefix()) . '_command');
// Init controller instance
- $controllerInstance = null;
+ $controllerInstance = NULL;
// Default controller
$this->setClassName($this->getClassPrefix() . 'DefaultNewsController');
/**
* Last successfull resolved controller (instance)
*/
- private $lastControllerInstance = null;
+ private $lastControllerInstance = NULL;
/**
* Protected constructor
public function resolveController () {
// Init variables
$controllerName = '';
- $controllerInstance = null;
+ $controllerInstance = NULL;
// Get the command name
$controllerName = $this->getControllerName();
/**
* Last successfull resolved controller (instance)
*/
- private $lastControllerInstance = null;
+ private $lastControllerInstance = NULL;
/**
* Protected constructor
public function resolveController () {
// Init variables
$controllerName = '';
- $controllerInstance = null;
+ $controllerInstance = NULL;
// Get the command name
$controllerName = $this->getControllerName();
/**
* Last successfull resolved controller (instance)
*/
- private $lastControllerInstance = null;
+ private $lastControllerInstance = NULL;
/**
* Protected constructor
public function resolveController () {
// Init variables
$controllerName = '';
- $controllerInstance = null;
+ $controllerInstance = NULL;
// Get the command name
$controllerName = $this->getControllerName();
/**
* Instance of the template engine
*/
- private $templateInstance = null;
+ private $templateInstance = NULL;
/**
* Fatal resolved messages from filters and so on
* @return void
* @throws ResponseHeadersAlreadySentException If headers are already sent
*/
- public function addCookie ($cookieName, $cookieValue, $encrypted = false, $expires = null) {
+ public function addCookie ($cookieName, $cookieValue, $encrypted = false, $expires = NULL) {
//* DEBUG: */ echo $cookieName.'='.$cookieValue."<br />\n";
$this->partialStub('Naturally unimplemented in console response.');
}
* @todo If the return statement is removed and setcookie() commented out,
* @todo this will send only one cookie out, the first one.
*/
- public function addCookie ($cookieName, $cookieValue, $encrypted = false, $expires = null) {
+ public function addCookie ($cookieName, $cookieValue, $encrypted = false, $expires = NULL) {
//* DEBUG: */ echo $cookieName.'='.$cookieValue."<br />\n";
// Are headers already sent?
if (headers_sent()) {
* @todo If the return statement is removed and setcookie() commented out,
* @todo this will send only one cookie out, the first one.
*/
- public function addCookie ($cookieName, $cookieValue, $encrypted = false, $expires = null) {
+ public function addCookie ($cookieName, $cookieValue, $encrypted = false, $expires = NULL) {
// Are headers already sent?
if (headers_sent()) {
// Throw an exception here
/**
* Current row
*/
- private $currentRow = null;
+ private $currentRow = NULL;
/**
* Result array
*/
public function current () {
// Default is not found
- $current = null;
+ $current = NULL;
// Does the current enty exist?
if (isset($this->resultArray['rows'][$this->currentPos])) {
* @param $extraInstance An extra instance for more salt (default: null)
* @return $rngInstance An instance of this random number generator
*/
- public static final function createRandomNumberGenerator (FrameworkInterface $extraInstance = null) {
+ public static final function createRandomNumberGenerator (FrameworkInterface $extraInstance = NULL) {
// Get a new instance
$rngInstance = new RandomNumberGenerator();
* @param $key Optional key, if none provided, a random key will be generated
* @return $encrypted Encrypted string
*/
- public function encryptStream ($str, $key = null) {
+ public function encryptStream ($str, $key = NULL) {
// Init crypto module
$iv_size = mcrypt_get_iv_size(MCRYPT_RIJNDAEL_256, MCRYPT_MODE_ECB);
$iv = mcrypt_create_iv($iv_size, MCRYPT_RAND);
* @param $key Optional key, if none provided, a random key will be generated
* @return $str The unencrypted string
*/
- public function decryptStream ($encrypted, $key = null) {
+ public function decryptStream ($encrypted, $key = NULL) {
// Init crypto module
$iv_size = mcrypt_get_iv_size(MCRYPT_RIJNDAEL_256, MCRYPT_MODE_ECB);
$iv = mcrypt_create_iv($iv_size, MCRYPT_RAND);
/**
* Loaded raw template data
*/
- private $loadedRawData = null;
+ private $loadedRawData = NULL;
/**
* Raw templates which are linked in code templates
*/
- private $rawTemplates = null;
+ private $rawTemplates = NULL;
/**
* A regular expression for variable=value pairs
* @param $stack Optional variable stack to look in
* @return $index FALSE means not found, >=0 means found on a specific index
*/
- private function getVariableIndex ($var, $stack = null) {
+ private function getVariableIndex ($var, $stack = NULL) {
// First everything is not found
$found = false;
* @param $stack Optional variable stack to look in
* @return $content Content of the variable or null if not found
*/
- protected function readVariable ($var, $stack = null) {
+ protected function readVariable ($var, $stack = NULL) {
// First everything is not found
- $content = null;
+ $content = NULL;
// If the stack is null, use the current group
if (is_null($stack)) $stack = $this->currGroup;
$$validVar = $dummy;
// Prepare all configuration variables
- $config = null;
+ $config = NULL;
if ($this->isVarStackSet('config')) {
$config = $this->getVarStack('config');
} // END - if
* @return void
* @throws XmlParserException If an XML error was found
*/
- public function renderXmlContent ($content = null) {
+ public function renderXmlContent ($content = NULL) {
// Is the content set?
if (is_null($content)) {
// Get current content
/**
* Mailer instance
*/
- private $mailerInstance = null;
+ private $mailerInstance = NULL;
/**
* Current main node
/**
* Menu instance
*/
- private $menuInstance = null;
+ private $menuInstance = NULL;
/**
* Current main node
*/
public final function getPasswordHash () {
// Default is missing password hash
- $passHash = null;
+ $passHash = NULL;
// Get a database entry
$entry = $this->getDatabaseEntry();
/**
* Real compressor instance
*/
- private $compressor = null;
+ private $compressor = NULL;
/**
* Protected constructor
}
/**
- * Create a new compressor channel based a given base directory where
- * we shall look for compressor classes
+ * Create a new compressor channel.
*
- * @param $baseDir Directory which holds our compressor classes
- * @return $cInstance A prepared instance of this class
+ * @return $compressorInstance A prepared instance of this class
*/
- public static final function createCompressorChannel ($baseDir) {
+ public static final function createCompressorChannel () {
// Get new instance
- $cInstance = new CompressorChannel();
+ $compressorInstance = new CompressorChannel();
// Is the compressor handler set?
if (
- (is_null($cInstance->getCompressor()))
- || (!is_object($cInstance->getCompressor()))
- || (!method_exists($cInstance->getCompressor(), 'compressStream'))
- || (!method_exists($cInstance->getCompressor(), 'decompressStream'))
+ (is_null($compressorInstance->getCompressor()))
+ || (!is_object($compressorInstance->getCompressor()))
+ || (!method_exists($compressorInstance->getCompressor(), 'compressStream'))
+ || (!method_exists($compressorInstance->getCompressor(), 'decompressStream'))
) {
+ // Init base directory
+ $baseDir =
+ $compressorInstance->getConfigInstance()->getConfigEntry('base_path') .
+ $compressorInstance->getConfigInstance()->getConfigEntry('compressor_base_path');
+
// Get a directory pointer
$dirPointer = FrameworkDirectoryPointer::createFrameworkDirectoryPointer($baseDir);
// Read all directories but no sub directories
- while ($dir = $dirPointer->readDirectoryExcept(array('..', '.', '.htaccess', '.svn'))) {
+ while ($directoryEntry = $dirPointer->readDirectoryExcept(array('..', '.', '.htaccess', '.svn'))) {
// Is this a class file?
- if ((substr($dir, 0, 6) == 'class_') && (substr($dir, -4, 4) == '.php')) {
+ if ((substr($directoryEntry, 0, 6) == 'class_') && (substr($directoryEntry, -4, 4) == '.php')) {
// Get the compressor's name. That's why you must name
// your files like your classes and also that's why you
// must keep on class in one file.
- $className = substr($dir, 6, -4);
+ $className = substr($directoryEntry, 6, -4);
// Get an instance from our object factory
$tempInstance = ObjectFactory::createObjectByName($className);
// Set the compressor
- $cInstance->setCompressor($tempInstance);
+ $compressorInstance->setCompressor($tempInstance);
// No more searches required because we have found a valid compressor stream
break;
// Check again if there is a compressor
if (
- (is_null($cInstance->getCompressor()))
- || (!is_object($cInstance->getCompressor()))
- || (!method_exists($cInstance->getCompressor(), 'compressStream'))
- || (!method_exists($cInstance->getCompressor(), 'decompressStream'))
+ (is_null($compressorInstance->getCompressor()))
+ || (!is_object($compressorInstance->getCompressor()))
+ || (!method_exists($compressorInstance->getCompressor(), 'compressStream'))
+ || (!method_exists($compressorInstance->getCompressor(), 'decompressStream'))
) {
// Set the null compressor handler. This should not be configureable!
- $cInstance->setCompressor(ObjectFactory::createObjectByName('NullCompressor'));
+ $compressorInstance->setCompressor(ObjectFactory::createObjectByName('NullCompressor'));
} // END - if
// Return the compressor instance
- return $cInstance;
+ return $compressorInstance;
}
/**
* @param $compressorInstance The compressor instance we shall use
* @return void
*/
- public final function setCompressor (Compressor $compressorInstance = null) {
+ public final function setCompressor (Compressor $compressorInstance = NULL) {
$this->compressor = $compressorInstance;
}
);
// The real database layer
- private $dbLayer = null;
+ private $dbLayer = NULL;
// An instance of this class
- private static $thisInstance = null;
+ private static $thisInstance = NULL;
/**
* Protected constructor
// Create new database connection layer
public static final function createDatabaseConnection (DebugMiddleware $debugInstance, DatabaseFrontendInterface $dbLayer) {
// Get instance
- $dbInstance = new DatabaseConnection();
+ $databaseInstance = new DatabaseConnection();
// Set debug output handler
- $dbInstance->setDebugInstance($debugInstance);
+ $databaseInstance->setDebugInstance($debugInstance);
// Set database layer
- $dbInstance->setDatabaseLayer($dbLayer);
+ $databaseInstance->setDatabaseLayer($dbLayer);
// Set db instance
- self::$thisInstance = $dbInstance;
+ self::$thisInstance = $databaseInstance;
// Return instance
- return $dbInstance;
+ return $databaseInstance;
}
// Get an instance of this class
/**
* The concrete output instance
*/
- private $outputInstance = null;
+ private $outputInstance = NULL;
/**
* An instance of this class
*/
- private static $thisInstance = null;
+ private static $thisInstance = NULL;
/**
* Protected constructor
/**
* The *real* file input class we shall use for reading data
*/
- private $inputStream = null;
+ private $inputStream = NULL;
/**
* The *real* file output class we shall use for reading data
*/
- private $outputStream = null;
+ private $outputStream = NULL;
/**
* An instance of this class
*/
- private static $thisInstance = null;
+ private static $thisInstance = NULL;
/**
* Protected constructor
// CFG: STACKER-CURRENT-NODE-MAX-SIZE
$cfg->setConfigEntry('stacker_current_node_max_size', 20);
+// CFG: LOCAL-FILE-DATABASE-CLASS
+$cfg->setConfigEntry('local_file_database_class', 'LocalFileDatabase');
+
+// CFG: COMPRESSOR-CHANNEL-CLASS
+$cfg->setConfigEntry('compressor_channel_class', 'CompressorChannel');
+
// [EOF]
?>
/**
* The configuration instance itself
*/
- private static $configInstance = null;
+ private static $configInstance = NULL;
// Some constants for the configuration system
const EXCEPTION_CONFIG_ENTRY_IS_EMPTY = 0x130;
*/
public function detectHttpSecured () {
// Default is null
- $https = null;
+ $https = NULL;
// Is HTTPS set?
if ($this->isHttpSecured()) {
*/
// Initialize database layer
-$databaseInstance = null;
+$databaseInstance = NULL;
// Generate FQFN for the database layer
$fqfn = FrameworkConfiguration::getInstance()->getConfigEntry('base_path') . 'inc/database/lib-' . FrameworkConfiguration::getInstance()->getConfigEntry('db_type') . '.php';
*/
// For testing purposes we use a local file database
-$databaseInstance = LocalFileDatabase::createLocalFileDatabase(
- FrameworkConfiguration::getInstance()->getConfigEntry('local_db_path')
-);
+$databaseInstance = ObjectFactory::createObjectByConfiguredName('local_file_database_class');
// [EOF]
?>
/**
* Instance of this class
*/
- private static $selfInstance = null;
+ private static $selfInstance = NULL;
/**
* Array with all classes