Debug infos with var()=%d are for length and can be decimal.
[core.git] / inc / classes / main / feature / class_FrameworkFeature.php
index 77f9431b4c71044567d3abdcb197856525f32c53..4c16afe6649066ddcd55e6ca867adf17cd793248 100644 (file)
@@ -22,7 +22,7 @@
  * You should have received a copy of the GNU General Public License
  * along with this program. If not, see <http://www.gnu.org/licenses/>.
  */
-class FrameworkFeature extends BaseFrameworkSystem implements Feature {
+class FrameworkFeature extends BaseFrameworkSystem {
        // Exception code constants
        const EXCEPTION_FEATURE_METHOD_NOT_CALLABLE = 0x400;
 
@@ -89,6 +89,9 @@ class FrameworkFeature extends BaseFrameworkSystem implements Feature {
         * @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 implements Feature {
                        // 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 implements Feature {
                                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'];
        }