Debug infos with var()=%d are for length and can be decimal.
[core.git] / inc / classes / main / feature / class_FrameworkFeature.php
index dbfe168..4c16afe 100644 (file)
@@ -89,6 +89,9 @@ class FrameworkFeature extends BaseFrameworkSystem {
         * @return      $isAvailable    Whether the given feature is available
         */
        public static function isFeatureAvailable ($featureName) {
+               // Debug message
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput(sprintf('[%s:%d]: featureName=%s - CALLED!', __METHOD__, __LINE__, $featureName));
+
                // Is the cache set?
                if (!isset(self::$enabledFeatures[$featureName]['is_available'])) {
                        // Default is not available
@@ -98,12 +101,16 @@ class FrameworkFeature extends BaseFrameworkSystem {
                        // Is the feature enabled?
                        if (!self::isFeatureEnabled($featureName)) {
                                // Then it can't be available
+                               self::createDebugInstance(__CLASS__)->debugOutput(sprintf('[%s:%d]: Feature "%s"is not enabled.', __METHOD__, __LINE__, $featureName));
                                return FALSE;
                        } // END - if
 
                        // Create config key (for feature class lookup)
                        $configKey = sprintf('feature_%s_class', $featureName);
 
+                       // Debug message
+                       //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput(sprintf('[%s:%d]: configKey=%s', __METHOD__, __LINE__, $configKey));
+
                        // Now try to get the instance
                        try {
                                // Try to get an instance
@@ -113,10 +120,13 @@ class FrameworkFeature extends BaseFrameworkSystem {
                                self::$enabledFeatures[$featureName]['is_available'] = self::$enabledFeatures[$featureName]['instance']->isFeatureAvailable();
                        } catch (NoClassException $e) {
                                // Feature class not found
-                               self::createDebugInstance(__CLASS__)->debugOutput(sprintf('[%s:%d]: Feature %s not available due to missing feature class. Disabling feature ...', __METHOD__, __LINE__, $featureName));
+                               self::createDebugInstance(__CLASS__)->debugOutput(sprintf('[%s:%d]: Feature "%s"is not available due to missing feature class. Disabling feature ...', __METHOD__, __LINE__, $featureName));
                        }
                } // END - if
 
+               // Debug message
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput(sprintf('[%s:%d]: featureName=%s,isAvailable=%d - EXIT!', __METHOD__, __LINE__, $featureName, intval(self::$enabledFeatures[$featureName]['is_available'])));
+
                // Return "cached" status
                return self::$enabledFeatures[$featureName]['is_available'];
        }