There is unnecessary and redundant code in dmemcache_stats().

Also, if class_exists('Memcached') then there is no need to create menu entries for per-type statistics, since the Memcached extension does not support this.

Comments

pillarsdotnet’s picture

The attached patch:

  • Improves and simplifies the logic in dmemcache_stats() and memcache_admin_stats().
  • Skips erroneous menu entries in memcache_admin_menu() function.
  • Corrects two whitespace errors.
  • Corrects spelling error, "Memcahe" --> "Memcache"
  • Corrects grammar error, "statistic" --> "statistics"
pillarsdotnet’s picture

Status: Active » Needs review
pillarsdotnet’s picture

Fixed typo in above patch and also one "else if" --> "elseif" correction in dmemcache_object() function.

pillarsdotnet’s picture

Another redundancy removed -- no need to test for count($stats) one line before the foreach() that will skip if count = 0.

pillarsdotnet’s picture

Bump.

dalin’s picture

Most of the stuff in this patch no longer applies. The one remaining change to dmemcache.inc is perhaps no longer an improvement. The one change to memcache_admin/memcache_admin.module is actually important since it prevents fatal errors if memcache is not installed on the machine (for example if you've just copied a DB from production to local).

jeremy’s picture

Issue summary: View changes
Status: Needs review » Closed (duplicate)

Reviewing old tickets; looks like most cleanup has already happened; applying the last patch breaks functionality.