// Import framework stuff
use Org\Mxchange\CoreFramework\Bootstrap\FrameworkBootstrap;
use Org\Mxchange\CoreFramework\Compressor\Compressor;
-use Org\Mxchange\CoreFramework\Configuration\FrameworkConfiguration;
use Org\Mxchange\CoreFramework\Connection\Database\DatabaseConnection;
use Org\Mxchange\CoreFramework\Criteria\Criteria;
use Org\Mxchange\CoreFramework\Criteria\Local\LocalSearchCriteria;
use Org\Mxchange\CoreFramework\Middleware\Debug\DebugMiddleware;
use Org\Mxchange\CoreFramework\Parser\Parseable;
use Org\Mxchange\CoreFramework\Registry\GenericRegistry;
-use Org\Mxchange\CoreFramework\Registry\Register;
use Org\Mxchange\CoreFramework\Result\Database\CachedDatabaseResult;
use Org\Mxchange\CoreFramework\Result\Search\SearchableResult;
use Org\Mxchange\CoreFramework\Stacker\Stackable;
*/
private $stateInstance = NULL;
- /**
- * Registry instance (implementing Register)
- */
- private $registryInstance = NULL;
-
/**
* Call-back instance
*/
*/
private $genericArray = array();
- /**
- * Command name
- */
- private $commandName = '';
-
- /**
- * Controller name
- */
- private $controllerName = '';
-
/**
* Array with bitmasks and such for pack/unpack methods to support both
* 32-bit and 64-bit systems
// Set real class
$this->setRealClass($className);
- // Set configuration instance if no registry ...
- if (!$this instanceof Register) {
- // ... because registries doesn't need to be configured
- $this->setConfigInstance(FrameworkBootstrap::getConfigurationInstance());
- } // END - if
-
// Is the startup time set? (0 cannot be true anymore)
if (self::$startupTime == 0) {
// Then set it
return $this->updateInstance;
}
- /**
- * Setter for language instance
- *
- * @param $configInstance The configuration instance which shall
- * be FrameworkConfiguration
- * @return void
- */
- public final function setConfigInstance (FrameworkConfiguration $configInstance) {
- GenericRegistry::getRegistry()->addInstance('config', $configInstance);
- }
-
- /**
- * Getter for configuration instance
- *
- * @return $configInstance Configuration instance
- */
- public final function getConfigInstance () {
- $configInstance = GenericRegistry::getRegistry()->getInstance('config');
- return $configInstance;
- }
-
/**
* Setter for debug instance
*
return $this->outputInstance;
}
- /**
- * Setter for registry instance
- *
- * @param $registryInstance An instance of a Register class
- * @return void
- */
- protected final function setRegistryInstance (Register $registryInstance) {
- $this->registryInstance = $registryInstance;
- }
-
- /**
- * Getter for registry instance
- *
- * @return $registryInstance The debug registry instance
- */
- public final function getRegistryInstance () {
- return $this->registryInstance;
- }
-
/**
* Setter for call-back instance
*
return $this->callbackInstance;
}
- /**
- * Setter for command name
- *
- * @param $commandName Last validated command name
- * @return void
- */
- protected final function setCommandName ($commandName) {
- $this->commandName = $commandName;
- }
-
- /**
- * Getter for command name
- *
- * @return $commandName Last validated command name
- */
- protected final function getCommandName () {
- return $this->commandName;
- }
-
- /**
- * Setter for controller name
- *
- * @param $controllerName Last validated controller name
- * @return void
- */
- protected final function setControllerName ($controllerName) {
- $this->controllerName = $controllerName;
- }
-
- /**
- * Getter for controller name
- *
- * @return $controllerName Last validated controller name
- */
- protected final function getControllerName () {
- return $this->controllerName;
- }
-
/**
* Checks whether an object equals this object. You should overwrite this
* method to implement own equality checks
} // END - if
} else {
// Are debug times enabled?
- if ($this->getConfigInstance()->getConfigEntry('debug_' . FrameworkBootstrap::getRequestTypeFromSystem() . '_output_timings') == 'Y') {
+ if (FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('debug_' . FrameworkBootstrap::getRequestTypeFromSystem() . '_output_timings') == 'Y') {
// Prepent it
$message = $this->getPrintableExecutionTime() . $message;
} // END - if
$timeArray = explode(':', $dateTime[1]);
// Construct the timestamp
- $readable = sprintf($this->getConfigInstance()->getConfigEntry('german_date_time'),
+ $readable = sprintf(FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('german_date_time'),
$dateArray[0],
$dateArray[1],
$dateArray[2],
// Generate it from config and localize dependencies
switch ($this->getLanguageInstance()->getLanguageCode()) {
case 'de': // German format is a bit different to default
- $localized = number_format($value, $this->getConfigInstance()->getConfigEntry('decimals'), ',', '.');
+ $localized = number_format($value, FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('decimals'), ',', '.');
break;
default: // US, etc.
- $localized = number_format($value, $this->getConfigInstance()->getConfigEntry('decimals'), '.', ',');
+ $localized = number_format($value, FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('decimals'), '.', ',');
break;
} // END - switch
namespace Org\Mxchange\CoreFramework\Client\Http;
// Import framework stuff
+use Org\Mxchange\CoreFramework\Bootstrap\FrameworkBootstrap;
use Org\Mxchange\CoreFramework\Client\BaseClient;
use Org\Mxchange\CoreFramework\Client\Client;
// Do we have cache?
if (!isset($GLOBALS[__METHOD__])) {
// Determine it
- $GLOBALS[__METHOD__] = (($this->getConfigInstance()->getConfigEntry('proxy_host') != '') && ($this->getConfigInstance()->getConfigEntry('proxy_port') > 0));
+ $GLOBALS[__METHOD__] = ((FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('proxy_host') != '') && (FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('proxy_port') > 0));
} // END - if
// Return cache
$rawRequest .= 'Host: ' . $host . ':' . $port . self::HTTP_EOL;
// Use login data to proxy? (username at least)
- if ($this->getConfigInstance()->getConfigEntry('proxy_username') != '') {
+ if (FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('proxy_username') != '') {
// Add it as well
- $encodedAuth = base64_encode($this->getConfigInstance()->getConfigEntry('proxy_username') . ':' . $this->getConfigInstance()->getConfigEntry('proxy_password'));
+ $encodedAuth = base64_encode(FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('proxy_username') . ':' . FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('proxy_password'));
$rawRequest .= 'Proxy-Authorization: Basic ' . $encodedAuth . self::HTTP_EOL;
} // END - if
// Import framework stuff
use Org\Mxchange\CoreFramework\Action\PerformableAction;
+use Org\Mxchange\CoreFramework\Bootstrap\FrameworkBootstrap;
use Org\Mxchange\CoreFramework\Command\BaseCommand;
use Org\Mxchange\CoreFramework\Command\Commandable;
use Org\Mxchange\CoreFramework\Controller\Controller;
$applicationInstance = $registryInstance->getInstance('application');
// Default action is the one from configuration
- $this->actionName = StringUtils::convertDashesToUnderscores($applicationInstance->getAppShortName()) . '_login_' . $this->getConfigInstance()->getConfigEntry('login_default_action');
+ $this->actionName = StringUtils::convertDashesToUnderscores($applicationInstance->getAppShortName()) . '_login_' . FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('login_default_action');
// Get "action" from request
$actReq = $requestInstance->getRequestElement('action');
namespace Org\Mxchange\CoreFramework\Command\Guest;
// Import framework stuff
+use Org\Mxchange\CoreFramework\Bootstrap\FrameworkBootstrap;
use Org\Mxchange\CoreFramework\Command\BaseCommand;
use Org\Mxchange\CoreFramework\Command\Commandable;
use Org\Mxchange\CoreFramework\Controller\Controller;
$userInstance->updateDatabaseField(UserDatabaseWrapper::DB_COLUMN_CONFIRM_HASH, $hashedString);
// Re-set config entry to mailer engine
- $this->getConfigInstance()->setConfigEntry('html_template_class', $this->getConfigInstance()->getConfigEntry('mail_template_class'));
+ FrameworkBootstrap::getConfigurationInstance()->setConfigEntry('html_template_class', FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('mail_template_class'));
// Prepare the template engine
$templateInstance = $this->prepareTemplateInstance($applicationInstance);
namespace Org\Mxchange\CoreFramework\Criteria;
// Import framework stuff
+use Org\Mxchange\CoreFramework\Bootstrap\FrameworkBootstrap;
use Org\Mxchange\CoreFramework\Criteria\Search\SearchCriteria;
use Org\Mxchange\CoreFramework\Object\BaseFrameworkSystem;
use Org\Mxchange\CoreFramework\String\Utils\StringUtils;
*/
public final function addConfiguredCriteria ($criteriaKey, $configEntry, $criteriaType = 'default') {
// Add the configuration entry as a criteria
- $value = $this->getConfigInstance()->getConfigEntry($configEntry);
+ $value = FrameworkBootstrap::getConfigurationInstance()->getConfigEntry($configEntry);
$this->addCriteria($criteriaKey, $value, $criteriaType);
}
namespace Org\Mxchange\CoreFramework\Criteria\Search;
// Import framework stuff
+use Org\Mxchange\CoreFramework\Bootstrap\FrameworkBootstrap;
use Org\Mxchange\CoreFramework\Criteria\BaseCriteria;
use Org\Mxchange\CoreFramework\Criteria\Local\LocalSearchCriteria;
*/
public final function setConfiguredLimit ($configEntry) {
// Get the limit from config entry and set it
- $limit = $this->getConfigInstance()->getConfigEntry($configEntry);
+ $limit = FrameworkBootstrap::getConfigurationInstance()->getConfigEntry($configEntry);
$this->setLimit($limit);
}
namespace Org\Mxchange\CoreFramework\Helper\Crypto;
// Import framework stuff
+use Org\Mxchange\CoreFramework\Bootstrap\FrameworkBootstrap;
use Org\Mxchange\CoreFramework\Crypto\Cryptable;
use Org\Mxchange\CoreFramework\Factory\ObjectFactory;
use Org\Mxchange\CoreFramework\Object\BaseFrameworkSystem;
$randomString = $this->getRngInstance()->randomString() . $this->createUuid();
// Get config entry for salt length
- $length = $this->getConfigInstance()->getConfigEntry('salt_length');
+ $length = FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('salt_length');
// Keep only defined number of characters
$this->salt = substr(sha1($randomString), -$length, $length);
$uuid = '';
// Is the UUID extension loaded and enabled? (see pecl)
- if ($this->getConfigInstance()->getConfigEntry('extension_uuid_loaded') === true) {
+ if (FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('extension_uuid_loaded') === true) {
// Then add it as well
$uuid = uuid_create();
} // END - if
// Is the old password set?
if (!empty($oldHash)) {
// Use the salt from hash, first get length
- $length = $this->getConfigInstance()->getConfigEntry('salt_length');
+ $length = FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('salt_length');
// Then extract the X first characters from the hash as our salt
$salt = substr($oldHash, 0, $length);
//* DEBUG: */ echo "salt=".$salt."/plain=".$str."<br />\n";
if ($withFixed === true) {
// Use additional fixed salt
- $hashed = $salt . md5(sprintf($this->getConfigInstance()->getConfigEntry('hash_extra_mask'),
+ $hashed = $salt . md5(sprintf(FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('hash_extra_mask'),
$salt,
$this->getRngInstance()->getFixedSalt(),
$str
));
} else {
// Use salt+string to hash
- $hashed = $salt . md5(sprintf($this->getConfigInstance()->getConfigEntry('hash_normal_mask'),
+ $hashed = $salt . md5(sprintf(FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('hash_normal_mask'),
$salt,
$str
));
namespace Org\Mxchange\CoreFramework\Database\Backend\Lfdb;
// Import framework stuff
+use Org\Mxchange\CoreFramework\Bootstrap\FrameworkBootstrap;
use Org\Mxchange\CoreFramework\Criteria\Criteria;
use Org\Mxchange\CoreFramework\Criteria\Local\LocalSearchCriteria;
use Org\Mxchange\CoreFramework\Criteria\Storing\StoreableCriteria;
*/
private function generateFileFromDataSet (Criteria $dataSetInstance, string $rowName) {
// Instanciate new file object
- $infoInstance = new SplFileInfo($this->getConfigInstance()->getConfigEntry('local_database_path') . $dataSetInstance->getTableName() . DIRECTORY_SEPARATOR . $rowName . '.' . $this->getFileExtension());
+ $infoInstance = new SplFileInfo(FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('local_database_path') . $dataSetInstance->getTableName() . DIRECTORY_SEPARATOR . $rowName . '.' . $this->getFileExtension());
// Return it
return $infoInstance;
// Then create the info file
//* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('CACHED-LFDB: Creating info table for tableName=%s ...', $tableName));
$this->createTableInfoFile($dataSetInstance);
- } elseif (($this->getConfigInstance()->getConfigEntry('db_update_primary_forced') == 'Y') && ($dataSetInstance->getPrimaryKey() != $this->tableInfo[$tableName]['primary'])) {
+ } elseif ((FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('db_update_primary_forced') == 'Y') && ($dataSetInstance->getPrimaryKey() != $this->tableInfo[$tableName]['primary'])) {
// Set the array element
//* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('CACHED-LFDB: Setting primaryKey=%s for tableName=%s ...', $dataSetInstance->getPrimaryKey(), $tableName));
$this->tableInfo[$tableName]['primary'] = $dataSetInstance->getPrimaryKey();
$resultData = NULL;
// Create full path name
- $pathName = $this->getConfigInstance()->getConfigEntry('local_database_path') . $tableName . DIRECTORY_SEPARATOR;
+ $pathName = FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('local_database_path') . $tableName . DIRECTORY_SEPARATOR;
/*
* A 'select' query is not that easy on local files, so first try to
*/
public function queryUpdateDataSet (StoreableCriteria $dataSetInstance) {
// Create full path name
- $pathName = $this->getConfigInstance()->getConfigEntry('local_database_path') . $dataSetInstance->getTableName() . DIRECTORY_SEPARATOR;
+ $pathName = FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('local_database_path') . $dataSetInstance->getTableName() . DIRECTORY_SEPARATOR;
// Try all the requests
try {
//* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('CACHED-LFDB: tableName=' . $tableName . ' - CALLED!');
// Create full path name
- $pathName = $this->getConfigInstance()->getConfigEntry('local_database_path') . $tableName . DIRECTORY_SEPARATOR;
+ $pathName = FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('local_database_path') . $tableName . DIRECTORY_SEPARATOR;
// Try all the requests
try {
*/
private final function initCacheInstance () {
// Is the cache enabled?
- if ($this->getConfigInstance()->getConfigEntry('database_cache_enabled') === true) {
+ if (FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('database_cache_enabled') === true) {
// Set the new instance
$this->cacheInstance = CacheFactory::getFactory()->createConfiguredCache();
} // END - if
$cacheKey = NULL;
// Is cache enabled?
- if ($this->getConfigInstance()->getConfigEntry('database_cache_enabled') === true) {
+ if (FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('database_cache_enabled') === true) {
// First get a key suitable for our cache and extend it with this class name
$cacheKey = $this->getCacheKeyByCriteria($dataSetInstance, $onlyKeys);
//* DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('BASE-WRAPPER: Using cache key ' . $cacheKey . ' for purging ...');
// Does this key exists in cache?
//* DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-WRAPPER: cacheKey[%s]=%s', gettype($cacheKey), $cacheKey));
- if (($this->getConfigInstance()->getConfigEntry('database_cache_enabled') === true) && ($this->cacheInstance->offsetExists($cacheKey))) {
+ if ((FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('database_cache_enabled') === true) && ($this->cacheInstance->offsetExists($cacheKey))) {
// Purge the cache
//* DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-WRAPPER: Calling this->cacheInstance->purgeOffset(%s) ...', $cacheKey));
$this->cacheInstance->purgeOffset($cacheKey);
$cacheKey = NULL;
// Is cache enabled?
- if ($this->getConfigInstance()->getConfigEntry('database_cache_enabled') === true) {
+ if (FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('database_cache_enabled') === true) {
// First get a key suitable for our cache and extend it with this class name
$cacheKey = $this->getCacheKeyByCriteria($dataSetInstance, $onlyKeys);
//* DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('BASE-WRAPPER: Using cache key ' . $cacheKey . ' for purging ...');
} // END - if
// Does this key exists in cache?
- if (($this->getConfigInstance()->getConfigEntry('database_cache_enabled') === true) && ($this->cacheInstance->offsetExists($cacheKey))) {
+ if ((FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('database_cache_enabled') === true) && ($this->cacheInstance->offsetExists($cacheKey))) {
// Purge the cache
$this->cacheInstance->purgeOffset($cacheKey);
} // END - if
$result = array();
// Is the cache enabled?
- if ($this->getConfigInstance()->getConfigEntry('database_cache_enabled') === true) {
+ if (FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('database_cache_enabled') === true) {
// First get a key suitable for our cache and extend it with this class name
$cacheKey = $this->getCacheKeyByCriteria($criteriaInstance, $onlyKeys);
} // END - if
// Does this key exists in cache?
//* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-WRAPPER: cacheKey[%s]=%s', gettype($cacheKey), $cacheKey));
- if (($this->getConfigInstance()->getConfigEntry('database_cache_enabled') === true) && ($this->cacheInstance->offsetExists($cacheKey, BaseDatabaseBackend::RESULT_INDEX_ROWS, 1))) {
+ if ((FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('database_cache_enabled') === true) && ($this->cacheInstance->offsetExists($cacheKey, BaseDatabaseBackend::RESULT_INDEX_ROWS, 1))) {
// Then use this result
//* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-WRAPPER: Cache used for cacheKey=%s', $cacheKey));
$result = $this->cacheInstance->offsetGet($cacheKey);
//* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-WRAPPER: result[]=%s', gettype($result)));
if (!is_null($result)) {
// Is cache enabled?
- if ($this->getConfigInstance()->getConfigEntry('database_cache_enabled') === true) {
+ if (FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('database_cache_enabled') === true) {
// A valid result has returned from the database layer
//* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-WRAPPER: Setting cacheKey=%s with result()=%d entries', $cacheKey, count($result)));
$this->cacheInstance->offsetSet($cacheKey, $result);
namespace Org\Mxchange\CoreFramework\Factory\Cache;
// Import framework stuff
+use Org\Mxchange\CoreFramework\Bootstrap\FrameworkBootstrap;
use Org\Mxchange\CoreFramework\Factory\BaseFactory;
use Org\Mxchange\CoreFramework\Factory\ObjectFactory;
*/
public function createConfiguredCache () {
// Read the config entry
- $cacheType = $this->getConfigInstance()->getConfigEntry('cache_class');
+ $cacheType = FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('cache_class');
// And get a new instance
$cacheInstance = ObjectFactory::createObjectByName($cacheType);
namespace Org\Mxchange\CoreFramework\Factory\News;
// Import framework stuff
+use Org\Mxchange\CoreFramework\Bootstrap\FrameworkBootstrap;
use Org\Mxchange\CoreFramework\Factory\BaseFactory;
use Org\Mxchange\CoreFramework\Factory\ObjectFactory;
use Org\Mxchange\CoreFramework\Request\Requestable;
} // END - if
// Get the news reader class name from config
- $className = $requestInstance->getConfigInstance()->getConfigEntry($configEntry);
+ $className = FrameworkBootstrap::getConfigurationInstance()->getConfigEntry($configEntry);
// Once we have that name, try to load initialize it
$newsInstance = ObjectFactory::createObjectByName($className, array($requestInstance));
namespace Org\Mxchange\CoreFramework\Filesystem\File;
// Import framework stuff
+use Org\Mxchange\CoreFramework\Bootstrap\FrameworkBootstrap;
use Org\Mxchange\CoreFramework\Factory\ObjectFactory;
use Org\Mxchange\CoreFramework\Filesystem\Block;
use Org\Mxchange\CoreFramework\Filesystem\Block\CalculatableBlock;
//* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('[%s:%d:] CALLED!', __METHOD__, __LINE__));
// Is it enabled?
- if ($this->getConfigInstance()->getConfigEntry($type . '_pre_allocate_enabled') != 'Y') {
+ if (FrameworkBootstrap::getConfigurationInstance()->getConfigEntry($type . '_pre_allocate_enabled') != 'Y') {
// Not enabled
self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('[%s:%d:] Not pre-allocating file.', __METHOD__, __LINE__));
//* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('[%s:%d:] minLengthEntry=%s', __METHOD__, __LINE__, $minLengthEntry));
// Calulcate seek position
- $seekPosition = $minLengthEntry * $this->getConfigInstance()->getConfigEntry($type . '_pre_allocate_count');
+ $seekPosition = $minLengthEntry * FrameworkBootstrap::getConfigurationInstance()->getConfigEntry($type . '_pre_allocate_count');
//* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('[%s:%d:] seekPosition=%s', __METHOD__, __LINE__, $seekPosition));
// Now simply write a NUL there. This will pre-allocate the file.
namespace Org\Mxchange\CoreFramework\Filter\User\Auth;
// Import framework stuff
+use Org\Mxchange\CoreFramework\Bootstrap\FrameworkBootstrap;
use Org\Mxchange\CoreFramework\Factory\ObjectFactory;
use Org\Mxchange\CoreFramework\Filter\BaseFilter;
use Org\Mxchange\CoreFramework\Filter\Filterable;
* @return void
*/
protected function setDefaultAuthMethod () {
- $this->authMethod = $this->getConfigInstance()->getConfigEntry('auth_method_class');
+ $this->authMethod = FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('auth_method_class');
}
/**
} // END - if
// Regular user account
- $className = $this->getConfigInstance()->getConfigEntry('user_class');
+ $className = FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('user_class');
$methodName = 'createMemberByUserName';
// Now, try to get a user or guest instance
- if ($authLogin == $this->getConfigInstance()->getConfigEntry('guest_login_user')) {
+ if ($authLogin == FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('guest_login_user')) {
// Set class
- $className = $this->getConfigInstance()->getConfigEntry('guest_class');
+ $className = FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('guest_class');
$methodName = 'createGuestByUserName';
} // END - if
namespace Org\Mxchange\CoreFramework\Filter\Captcha;
// Import framework stuff
+use Org\Mxchange\CoreFramework\Bootstrap\FrameworkBootstrap;
use Org\Mxchange\CoreFramework\Factory\ObjectFactory;
use Org\Mxchange\CoreFramework\Filter\BaseFilter;
use Org\Mxchange\CoreFramework\Filter\Filterable;
$decryptedString = ObjectFactory::createObjectByConfiguredName('crypto_class')->decryptString($encryptDecoded);
// Is it the expected length?
- if (strlen($decryptedString) != $this->getConfigInstance()->getConfigEntry('captcha_string_length')) {
+ if (strlen($decryptedString) != FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('captcha_string_length')) {
// Not found, so request is invalid
$requestInstance->requestIsValid(false);
namespace Org\Mxchange\CoreFramework\Filter\User\Username;
// Import framework stuff
+use Org\Mxchange\CoreFramework\Bootstrap\FrameworkBootstrap;
use Org\Mxchange\CoreFramework\Filter\BaseFilter;
use Org\Mxchange\CoreFramework\Filter\Filterable;
use Org\Mxchange\CoreFramework\Request\Requestable;
$userName = $requestInstance->getRequestElement('username');
// Does the user name match the guest login?
- if ($userName == $this->getConfigInstance()->getConfigEntry('guest_login_user')) {
+ if ($userName == FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('guest_login_user')) {
// Then set the password to the configured password
- $requestInstance->setRequestElement('pass1', $this->getConfigInstance()->getConfigEntry('guest_login_passwd'));
- $requestInstance->setRequestElement('pass2', $this->getConfigInstance()->getConfigEntry('guest_login_passwd'));
+ $requestInstance->setRequestElement('pass1', FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('guest_login_passwd'));
+ $requestInstance->setRequestElement('pass2', FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('guest_login_passwd'));
} // END - if
}
namespace Org\Mxchange\CoreFramework\Filter\User\Status;
// Import framework stuff
+use Org\Mxchange\CoreFramework\Bootstrap\FrameworkBootstrap;
use Org\Mxchange\CoreFramework\Database\Frontend\User\UserDatabaseWrapper;
use Org\Mxchange\CoreFramework\Filter\BaseFilter;
use Org\Mxchange\CoreFramework\Filter\Filterable;
$userInstance = GenericRegistry::getRegistry()->getInstance('user');
// Get "confirmed" status from config
- $confirmed = $this->getConfigInstance()->getConfigEntry('user_status_confirmed');
+ $confirmed = FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('user_status_confirmed');
// Update the user status to "confirmed" here
$userInstance->updateDatabaseField(UserDatabaseWrapper::DB_COLUMN_USER_STATUS, $confirmed);
namespace Org\Mxchange\CoreFramework\Filter\Validator\Email;
// Import framework stuff
+use Org\Mxchange\CoreFramework\Bootstrap\FrameworkBootstrap;
use Org\Mxchange\CoreFramework\Filter\BaseFilter;
use Org\Mxchange\CoreFramework\Filter\Chain\FilterChainException;
use Org\Mxchange\CoreFramework\Filter\Filterable;
$email = $requestInstance->getRequestElement('email');
// Is the Email set?
- if ((is_null($email)) || ($this->getConfigInstance()->getConfigEntry('register_email_unique') == 'Y')) {
+ if ((is_null($email)) || (FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('register_email_unique') == 'Y')) {
// Try it again
$email1 = $requestInstance->getRequestElement('email1');
$email2 = $requestInstance->getRequestElement('email2');
$userInstance->setEmailAddress($email);
} else {
// If this instance is created then the username *does* exist
- $userInstance = call_user_func_array(array($this->getConfigInstance()->getConfigEntry('user_class'), 'createMemberByEmail'), array($email));
+ $userInstance = call_user_func_array(array(FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('user_class'), 'createMemberByEmail'), array($email));
// Remember this user instance in our registry for later usage
$registry->addInstance('user', $userInstance);
namespace Org\Mxchange\CoreFramework\Filter\Validator\Username;
// Import framework stuff
+use Org\Mxchange\CoreFramework\Bootstrap\FrameworkBootstrap;
use Org\Mxchange\CoreFramework\Filter\BaseFilter;
use Org\Mxchange\CoreFramework\Filter\Chain\FilterChainException;
use Org\Mxchange\CoreFramework\Filter\Filterable;
// If this instance is created then the username *does* exist
try {
// Get a new instance
- $userInstance = call_user_func_array(array($this->getConfigInstance()->getConfigEntry('user_class'), 'createMemberByUsername'), array($userName));
+ $userInstance = call_user_func_array(array(FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('user_class'), 'createMemberByUsername'), array($userName));
// Remember this user instance in our registry for later usage
$registry->addInstance('user', $userInstance);
namespace Org\Mxchange\CoreFramework\Filter\Verifier\Captcha;
// Import framework stuff
+use Org\Mxchange\CoreFramework\Bootstrap\FrameworkBootstrap;
use Org\Mxchange\CoreFramework\Factory\ObjectFactory;
use Org\Mxchange\CoreFramework\Filter\BaseFilter;
use Org\Mxchange\CoreFramework\Filter\Chain\FilterChainException;
);
// Is the CAPTCHA enabled?
- if ($this->getConfigInstance()->getConfigEntry($configKey) != 'Y') {
+ if (FrameworkBootstrap::getConfigurationInstance()->getConfigEntry($configKey) != 'Y') {
// Not enabled, so don't check
return;
} // END - if
namespace Org\Mxchange\CoreFramework\Filter\Verifier\User;
// Import framework stuff
+use Org\Mxchange\CoreFramework\Bootstrap\FrameworkBootstrap;
use Org\Mxchange\CoreFramework\Filter\BaseFilter;
use Org\Mxchange\CoreFramework\Filter\Chain\FilterChainException;
use Org\Mxchange\CoreFramework\Filter\Filterable;
// If this instance is created then the username *does* exist
try {
// Get a new instance
- $userInstance = call_user_func_array(array($this->getConfigInstance()->getConfigEntry('guest_class'), 'createGuestByUsername'), array($userName));
+ $userInstance = call_user_func_array(array(FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('guest_class'), 'createGuestByUsername'), array($userName));
// Remember this user instance in our registry for later usage
$registry->addInstance('user', $userInstance);
namespace Org\Mxchange\CoreFramework\Filter\Verifier\User;
// Import framework stuff
+use Org\Mxchange\CoreFramework\Bootstrap\FrameworkBootstrap;
use Org\Mxchange\CoreFramework\Filter\BaseFilter;
use Org\Mxchange\CoreFramework\Filter\Chain\FilterChainException;
use Org\Mxchange\CoreFramework\Filter\Filterable;
// If this instance is created then the username *does* exist
try {
// Get a new instance
- $userInstance = call_user_func_array(array($this->getConfigInstance()->getConfigEntry('user_class'), 'createMemberByUsername'), array($userName));
+ $userInstance = call_user_func_array(array(FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('user_class'), 'createMemberByUsername'), array($userName));
// Remember this user instance in our registry for later usage
$registry->addInstance('user', $userInstance);
namespace Org\Mxchange\CoreFramework\Filter\Verifier\User;
// Import framework stuff
+use Org\Mxchange\CoreFramework\Bootstrap\FrameworkBootstrap;
use Org\Mxchange\CoreFramework\Filter\BaseFilter;
use Org\Mxchange\CoreFramework\Filter\Filterable;
use Org\Mxchange\CoreFramework\Registry\GenericRegistry;
$userInstance = GenericRegistry::getRegistry()->getInstance('user');
// Is the user account confirmed?
- if ((!$userInstance->isConfirmed()) && (!$userInstance->isGuest()) && ($requestInstance->getRequestElement('action') != $this->getConfigInstance()->getConfigEntry('action_status_problem'))) {
+ if ((!$userInstance->isConfirmed()) && (!$userInstance->isGuest()) && ($requestInstance->getRequestElement('action') != FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('action_status_problem'))) {
// Request is invalid!
$requestInstance->requestIsValid(false);
namespace Org\Mxchange\CoreFramework\Filter\Verifier\User;
// Import framework stuff
+use Org\Mxchange\CoreFramework\Bootstrap\FrameworkBootstrap;
use Org\Mxchange\CoreFramework\Database\Frontend\User\UserDatabaseWrapper;
use Org\Mxchange\CoreFramework\Factory\User\UserFactory;
use Org\Mxchange\CoreFramework\Filter\BaseFilter;
} // END - if
// Is the user account confirmed?
- if ($userInstance->getField(UserDatabaseWrapper::DB_COLUMN_USER_STATUS) != $this->getConfigInstance()->getConfigEntry('user_status_unconfirmed')) {
+ if ($userInstance->getField(UserDatabaseWrapper::DB_COLUMN_USER_STATUS) != FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('user_status_unconfirmed')) {
// Request is invalid!
$requestInstance->requestIsValid(false);
namespace Org\Mxchange\CoreFramework\Handler\Task;
// Import framework stuff
+use Org\Mxchange\CoreFramework\Bootstrap\FrameworkBootstrap;
use Org\Mxchange\CoreFramework\Factory\ObjectFactory;
use Org\Mxchange\CoreFramework\Handler\BaseHandler;
use Org\Mxchange\CoreFramework\Lists\Listable;
*/
public function registerTask ($taskName, Visitable $taskInstance) {
// Get interval delay
- $intervalDelay = $this->getConfigInstance()->getConfigEntry('task_' . $taskName . '_interval_delay');
- $startupDelay = $this->getConfigInstance()->getConfigEntry('task_' . $taskName . '_startup_delay');
+ $intervalDelay = FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('task_' . $taskName . '_interval_delay');
+ $startupDelay = FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('task_' . $taskName . '_startup_delay');
// If the task is 'idle_loop', a deplay of zero seconds is fine
assert($intervalDelay >= 0);
// Interval time (delay) in milliseconds before this task is executed again
'task_interval_delay' => $intervalDelay,
// How often should this task run?
- 'task_max_runs' => $this->getConfigInstance()->getConfigEntry('task_' . $taskName . '_max_runs'),
+ 'task_max_runs' => FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('task_' . $taskName . '_max_runs'),
);
// Add the entry
namespace Org\Mxchange\CoreFramework\Helper\Captcha;
// Import framework stuff
+use Org\Mxchange\CoreFramework\Bootstrap\FrameworkBootstrap;
use Org\Mxchange\CoreFramework\Factory\ObjectFactory;
use Org\Mxchange\CoreFramework\Generic\FrameworkInterface;
use Org\Mxchange\CoreFramework\Helper\Template\HelpableTemplate;
*/
public function initiateCaptcha () {
// Get total length
- $captchaLength = $this->getConfigInstance()->getConfigEntry('captcha_string_length');
+ $captchaLength = FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('captcha_string_length');
// Get max string length
- $strLength = $this->getConfigInstance()->getConfigEntry('random_string_length');
+ $strLength = FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('random_string_length');
// Calculate starting position based on random place
$start = $this->getRngInstance()->randomNumber(0, ($strLength - $captchaLength));
$captchaString = substr($base64String, $start, $captchaLength);
// Get all characters we want to replace
- $searchChars = $this->getConfigInstance()->getConfigEntry('captcha_search_chars');
+ $searchChars = FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('captcha_search_chars');
// Get fixed salt and use it as "replacement characters"
$replaceChars = $this->getRngInstance()->getExtraSalt();
namespace Org\Mxchange\CoreFramework\Helper;
// Import framework stuff
+use Org\Mxchange\CoreFramework\Bootstrap\FrameworkBootstrap;
use Org\Mxchange\CoreFramework\Helper\Template\HelpableTemplate;
use Org\Mxchange\CoreFramework\Template\CompileableTemplate;
* @return $withRegistration Whether with registration date
*/
public function ifIncludeRegistrationStamp () {
- $withRegistration = ($this->getConfigInstance()->getConfigEntry('block_shows_registration') == 'Y');
+ $withRegistration = (FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('block_shows_registration') == 'Y');
return $withRegistration;
}
namespace Org\Mxchange\CoreFramework\Helper;
// Import framework stuff
+use Org\Mxchange\CoreFramework\Bootstrap\FrameworkBootstrap;
use Org\Mxchange\CoreFramework\Database\Frontend\User\UserDatabaseWrapper;
use Org\Mxchange\CoreFramework\Factory\ObjectFactory;
use Org\Mxchange\CoreFramework\Generic\NullPointerException;
// Add HTML code
$formContent = sprintf("<form name=\"%s\" class=\"forms\" action=\"%s/%s\" method=\"%s\" target=\"%s\" id=\"%s_form\">",
$formName,
- $this->getConfigInstance()->getConfigEntry('base_url'),
- $this->getConfigInstance()->getConfigEntry('form_action'),
- $this->getConfigInstance()->getConfigEntry('form_method'),
- $this->getConfigInstance()->getConfigEntry('form_target'),
+ FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('base_url'),
+ FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('form_action'),
+ FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('form_method'),
+ FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('form_target'),
$formId
);
*/
public function addInputHiddenConfiguredField ($fieldName, $prefix) {
// Get the value from instance
- $fieldValue = $this->getConfigInstance()->getConfigEntry("{$prefix}_{$fieldName}");
+ $fieldValue = FrameworkBootstrap::getConfigurationInstance()->getConfigEntry("{$prefix}_{$fieldName}");
//* DEBUG: */ print __METHOD__.':'.$fieldName.'='.$fieldValue."<br />\n";
// Add the text field
* @return $required Whether the email address is required
*/
public function ifRegisterRequiresEmailVerification () {
- $required = ($this->getConfigInstance()->getConfigEntry('register_requires_email') == 'Y');
+ $required = (FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('register_requires_email') == 'Y');
return $required;
}
* @return $required Whether profile data shall be asked
*/
public function ifRegisterIncludesProfile () {
- $required = ($this->getConfigInstance()->getConfigEntry('register_includes_profile') == 'Y');
+ $required = (FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('register_includes_profile') == 'Y');
return $required;
}
* @return $isSecured Whether this form is secured by a CAPTCHA
*/
public function ifFormSecuredWithCaptcha () {
- $isSecured = ($this->getConfigInstance()->getConfigEntry($this->getFormName() . '_captcha_secured') == 'Y');
+ $isSecured = (FrameworkBootstrap::getConfigurationInstance()->getConfigEntry($this->getFormName() . '_captcha_secured') == 'Y');
return $isSecured;
}
* @return $required Whether personal data shall be asked
*/
public function ifRegisterIncludesPersonaData () {
- $required = ($this->getConfigInstance()->getConfigEntry('register_personal_data') == 'Y');
+ $required = (FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('register_personal_data') == 'Y');
return $required;
}
* @return $required Whether birthday shall be asked
*/
public function ifProfileIncludesBirthDay () {
- $required = ($this->getConfigInstance()->getConfigEntry('profile_includes_birthday') == 'Y');
+ $required = (FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('profile_includes_birthday') == 'Y');
return $required;
}
* @return $isUnique
*/
public function ifEmailMustBeUnique () {
- $isUnique = ($this->getConfigInstance()->getConfigEntry('register_email_unique') == 'Y');
+ $isUnique = (FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('register_email_unique') == 'Y');
return $isUnique;
}
* @return $required Whether the specified chat protocol is enabled
*/
public function ifChatEnabled ($chatProtocol) {
- $required = ($this->getConfigInstance()->getConfigEntry('chat_enabled_' . $chatProtocol) == 'Y');
+ $required = (FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('chat_enabled_' . $chatProtocol) == 'Y');
return $required;
}
* @return $isEnabled Whether the login is enabled or disabled
*/
public function ifLoginIsEnabled () {
- $isEnabled = ($this->getConfigInstance()->getConfigEntry('login_enabled') == 'Y');
+ $isEnabled = (FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('login_enabled') == 'Y');
return $isEnabled;
}
* @return $isEnabled Whether the login shall be done by username
*/
public function ifLoginWithUsername () {
- $isEnabled = ($this->getConfigInstance()->getConfigEntry('login_type') == "username");
+ $isEnabled = (FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('login_type') == "username");
return $isEnabled;
}
* @return $isEnabled Whether the login shall be done by email
*/
public function ifLoginWithEmail () {
- $isEnabled = ($this->getConfigInstance()->getConfigEntry('login_type') == "email");
+ $isEnabled = (FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('login_type') == "email");
return $isEnabled;
}
* @return $isAllowed Whether guest login is allowed
*/
public function ifGuestLoginAllowed () {
- $isAllowed = ($this->getConfigInstance()->getConfigEntry('guest_login_allowed') == 'Y');
+ $isAllowed = (FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('guest_login_allowed') == 'Y');
return $isAllowed;
}
* @return $requireConfirm Whether email change must be confirmed
*/
public function ifEmailChangeRequireConfirmation () {
- $requireConfirm = ($this->getConfigInstance()->getConfigEntry('email_change_confirmation') == 'Y');
+ $requireConfirm = (FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('email_change_confirmation') == 'Y');
return $requireConfirm;
}
* @return $emailChange Whether changing email address is allowed
*/
public function ifEmailChangeAllowed () {
- $emailChange = ($this->getConfigInstance()->getConfigEntry('email_change_allowed') == 'Y');
+ $emailChange = (FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('email_change_allowed') == 'Y');
return $emailChange;
}
* @return $isUnconfirmed Whether the user account is unconfirmed
*/
public function ifUserAccountUnconfirmed () {
- $isUnconfirmed = ($this->getValueField(UserDatabaseWrapper::DB_COLUMN_USER_STATUS) === $this->getConfigInstance()->getConfigEntry('user_status_unconfirmed'));
+ $isUnconfirmed = ($this->getValueField(UserDatabaseWrapper::DB_COLUMN_USER_STATUS) === FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('user_status_unconfirmed'));
return $isUnconfirmed;
}
* @return $isUnconfirmed Whether the user account is locked
*/
public function ifUserAccountLocked () {
- $isUnconfirmed = ($this->getValueField(UserDatabaseWrapper::DB_COLUMN_USER_STATUS) === $this->getConfigInstance()->getConfigEntry('user_status_locked'));
+ $isUnconfirmed = ($this->getValueField(UserDatabaseWrapper::DB_COLUMN_USER_STATUS) === FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('user_status_locked'));
return $isUnconfirmed;
}
* @return $isUnconfirmed Whether the user account is a guest
*/
public function ifUserAccountGuest () {
- $isUnconfirmed = ($this->getValueField(UserDatabaseWrapper::DB_COLUMN_USER_STATUS) === $this->getConfigInstance()->getConfigEntry('user_status_guest'));
+ $isUnconfirmed = ($this->getValueField(UserDatabaseWrapper::DB_COLUMN_USER_STATUS) === FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('user_status_guest'));
return $isUnconfirmed;
}
* @return $refillActive Whether the refill page is active
*/
public function ifRefillPageActive () {
- $refillActive = ($this->getConfigInstance()->getConfigEntry('refill_page_active') == 'Y');
+ $refillActive = (FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('refill_page_active') == 'Y');
return $refillActive;
}
// Determine link base from config now and 'command' request
try {
- $newLinkBase = $helperInstance->getConfigInstance()->getConfigEntry($configEntry);
+ $newLinkBase = FrameworkBootstrap::getConfigurationInstance()->getConfigEntry($configEntry);
$linkBase = $newLinkBase;
} catch (NoConfigEntryException $e) {
// Is the deprecated linkBase not set?
*/
private $key = NULL;
+ /**
+ * Registry instance (implementing Register)
+ */
+ private $registryInstance = NULL;
+
/**
* Protected constructor
*
return $iteratorInstance;
}
+ /**
+ * Setter for registry instance
+ *
+ * @param $registryInstance An instance of a Register class
+ * @return void
+ */
+ protected final function setRegistryInstance (Register $registryInstance) {
+ $this->registryInstance = $registryInstance;
+ }
+
+ /**
+ * Getter for registry instance
+ *
+ * @return $registryInstance The debug registry instance
+ */
+ protected final function getRegistryInstance () {
+ return $this->registryInstance;
+ }
+
/**
* Setter for only-registries array
*
// 2) Try to build it
$languageBasePath = sprintf('%s%s/language/',
- $langInstance->getConfigInstance()->getConfigEntry('application_base_path'),
+ FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('application_base_path'),
$applicationInstance->getAppShortName()
);
} // END - if
namespace Org\Mxchange\CoreFramework\Mailer;
// Import framework stuff
+use Org\Mxchange\CoreFramework\Bootstrap\FrameworkBootstrap;
use Org\Mxchange\CoreFramework\Generic\FrameworkInterface;
use Org\Mxchange\CoreFramework\Manager\Login\ManageableMember;
use Org\Mxchange\CoreFramework\Object\BaseFrameworkSystem;
$this->setTemplateName($templateName);
// Get configuration entry
- $templatePrefix = $this->getConfigInstance()->getConfigEntry('email_tpl_' . $templateName);
+ $templatePrefix = FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('email_tpl_' . $templateName);
// Load this email template
$this->getTemplateInstance()->loadEmailTemplate($templatePrefix . '_' . $templateName);
// If page is empty, choose default
if (empty($command)) {
// Use default page as none has been specified
- $command = $this->getConfigInstance()->getConfigEntry('default_' . GenericRegistry::getRegistry()->getInstance('application')->getAppShortName() . '_' . FrameworkBootstrap::getRequestTypeFromSystem() . '_command');
+ $command = FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('default_' . GenericRegistry::getRegistry()->getInstance('application')->getAppShortName() . '_' . FrameworkBootstrap::getRequestTypeFromSystem() . '_command');
} // END - if
// Load the menu template for this page
} // END - if
// Are debug times enabled?
- if ($this->getConfigInstance()->getConfigEntry('debug_' . FrameworkBootstrap::getRequestTypeFromSystem() . '_output_timings') == 'Y') {
+ if (FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('debug_' . FrameworkBootstrap::getRequestTypeFromSystem() . '_output_timings') == 'Y') {
// Output it first
$output = $this->getPrintableExecutionTime() . $output;
} // END - if
self::$webInstance = new WebOutput();
// Get the content type
- $contentType = self::$webInstance->getConfigInstance()->getConfigEntry('web_content_type');
+ $contentType = FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('web_content_type');
// Set the content type
if (!empty($contentType)) {
namespace Org\Mxchange\CoreFramework\User\Points;
// Import framework stuff
+use Org\Mxchange\CoreFramework\Bootstrap\FrameworkBootstrap;
use Org\Mxchange\CoreFramework\Criteria\Storing\StoreableCriteria;
use Org\Mxchange\CoreFramework\Factory\Database\Wrapper\DatabaseWrapperFactory;
use Org\Mxchange\CoreFramework\Factory\ObjectFactory;
$hasRequired = false;
// Get the required points entry
- $requiredPoints = $this->getConfigInstance()->getConfigEntry($action . '_action_points');
+ $requiredPoints = FrameworkBootstrap::getConfigurationInstance()->getConfigEntry($action . '_action_points');
// Rewind always
$this->getResultInstance()->rewind();
namespace Org\Mxchange\CoreFramework\Resolver\Action;
// Import framework stuff
+use Org\Mxchange\CoreFramework\Bootstrap\FrameworkBootstrap;
use Org\Mxchange\CoreFramework\Request\Requestable;
// Import SPL stuff
// Is the action empty? Then fall back to default action
if (empty($actionName)) {
- $actionName = $this->getConfigInstance()->getConfigEntry('default_action');
+ $actionName = FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('default_action');
} // END - if
// Check if action is valid
// Is the action empty? Then fall back to default action
if (empty($actionName)) {
- $actionName = $this->getConfigInstance()->getConfigEntry('default_action');
+ $actionName = FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('default_action');
} // END - if
// Check if action is valid
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
abstract class BaseResolver extends BaseFrameworkSystem {
+ // Exception constants
+ const EXCEPTION_INVALID_COMMAND = 0x1d0;
+ const EXCEPTION_INVALID_CONTROLLER = 0x1d1;
+ const EXCEPTION_INVALID_ACTION = 0x1d2;
+ const EXCEPTION_INVALID_STATE = 0x1d3;
+
/**
* Namespace
*/
*/
private $controllerInstance = NULL;
- // Exception constants
- const EXCEPTION_INVALID_COMMAND = 0x1d0;
- const EXCEPTION_INVALID_CONTROLLER = 0x1d1;
- const EXCEPTION_INVALID_ACTION = 0x1d2;
- const EXCEPTION_INVALID_STATE = 0x1d3;
-
/**
* Protected constructor
*
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
abstract class BaseCommandResolver extends BaseResolver {
+ /**
+ * Command name
+ */
+ private $commandName = '';
+
/**
* Protected constructor
*
parent::__construct($className);
}
+ /**
+ * Setter for command name
+ *
+ * @param $commandName Last validated command name
+ * @return void
+ */
+ protected final function setCommandName (string $commandName) {
+ $this->commandName = $commandName;
+ }
+
+ /**
+ * Getter for command name
+ *
+ * @return $commandName Last validated command name
+ */
+ protected final function getCommandName () {
+ return $this->commandName;
+ }
+
/**
* "Loads" a given command and instances it if not yet cached
*
// Is the command empty? Then fall back to default command
if (empty($commandName)) {
- $commandName = $this->getConfigInstance()->getConfigEntry('default_' . FrameworkBootstrap::getRequestTypeFromSystem() . '_command');
+ $commandName = FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('default_' . FrameworkBootstrap::getRequestTypeFromSystem() . '_command');
} // END - if
// Check if command is valid
// Is the command empty? Then fall back to default command
if (empty($commandName)) {
// Init default command
- $commandName = $this->getConfigInstance()->getConfigEntry('default_' . FrameworkBootstrap::getRequestTypeFromSystem() . '_command');
+ $commandName = FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('default_' . FrameworkBootstrap::getRequestTypeFromSystem() . '_command');
} // END - if
// Check if command is valid
namespace Org\Mxchange\CoreFramework\Resolver\Controller;
// Import framework stuff
+use Org\Mxchange\CoreFramework\Bootstrap\FrameworkBootstrap;
use Org\Mxchange\CoreFramework\Controller\Controller;
use Org\Mxchange\CoreFramework\Controller\DefaultControllerException;
use Org\Mxchange\CoreFramework\Controller\InvalidControllerException;
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
abstract class BaseControllerResolver extends BaseResolver {
+ /**
+ * Controller name
+ */
+ private $controllerName = '';
+
/**
* Protected constructor
*
parent::__construct($className);
}
+ /**
+ * Setter for controller name
+ *
+ * @param $controllerName Last validated controller name
+ * @return void
+ */
+ protected final function setControllerName (string $controllerName) {
+ $this->controllerName = $controllerName;
+ }
+
+ /**
+ * Getter for controller name
+ *
+ * @return $controllerName Last validated controller name
+ */
+ protected final function getControllerName () {
+ return $this->controllerName;
+ }
+
/**
* "Loads" a given controller and instances it if not yet cached. If the
* controller was not found one of the default controllers will be used
*/
protected function loadController ($controllerName) {
// Cache default controller
- $defaultController = $this->getConfigInstance()->getConfigEntry('default_' . strtolower($this->getClassPrefix()) . '_controller');
+ $defaultController = FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('default_' . strtolower($this->getClassPrefix()) . '_controller');
// Init controller instance
$controllerInstance = NULL;
// Get the config, this will throw an exception if there is no special controller resolver
//* DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-CONTROLLER-RESOLVER: resolverConfigEntry=%s', $resolverConfigEntry));
- $resolverClass = $this->getConfigInstance()->getConfigEntry($resolverConfigEntry);
+ $resolverClass = FrameworkBootstrap::getConfigurationInstance()->getConfigEntry($resolverConfigEntry);
// Initiate the resolver and controller
$resolverInstance = ObjectFactory::createObjectByConfiguredName(
namespace Org\Mxchange\CoreFramework\Response;
// Import framework stuff
+use Org\Mxchange\CoreFramework\Bootstrap\FrameworkBootstrap;
use Org\Mxchange\CoreFramework\Object\BaseFrameworkSystem;
use Org\Mxchange\CoreFramework\Registry\GenericRegistry;
$this->addHeader('Pragma', 'no-cache'); // HTTP/1.0
// Define the charset to be used
- //$this->addHeader('Content-type:', sprintf("text/html; charset=%s", $this->getConfigInstance()->getConfigEntry('header_charset')));
+ //$this->addHeader('Content-type:', sprintf("text/html; charset=%s", FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('header_charset')));
// Send all headers
foreach ($this->responseHeaders as $name => $value) {
);
// Get default command response
- $defaultCommand = $this->getConfigInstance()->getConfigEntry($configKey);
+ $defaultCommand = FrameworkBootstrap::getConfigurationInstance()->getConfigEntry($configKey);
// Return it
return $defaultCommand;
namespace Org\Mxchange\CoreFramework\Response;
// Import framework stuff
+use Org\Mxchange\CoreFramework\Bootstrap\FrameworkBootstrap;
use Org\Mxchange\CoreFramework\Manager\ManageableApplication;
use Org\Mxchange\CoreFramework\Registry\GenericRegistry;
use Org\Mxchange\CoreFramework\Response\Responseable;
// Get all config entries
if (is_null($expires)) {
- $expires = (time() + $this->getConfigInstance()->getConfigEntry('cookie_expire'));
+ $expires = (time() + FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('cookie_expire'));
} // END - if
- $path = $this->getConfigInstance()->getConfigEntry('cookie_path');
- $domain = $this->getConfigInstance()->getConfigEntry('cookie_domain');
+ $path = FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('cookie_path');
+ $domain = FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('cookie_domain');
setcookie($cookieName, $cookieValue, $expires);
//, $path, $domain, (isset($_SERVER['HTTPS']))
$this->getTemplateInstance()->assignApplicationData($applicationInstance);
// Get the url from config
- $url = $this->getConfigInstance()->getConfigEntry($configEntry . '_url');
+ $url = FrameworkBootstrap::getConfigurationInstance()->getConfigEntry($configEntry . '_url');
// Compile the URL
$url = $this->getTemplateInstance()->compileRawCode($url);
} // END - if
// No, then extend it with our base URL
- $url = $this->getConfigInstance()->getConfigEntry('base_url') . '/' . $url;
+ $url = FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('base_url') . '/' . $url;
} // END - if
// Add redirect header
namespace Org\Mxchange\CoreFramework\Response;
// Import framework stuff
+use Org\Mxchange\CoreFramework\Bootstrap\FrameworkBootstrap;
use Org\Mxchange\CoreFramework\Manager\ManageableApplication;
use Org\Mxchange\CoreFramework\Registry\GenericRegistry;
use Org\Mxchange\CoreFramework\Response\Responseable;
*/
public final function initTemplateEngine (ManageableApplication $applicationInstance) {
// Get config instance
- $cfg = $this->getConfigInstance();
+ $cfg = FrameworkBootstrap::getConfigurationInstance();
// Set new template engine
$cfg->setConfigEntry('html_template_class' , $cfg->getConfigEntry('image_template_class'));
// Get all config entries
if (is_null($expires)) {
- $expires = (time() + $this->getConfigInstance()->getConfigEntry('cookie_expire'));
+ $expires = (time() + FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('cookie_expire'));
} // END - if
- $path = $this->getConfigInstance()->getConfigEntry('cookie_path');
- $domain = $this->getConfigInstance()->getConfigEntry('cookie_domain');
+ $path = FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('cookie_path');
+ $domain = FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('cookie_domain');
setcookie($cookieName, $cookieValue, $expires);
//, $path, $domain, (isset($_SERVER['HTTPS']))
$this->getTemplateInstance()->assignApplicationData($applicationInstance);
// Get the url from config
- $url = $this->getConfigInstance()->getConfigEntry($configEntry . '_url');
+ $url = FrameworkBootstrap::getConfigurationInstance()->getConfigEntry($configEntry . '_url');
// Compile the URL
$url = $this->getTemplateInstance()->compileRawCode($url);
if (substr($url, 0, 1) == '/') $url = substr($url, 1);
// No, then extend it with our base URL
- $url = $this->getConfigInstance()->getConfigEntry('base_url') . '/' . $url;
+ $url = FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('base_url') . '/' . $url;
} // END - if
// Add redirect header
*/
protected function initRng ($extraInstance) {
// Get the prime number from config
- $this->prime = $this->getConfigInstance()->getConfigEntry('math_prime');
+ $this->prime = FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('math_prime');
// Calculate the extra number which is always the same unless you give
// a better prime number
$serverIp = 'cluster';
// Do we have a single server?
- if ($this->getConfigInstance()->getConfigEntry('is_single_server') == 'Y') {
+ if (FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('is_single_server') == 'Y') {
// Then use that IP for extra security
$serverIp = FrameworkBootstrap::detectServerAddress();
} // END - if
$this->extraSalt = sha1(
$this->fixedSalt . ':' .
getenv('SERVER_SOFTWARE') . ':' .
- $this->getConfigInstance()->getConfigEntry('date_key') . ':' .
- $this->getConfigInstance()->getConfigEntry('base_url')
+ FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('date_key') . ':' .
+ FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('base_url')
);
// Get config entry for max salt length
- $this->rndStrLen = $this->getConfigInstance()->getConfigEntry('rnd_str_length');
+ $this->rndStrLen = FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('rnd_str_length');
}
/**
$key = md5($this->getExtraSalt());
// Get key
- if ($this->getConfigInstance()->getConfigEntry('crypt_fixed_salt') == 'Y') {
+ if (FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('crypt_fixed_salt') == 'Y') {
$key = md5($this->getFixedSalt());
} // END - if
namespace Org\Mxchange\CoreFramework\Stacker;
// Import framework stuff
+use Org\Mxchange\CoreFramework\Bootstrap\FrameworkBootstrap;
use Org\Mxchange\CoreFramework\Object\BaseFrameworkSystem;
/**
} // END - if
// So, is the stack full?
- $isFull = (($this->getStackCount($stackerName)) == $this->getConfigInstance()->getConfigEntry('stacker_' . $stackerName . '_max_size'));
+ $isFull = (($this->getStackCount($stackerName)) == FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('stacker_' . $stackerName . '_max_size'));
// Return result
return $isFull;
namespace Org\Mxchange\CoreFramework\Task\IdleLoop;
// Import Framework stuff
+use Org\Mxchange\CoreFramework\Bootstrap\FrameworkBootstrap;
use Org\Mxchange\CoreFramework\Task\BaseTask;
use Org\Mxchange\CoreFramework\Task\Taskable;
use Org\Mxchange\CoreFramework\Visitor\Visitable;
parent::__construct(__CLASS__);
// Init idle loop time from config ("cache" it here)
- $this->idleTime = $this->getConfigInstance()->getConfigEntry('idle_loop_time');
+ $this->idleTime = FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('idle_loop_time');
}
/**
$this->loadRawTemplateData($fileInstance);
} catch (FileNotFoundException $e) {
// If we shall load a code-template we need to switch the file extension
- if (($this->getTemplateType() != $this->getConfigInstance()->getConfigEntry('html_template_type')) && (empty($extOther))) {
+ if (($this->getTemplateType() != FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('html_template_type')) && (empty($extOther))) {
// Switch over to the code-template extension and try it again
$ext = $this->getCodeTemplateExtension();
*/
public function loadHtmlTemplate (string $template) {
// Set template type
- $this->setTemplateType($this->getConfigInstance()->getConfigEntry('html_template_type'));
+ $this->setTemplateType(FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('html_template_type'));
// Load the special template
$this->loadTemplate($template);
$variableName = trim(StringUtils::convertDashesToUnderscores($variableName));
// Sweet and simple...
- //* DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('BASE-TEMPLATE: variableName=' . $variableName . ',getConfigEntry()=' . $this->getConfigInstance()->getConfigEntry($variableName));
- $this->assignVariable($variableName, $this->getConfigInstance()->getConfigEntry($variableName));
+ //* DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('BASE-TEMPLATE: variableName=' . $variableName . ',getConfigEntry()=' . FrameworkBootstrap::getConfigurationInstance()->getConfigEntry($variableName));
+ $this->assignVariable($variableName, FrameworkBootstrap::getConfigurationInstance()->getConfigEntry($variableName));
}
/**
*/
public function loadCodeTemplate (string $template) {
// Set template type
- $this->setTemplateType($this->getConfigInstance()->getConfigEntry('code_' . FrameworkBootstrap::getRequestTypeFromSystem() . '_template_type'));
+ $this->setTemplateType(FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('code_' . FrameworkBootstrap::getRequestTypeFromSystem() . '_template_type'));
// Load the special template
$this->loadTemplate($template);
*/
public function loadEmailTemplate (string $template) {
// Set template type
- $this->setTemplateType($this->getConfigInstance()->getConfigEntry('email_template_type'));
+ $this->setTemplateType(FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('email_template_type'));
// Load the special template
$this->loadTemplate($template);
//* DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('BASE-TEMPLATE: value='. $value . ',name=' . $currVariable['name'] . ',index=' . $index);
// Is it a configuration key?
- if ($this->getConfigInstance()->isConfigurationEntrySet($value)) {
+ if (FrameworkBootstrap::getConfigurationInstance()->isConfigurationEntrySet($value)) {
// The value itself is a configuration entry
$this->assignConfigVariable($value);
} else {
*/
public final function compileVariables () {
// Initialize the $content array
- $validVar = $this->getConfigInstance()->getConfigEntry('tpl_valid_var');
+ $validVar = FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('tpl_valid_var');
$dummy = array();
// Iterate through all general variables
*/
public function compileTemplate () {
// Get code type to make things shorter
- $codeType = $this->getConfigInstance()->getConfigEntry('code_' . FrameworkBootstrap::getRequestTypeFromSystem() . '_template_type');
+ $codeType = FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('code_' . FrameworkBootstrap::getRequestTypeFromSystem() . '_template_type');
// We will only work with template type "code" from configuration
if (substr($this->getTemplateType(), 0, strlen($codeType)) != $codeType) {
// Abort here
- throw new UnexpectedTemplateTypeException(array($this, $this->getTemplateType(), $this->getConfigInstance()->getConfigEntry('code_' . FrameworkBootstrap::getRequestTypeFromSystem() . '_template_type')), self::EXCEPTION_TEMPLATE_TYPE_IS_UNEXPECTED);
+ throw new UnexpectedTemplateTypeException(array($this, $this->getTemplateType(), FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('code_' . FrameworkBootstrap::getRequestTypeFromSystem() . '_template_type')), self::EXCEPTION_TEMPLATE_TYPE_IS_UNEXPECTED);
}
// Get the raw data.
namespace Org\Mxchange\CoreFramework\Template\Engine;
// Import framework stuff
+use Org\Mxchange\CoreFramework\Bootstrap\FrameworkBootstrap;
use Org\Mxchange\CoreFramework\Filesystem\InvalidDirectoryException;
use Org\Mxchange\CoreFramework\Registry\GenericRegistry;
use Org\Mxchange\CoreFramework\Template\CompileableTemplate;
$applicationInstance = GenericRegistry::getRegistry()->getInstance('application');
// Determine base path
- $templateBasePath = $templateInstance->getConfigInstance()->getConfigEntry('application_base_path') . $applicationInstance->getAppShortName(). '/';
+ $templateBasePath = FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('application_base_path') . $applicationInstance->getAppShortName(). '/';
// Is the base path valid?
if (empty($templateBasePath)) {
$templateInstance->setTemplateBasePath($templateBasePath);
// Set template extensions
- $templateInstance->setRawTemplateExtension($templateInstance->getConfigInstance()->getConfigEntry('raw_template_extension'));
- $templateInstance->setCodeTemplateExtension($templateInstance->getConfigInstance()->getConfigEntry('code_template_extension'));
+ $templateInstance->setRawTemplateExtension(FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('raw_template_extension'));
+ $templateInstance->setCodeTemplateExtension(FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('code_template_extension'));
// Absolute output path for compiled templates
$templateInstance->setCompileOutputPath(sprintf('%s%s/',
$templateBasePath,
- $templateInstance->getConfigInstance()->getConfigEntry('compile_output_path')
+ FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('compile_output_path')
));
// Return the prepared instance
namespace Org\Mxchange\CoreFramework\Template\Engine;
// Import framework stuff
+use Org\Mxchange\CoreFramework\Bootstrap\FrameworkBootstrap;
use Org\Mxchange\CoreFramework\Filesystem\InvalidDirectoryException;
use Org\Mxchange\CoreFramework\Registry\GenericRegistry;
use Org\Mxchange\CoreFramework\Template\CompileableTemplate;
$applicationInstance = GenericRegistry::getRegistry()->getInstance('application');
// Determine base path
- $templateBasePath = $templateInstance->getConfigInstance()->getConfigEntry('application_base_path') . $applicationInstance->getAppShortName(). '/';
+ $templateBasePath = FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('application_base_path') . $applicationInstance->getAppShortName(). '/';
// Is the base path valid?
if (empty($templateBasePath)) {
$templateInstance->setTemplateBasePath($templateBasePath);
// Set template extensions
- $templateInstance->setRawTemplateExtension($templateInstance->getConfigInstance()->getConfigEntry('raw_template_extension'));
- $templateInstance->setCodeTemplateExtension($templateInstance->getConfigInstance()->getConfigEntry('code_template_extension'));
+ $templateInstance->setRawTemplateExtension(FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('raw_template_extension'));
+ $templateInstance->setCodeTemplateExtension(FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('code_template_extension'));
// Absolute output path for compiled templates
$templateInstance->setCompileOutputPath(sprintf('%s%s/',
$templateBasePath,
- $templateInstance->getConfigInstance()->getConfigEntry('compile_output_path')
+ FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('compile_output_path')
));
// Return the prepared instance
namespace Org\Mxchange\CoreFramework\Template\Engine;
// Import framework stuff
+use Org\Mxchange\CoreFramework\Bootstrap\FrameworkBootstrap;
use Org\Mxchange\CoreFramework\Factory\ObjectFactory;
use Org\Mxchange\CoreFramework\Filesystem\InvalidDirectoryException;
use Org\Mxchange\CoreFramework\Parser\Xml\XmlParser;
$applicationInstance = GenericRegistry::getRegistry()->getInstance('application');
// Determine base path
- $templateBasePath = $templateInstance->getConfigInstance()->getConfigEntry('application_base_path') . $applicationInstance->getAppShortName(). '/';
+ $templateBasePath = FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('application_base_path') . $applicationInstance->getAppShortName(). '/';
// Is the base path valid?
if (empty($templateBasePath)) {
$templateInstance->setTemplateBasePath($templateBasePath);
// Set template extensions
- $templateInstance->setRawTemplateExtension($templateInstance->getConfigInstance()->getConfigEntry('raw_template_extension'));
- $templateInstance->setCodeTemplateExtension($templateInstance->getConfigInstance()->getConfigEntry('code_template_extension'));
+ $templateInstance->setRawTemplateExtension(FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('raw_template_extension'));
+ $templateInstance->setCodeTemplateExtension(FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('code_template_extension'));
// Absolute output path for compiled templates
$templateInstance->setCompileOutputPath(sprintf('%s%s/',
$templateBasePath,
- $templateInstance->getConfigInstance()->getConfigEntry('compile_output_path')
+ FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('compile_output_path')
));
// Return the prepared instance
public function getImageCacheFile () {
// Get the instance ready
$fileInstance = new SplFileInfo(sprintf('%s%s%s/%s.%s',
- $this->getConfigInstance()->getConfigEntry('root_base_path'),
+ FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('root_base_path'),
$this->getGenericBasePath(),
'images/_cache',
md5(
*/
public function loadImageTemplate ($template) {
// Set template type
- $this->setTemplateType($this->getConfigInstance()->getConfigEntry('image_template_type'));
+ $this->setTemplateType(FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('image_template_type'));
// Load the special template
$this->loadTemplate($template);
namespace Org\Mxchange\CoreFramework\Template\Engine;
// Import framework stuff
+use Org\Mxchange\CoreFramework\Bootstrap\FrameworkBootstrap;
use Org\Mxchange\CoreFramework\Filesystem\InvalidDirectoryException;
use Org\Mxchange\CoreFramework\Mailer\DeliverableMail;
use Org\Mxchange\CoreFramework\Parser\Xml\XmlParser;
$applicationInstance = GenericRegistry::getRegistry()->getInstance('application');
// Determine base path
- $templateBasePath = $templateInstance->getConfigInstance()->getConfigEntry('application_base_path') . $applicationInstance->getAppShortName(). '/';
+ $templateBasePath = FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('application_base_path') . $applicationInstance->getAppShortName(). '/';
// Is the base path valid?
if (empty($templateBasePath)) {
$templateInstance->setTemplateBasePath($templateBasePath);
// Set template extensions
- $templateInstance->setRawTemplateExtension($templateInstance->getConfigInstance()->getConfigEntry('raw_template_extension'));
- $templateInstance->setCodeTemplateExtension($templateInstance->getConfigInstance()->getConfigEntry('code_template_extension'));
+ $templateInstance->setRawTemplateExtension(FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('raw_template_extension'));
+ $templateInstance->setCodeTemplateExtension(FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('code_template_extension'));
// Absolute output path for compiled templates
$templateInstance->setCompileOutputPath(sprintf('%s%s/',
$templateBasePath,
- $templateInstance->getConfigInstance()->getConfigEntry('compile_output_path')
+ FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('compile_output_path')
));
// Return the prepared instance
namespace Org\Mxchange\CoreFramework\Template\Engine;
// Import framework stuff
+use Org\Mxchange\CoreFramework\Bootstrap\FrameworkBootstrap;
use Org\Mxchange\CoreFramework\Factory\ObjectFactory;
use Org\Mxchange\CoreFramework\Filesystem\InvalidDirectoryException;
use Org\Mxchange\CoreFramework\Menu\RenderableMenu;
$applicationInstance = GenericRegistry::getRegistry()->getInstance('application');
// Determine base path
- $templateBasePath = $templateInstance->getConfigInstance()->getConfigEntry('application_base_path') . $applicationInstance->getAppShortName(). '/';
+ $templateBasePath = FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('application_base_path') . $applicationInstance->getAppShortName(). '/';
// Is the base path valid?
if (empty($templateBasePath)) {
$templateInstance->setTemplateBasePath($templateBasePath);
// Set template extensions
- $templateInstance->setRawTemplateExtension($templateInstance->getConfigInstance()->getConfigEntry('raw_template_extension'));
- $templateInstance->setCodeTemplateExtension($templateInstance->getConfigInstance()->getConfigEntry('menu_template_extension'));
+ $templateInstance->setRawTemplateExtension(FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('raw_template_extension'));
+ $templateInstance->setCodeTemplateExtension(FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('menu_template_extension'));
// Absolute output path for compiled templates
$templateInstance->setCompileOutputPath(sprintf('%s%s/',
$templateBasePath,
- $templateInstance->getConfigInstance()->getConfigEntry('compile_output_path')
+ FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('compile_output_path')
));
// Set the menu instance
*/
public function loadMenuTemplate ($template) {
// Set template type
- $this->setTemplateType($this->getConfigInstance()->getConfigEntry('menu_template_type'));
+ $this->setTemplateType(FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('menu_template_type'));
// Load the special template
$this->loadTemplate($template);
// Get the file instance ready
$fileInstance = new SplFileInfo(sprintf('%s%smenus/_cache/%s.%s',
- $this->getConfigInstance()->getConfigEntry('application_base_path'),
+ FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('application_base_path'),
$applicationInstance->getAppShortName(),
md5(
$this->getMenuInstance()->getMenuName() . ':' .
// Do we have cache?
if (!isset($GLOBALS[__METHOD__])) {
// Determine it
- $GLOBALS[__METHOD__] = (($this->getConfigInstance()->getConfigEntry('proxy_host') != '') && ($this->getConfigInstance()->getConfigEntry('proxy_port') > 0));
+ $GLOBALS[__METHOD__] = ((FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('proxy_host') != '') && (FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('proxy_port') > 0));
} // END - if
// Return cache
$proxyTunnel .= 'Proxy-Connection: Keep-Alive' . self::HTTP_EOL;
// Use login data to proxy? (username at least!)
- if ($this->getConfigInstance()->getConfigEntry('proxy_username') != '') {
+ if (FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('proxy_username') != '') {
// Add it as well
- $encodedAuth = base64_encode($this->getConfigInstance()->getConfigEntry('proxy_username') . ':' . $this->getConfigInstance()->getConfigEntry('proxy_password'));
+ $encodedAuth = base64_encode(FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('proxy_username') . ':' . FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('proxy_password'));
$proxyTunnel .= 'Proxy-Authorization: Basic ' . $encodedAuth . self::HTTP_EOL;
} // END - if
$helperInstance = new ConsoleTools();
// Get SplFileInfo instance
- $infoInstance = new SplFileInfo($helperInstance->getConfigInstance()->getConfigEntry('hostname_file'));
+ $infoInstance = new SplFileInfo(FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('hostname_file'));
try {
// Get a file pointer
// Open connection
if ($helperInstance->isProxyUsed() === true) {
// Resolve hostname into IP address
- $ipAddress = self::resolveIpAddress($helperInstance->getConfigInstance()->getConfigEntry('proxy_host'));
+ $ipAddress = self::resolveIpAddress(FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('proxy_host'));
// Connect to host through proxy connection
- $socketResource = fsockopen($ipAddress, $helperInstance->getConfigInstance()->getConfigEntry('proxy_port'), $errorNo, $errorStr, 30);
+ $socketResource = fsockopen($ipAddress, FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('proxy_port'), $errorNo, $errorStr, 30);
} else {
// Connect to host directly
$socketResource = fsockopen('188.138.90.169', 80, $errorNo, $errorStr, 30);
// Do we use proxy?
if ($helperInstance->isProxyUsed() === true) {
// CONNECT method?
- if ($helperInstance->getConfigInstance()->getConfigEntry('proxy_connect_method') == 'Y') {
+ if (FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('proxy_connect_method') == 'Y') {
// Setup proxy tunnel
$response = $helperInstance->setupProxyTunnel('shipsimu.org', 80, $socketResource);
namespace Org\Mxchange\CoreFramework\User;
// Import framework stuff
+use Org\Mxchange\CoreFramework\Bootstrap\FrameworkBootstrap;
use Org\Mxchange\CoreFramework\Database\Frontend\User\UserDatabaseWrapper;
use Org\Mxchange\CoreFramework\Database\Updateable;
use Org\Mxchange\CoreFramework\Factory\ObjectFactory;
*/
public function isConfirmed () {
// Determine it
- $isConfirmed = ($this->getField(UserDatabaseWrapper::DB_COLUMN_USER_STATUS) == $this->getConfigInstance()->getConfigEntry('user_status_confirmed'));
+ $isConfirmed = ($this->getField(UserDatabaseWrapper::DB_COLUMN_USER_STATUS) == FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('user_status_confirmed'));
// Return it
return $isConfirmed;
*/
public function isGuest () {
// Determine it
- $isGuest = ($this->getField(UserDatabaseWrapper::DB_COLUMN_USER_STATUS) == $this->getConfigInstance()->getConfigEntry('user_status_guest'));
+ $isGuest = ($this->getField(UserDatabaseWrapper::DB_COLUMN_USER_STATUS) == FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('user_status_guest'));
// Return it
return $isGuest;
namespace Org\Mxchange\CoreFramework\User\Login;
// Import framework stuff
+use Org\Mxchange\CoreFramework\Bootstrap\FrameworkBootstrap;
use Org\Mxchange\CoreFramework\Database\Frontend\User\UserDatabaseWrapper;
use Org\Mxchange\CoreFramework\Factory\ObjectFactory;
use Org\Mxchange\CoreFramework\Manager\Login\ManageableMember;
// If there is no action use the default on
if (is_null($lastAction)) {
- $lastAction = $this->getConfigInstance()->getConfigEntry('login_default_action');
+ $lastAction = FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('login_default_action');
} // END - if
// Get a critieria instance
namespace Org\Mxchange\CoreFramework\Deprecated;
// Import framework stuff
+use Org\Mxchange\CoreFramework\Bootstrap\FrameworkBootstrap;
use Org\Mxchange\CoreFramework\Filter\Filterable;
use Org\Mxchange\CoreFramework\Generic\FrameworkException;
*/
public function __construct (Filterable $filterInstance, $code) {
// Get length
- $length = $filterInstance->getConfigInstance()->getConfigEntry('captcha_string_length');
+ $length = FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('captcha_string_length');
// Construct message
$message = sprintf('[%s:%d] Encrypt string has an invalid length. Valid: %d',
namespace Org\Mxchange\CoreFramework\Middleware\Compressor;
// Import framework stuff
+use Org\Mxchange\CoreFramework\Bootstrap\FrameworkBootstrap;
use Org\Mxchange\CoreFramework\Compressor\Compressor;
use Org\Mxchange\CoreFramework\Factory\ObjectFactory;
use Org\Mxchange\CoreFramework\Middleware\BaseMiddleware;
) {
// Init base directory
$baseDir =
- $compressorInstance->getConfigInstance()->getConfigEntry('framework_base_path') .
- $compressorInstance->getConfigInstance()->getConfigEntry('compressor_base_path');
+ FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('framework_base_path') .
+ FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('compressor_base_path');
// Get a directory pointer
$directoryInstance = ObjectFactory::createObjectByConfiguredName('directory_class', array($baseDir));
namespace Org\Mxchange\CoreFramework\Tests\Filter\Configuration\Classes;
// Import framework stuff
+use Org\Mxchange\CoreFramework\Bootstrap\FrameworkBootstrap;
use Org\Mxchange\CoreFramework\Filter\Filterable;
use Org\Mxchange\CoreFramework\Request\Requestable;
use Org\Mxchange\CoreFramework\Response\Responseable;
$failed = 0;
// Loop through all configuration keys
- foreach ($this->getConfigInstance()->getConfigurationArray() as $configKey => $configValue) {
+ foreach (FrameworkBootstrap::getConfigurationInstance()->getConfigurationArray() as $configKey => $configValue) {
// Key must end with _class
if (substr($configKey, -6, 6) != '_class') {
// Skip this