Suffix '_enabled' in config entries is deprecated
authorRoland Häder <roland@mxchange.org>
Thu, 18 Aug 2011 14:12:39 +0000 (14:12 +0000)
committerRoland Häder <roland@mxchange.org>
Thu, 18 Aug 2011 14:12:39 +0000 (14:12 +0000)
inc/config-global.php
inc/extensions/ext-other.php
inc/language/other_de.php
inc/modules/admin/what-cache_stats.php
inc/modules/admin/what-config_other.php
inc/stats-functions.php
inc/wrapper-functions.php
templates/de/html/admin/admin_config_admin.tpl
templates/de/html/admin/admin_config_other.tpl

index 9eba061612f226ca989476bcb4657c7876d1a724..f43e484d1ea251f2b6b3f81d9707ea878fd8952a 100644 (file)
@@ -98,8 +98,8 @@ setConfigEntry('COPY', 'Copyright &copy; 2003 - 2009, by Roland H&auml;der,<br /
 // CFG: CACHE_PATH
 setConfigEntry('CACHE_PATH', 'inc/cache/');
 
-// CFG: STATS-ENABLED (This setting is overwritten by ext-other; at least version 0.2.6)
-setConfigEntry('stats_enabled', 'N');
+// CFG: INTERNAL-STATS (This setting is overwritten by ext-other equal and prior version 0.2.7)
+setConfigEntry('internal_stats', 'N');
 
 // GLOBAL: DEBUG-TEMPLATE-CACHE
 setConfigEntry('DEBUG_TEMPLATE_CACHE', 'N');
index 7d40a4f9962a757cd14f3999af021576832d7031..2f2ae89b220760bf6f5e870eb923ddba9a3b129e 100644 (file)
@@ -41,10 +41,10 @@ if (!defined('__SECURITY')) {
 } // END - if
 
 // Version number
-setThisExtensionVersion('0.2.6');
+setThisExtensionVersion('0.2.7');
 
 // Version history array (add more with , '0.0.1' and so on)
-setExtensionVersionHistory(array('0.0.0', '0.0.1', '0.0.2', '0.0.3', '0.0.4', '0.0.5', '0.0.6', '0.0.7', '0.0.8', '0.0.9', '0.1.0', '0.1.1', '0.1.2', '0.1.3', '0.1.4', '0.1.5', '0.1.6', '0.1.7', '0.1.8', '0.1.9', '0.2.0', '0.2.1', '0.2.2', '0.2.3', '0.2.4', '0.2.5', '0.2.6'));
+setExtensionVersionHistory(array('0.0.0', '0.0.1', '0.0.2', '0.0.3', '0.0.4', '0.0.5', '0.0.6', '0.0.7', '0.0.8', '0.0.9', '0.1.0', '0.1.1', '0.1.2', '0.1.3', '0.1.4', '0.1.5', '0.1.6', '0.1.7', '0.1.8', '0.1.9', '0.2.0', '0.2.1', '0.2.2', '0.2.3', '0.2.4', '0.2.5', '0.2.6', '0.2.7'));
 
 // Keep this extension always active!
 setExtensionAlwaysActive('Y');
@@ -228,12 +228,19 @@ switch (getExtensionMode()) {
                                setExtensionUpdateNotes("Codel&auml;nge aus tables.sql rausgeholt.");
                                break;
 
-                       case '0.2.6': // SQL queries for v0.2.5
+                       case '0.2.6': // SQL queries for v0.2.6
                                addConfigAddSql('stats_enabled', "ENUM('Y','N') NOT NULL DEFAULT 'N'");
 
                                // Update notes (these will be set as task text!)
                                setExtensionUpdateNotes("Interne Statistiken sind nun abschaltbar (kann Performance bringen).");
                                break;
+
+                       case '0.2.7': // SQL queries for v0.2.7
+                               addConfigChangeSql('stats_enabled', 'internal_stats', "ENUM('Y','N') NOT NULL DEFAULT 'N'");
+
+                               // Update notes (these will be set as task text!)
+                               setExtensionUpdateNotes("Der Suffix <strong>_enabled</strong> in Konfigurationseintr&auml;gen ist deprecated und sollte nicht mehr verwendet werden. Da sonst Wrapper-Funktionsnamen wie z.B. <strong>isStatsEnabledEnabled()</strong> nach streng genommender Namenskonvention entstehen.");
+                               break;
                } // END - switch
                break;
 
index 6bb1e7e83ceb9eeaa8ed6fd1f40f174ac55cd746..99e149d5797c7b7912200583bce64b63938cac6e 100644 (file)
@@ -78,8 +78,8 @@ addMessages(array(
        'ADMIN_CONFIG_MINIMUM_AGE' => "Ab welchem Mindestalter d&uuml;rfen sich Ihre Mitglieder anmelden?",
        'ADMIN_CONFIG_SQL_TITLE' => "SQL-Einstellungen",
        'ADMIN_CONFIG_DISPLAY_DEBUG_SQLS' => "Sollen die SQL-Abfragen f&uuml;r Administratoren zu Debug-Zwecken angezeigt werden?.  Das Einschalten dieser Einstellung kann enorme Performanceverluste bedeuten.",
-       'ADMIN_CONFIG_STATS_TITLE' => "Interne Statistik Einstellungen",
-       'ADMIN_CONFIG_STATS_ENABLED' => "Sollen die internen Statistiken eingeschaltet sein? Das Abschalten dieser Statistiken kann etwas Performance bringen, ist aber f&uuml;r Performancemessungen vorraussetzend.",
+       'ADMIN_CONFIG_INTERNAL_STATS_TITLE' => "Interne Statistik Einstellungen",
+       'ADMIN_CONFIG_INTERNAL_STATS_ENABLED' => "Sollen die internen Statistiken eingeschaltet sein? Das Abschalten dieser Statistiken kann etwas Performance bringen, ist aber f&uuml;r Performancemessungen vorraussetzend.",
 ));
 
 // [EOF]
index f975bb299bcc2d1f597d3abe6d6ebdf5afd6ec4b..589d69ae2a824e2f0aaec36cc5973a5a5dec0512 100644 (file)
@@ -44,7 +44,7 @@ if ((!defined('__SECURITY')) || (!isAdmin())) {
 addYouAreHereLink('admin', __FILE__);
 
 // Activated?
-if (ifStatsAreEnabled()) {
+if (ifInternalStatsEnabled()) {
        // Prepare data for the template
        $content['db_hits']    = getStatsEntry('db_hits');
        $content['cache_hits'] = getStatsEntry('cache_hits');
index 2715e1fb2c8eb9d701b0e81686a0dcf598bef390..27e28fc05f6db1c154beded9954090bb6113dc9a 100644 (file)
@@ -78,13 +78,6 @@ if (isFormSent()) {
        $content['profile_update']   = createConfigurationTimeSelections('profile_update'       , 'YM');
        $content['profile_reupdate'] = createConfigurationTimeSelections('resend_profile_update', 'MWD');
 
-       // Prepare more Y/N selections
-       foreach (array('show_points_unconfirmed','show_timings','youre_here','member_menu','guest_menu','order_multi_page','autosend_active','send_prof_update','admin_notify','display_debug_sqls','stats_enabled') as $entry) {
-               $content[$entry . '_y'] = '';
-               $content[$entry . '_n'] = '';
-               $content[$entry . '_' . strtolower(getConfig($entry))] = ' checked="checked"';
-       } // END - foreach
-
        // Prepare more
        foreach (array('css_php_direct','css_php_file','css_php_inline','mailid_error_redirect_index','mailid_error_redirect_reject') as $entry) {
                $content[$entry] = '';
index 3b0a794d96a9dea1c49f8fe1a5e645e5ed9773c7..343a7c510c7284794fb4176ccb5230a0a2a7abc9 100644 (file)
@@ -43,7 +43,7 @@ if (!defined('__SECURITY')) {
 // Init stats system
 function initStatsSystem () {
        // Is stats cache loaded?
-       if ((!isset($GLOBALS['stats_loaded'])) && (ifStatsAreEnabled())) {
+       if ((!isset($GLOBALS['stats_loaded'])) && (ifInternalStatsEnabled())) {
                // Init statistics array
                $GLOBALS['stats'] = array();
 
@@ -64,7 +64,9 @@ function isStatsEntrySet ($entry) {
 // Increments a statistics entry
 function incrementStatsEntry ($entry, $amount=1) {
        // Do we have stats enabled?
-       if (!ifStatsAreEnabled()) return;
+       if (!ifInternalStatsEnabled()) {
+               return;
+       } // END - if
 
        // Is it there?
        if (isStatsEntrySet($entry)) {
@@ -174,7 +176,7 @@ function writeStatsTable () {
 // Filter for flushing statistics
 function FILTER_FLUSH_STATS () {
        // Now do we have stats?
-       if ((isset($GLOBALS['stats'])) && (!isInstallationPhase()) && (ifStatsAreEnabled())) {
+       if ((isset($GLOBALS['stats'])) && (!isInstallationPhase()) && (ifInternalStatsEnabled())) {
                // Write statistics to temporary table
                writeStatsTable();
        } // END - if
index 24a2f340955ed5fdf4eaafd8729ea828cbed4461..1c3e2b60d1f61690bbc7f7a8ab7dda538c804c8a 100644 (file)
@@ -1523,11 +1523,11 @@ function isWhatTitleEnabled () {
 }
 
 // Checks wether stats are enabled
-function ifStatsAreEnabled () {
+function ifInternalStatsEnabled () {
        // Do we have cache?
        if (!isset($GLOBALS[__FUNCTION__])) {
                // Then determine it
-               $GLOBALS[__FUNCTION__] = (getConfig('stats_enabled') == 'Y');
+               $GLOBALS[__FUNCTION__] = (getConfig('internal_stats') == 'Y');
        } // END - if
 
        // Return cached value
index 0e0c9b2a22d39696c5e3f3111922e0bbe63df574..ad1fda779cc93ebfb889ac1aab7be49265e09cf7 100644 (file)
@@ -30,7 +30,7 @@
                        {--ADMIN_CONFIG_ADMIN_MENU_JAVASCRIPT_ENABLED--}
                </td>
                <td class="bottom" align="center" colspan="2">
-                       {%template,ConfigurationYesNoSelectionBox=admin_menu_javascript_enabled%}
+                       {%template,ConfigurationYesNoSelectionBox=admin_menu_javascript%}
                </td>
        </tr>
        <tr>
index 23cdfef731245e50ac2c93be8e12c770311aac10..0e7fa0c3b085e8bd6a9774bf9dec99dd0a0f5dc9 100644 (file)
 
        <tr>
                <td colspan="2" align="center" class="table_header bottom">
-                       <strong>{--ADMIN_CONFIG_STATS_TITLE--}</strong>
+                       <strong>{--ADMIN_CONFIG_INTERNAL_STATS_TITLE--}</strong>
                </td>
        </tr>
 
        <tr>
                <td class="bottom" align="right">
-                       {--ADMIN_CONFIG_STATS_ENABLED--}
+                       {--ADMIN_CONFIG_INTERNAL_STATS_ENABLED--}
                </td>
                <td class="bottom" align="center">
-                       {%template,ConfigurationYesNoSelectionBox=stats_enabled%}
+                       {%template,ConfigurationYesNoSelectionBox=internal_stats%}
                </td>
        </tr>