*/
private static $selfInstance = NULL;
+ /**
+ * Cached configuration entry 'developer_mode_enabled'
+ */
+ private static $developerModeEnabled = false;
+
/**
* Array with all valid but pending for loading file names (class,
* interfaces, traits must start with below prefix).
* @return void
*/
private function __construct () {
- // This is empty for now
+ // Cache config entry
+ self::$developerModeEnabled = FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('developer_mode_enabled');
}
/**
*/
public function __destruct () {
// Skip here if dev-mode
- if (FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('developer_mode_enabled')) {
+ if (self::$developerModeEnabled) {
return;
}
*/
private function initClassLoader () {
// Construct the FQFN for the cache
- if (!FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('developer_mode_enabled')) {
+ if (!self::$developerModeEnabled) {
// Init cache instances
$this->listCacheFile = new SplFileInfo(FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('local_database_path') . 'list-' . FrameworkBootstrap::getDetectedApplicationName() . '.cache');
$this->classCacheFile = new SplFileInfo(FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('local_database_path') . 'class-' . FrameworkBootstrap::getDetectedApplicationName() . '.cache');
self::$selfInstance = $this;
// Skip here if no dev-mode
- if (FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('developer_mode_enabled')) {
+ if (self::$developerModeEnabled) {
return;
}
unset($this->pendingFiles[$fileName]);
// Developer mode excludes caching (better debugging)
- if (!FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('developer_mode_enabled')) {
+ if (!self::$developerModeEnabled) {
// Reset cache
//* NOISY-DEBUG: */ printf('[%s:%d] classesCached=false' . PHP_EOL, __METHOD__, __LINE__);
$this->classesCached = false;
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
class DebugConsoleOutput extends BaseDebugOutput implements Debugger, OutputStreamer, Registerable {
+ /**
+ * Cached configuration entry 'debug_*_output_timings'
+ */
+ private $debugOutputTimings = 'N';
+
/**
* Protected constructor
*
* @return void
*/
private function __construct () {
- // Call parent constructor
+ // Call parent constructor first
parent::__construct(__CLASS__);
+
+ // Cache configuration entry
+ $this->debugOutputTimings = FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('debug_' . FrameworkBootstrap::getRequestTypeFromSystem() . '_output_timings');
}
/**
}
// Are debug times enabled?
- if (FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('debug_' . FrameworkBootstrap::getRequestTypeFromSystem() . '_output_timings') == 'Y') {
+ if ($this->debugOutputTimings == 'Y') {
// Output it first
$output = $this->getPrintableExecutionTime() . $output;
}