Changeset 17983

Show
Ignore:
Timestamp:
10/07/08 10:26:51 (2 months ago)
Author:
hirvinen
Message:

Removed unnecessary tests, made memcache test for connection if it is used and test for a PHP bytecode cache

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/midcom/midcom.core/midcom/exec/config-test.php

    r17893 r17983  
    1212<h1>MidCOM Configuration Test</h1> 
    1313 
    14 <p>This page test the MidCOM configuration for validity.</p> 
     14<p>This page performs a few tests on the MidCOM configuration.</p> 
    1515 
    1616<table border="1" cellspacing="0" cellpadding="3"> 
     
    101101} 
    102102 
    103 function check_for_utility ($name, $testname, $fail_code, $fail_recommendations
     103function check_for_utility ($name, $testname, $fail_code, $fail_recommendations, $ok_notice = '&nbsp;'
    104104{ 
    105105    $executable = $GLOBALS['midcom_config']["utility_{$name}"]; 
     
    114114        if ($exitcode == 0) 
    115115        { 
    116             println($testname, OK); 
     116            println($testname, OK, $ok_notice); 
    117117        } 
    118118        else 
     
    273273else 
    274274{ 
    275     println('Memcache', OK); 
    276 
    277  
    278 // dba with db[234] is recommended. 
    279  
    280 if (! function_exists('dba_open')) 
    281 
    282     println('Simple Database functions (dbm-style abstraction)', ERROR, 
    283         'The dba module with support for BerkleyDB must be available for proper operation of the caching engine.'); 
    284 
    285 else 
    286 
    287     if (! function_exists('dba_handlers')) 
    288     { 
    289         println('Simple Database functions (dbm-style abstraction)', WARNING, 
    290             'The dba module is available, but the available modules cannot be listed. Ensure that BerkleyDB is available and configure MidCOM accordingly.'); 
    291     } 
    292     else 
    293     { 
    294         $handlers = dba_handlers(); 
    295         if (   in_array('db2', $handlers) 
    296             || in_array('db3', $handlers) 
    297             || in_array('db4', $handlers)) 
    298         { 
    299             println('Simple Database functions (dbm-style abstraction)', OK); 
     275    if($GLOBALS['midcom_config']['cache_module_memcache_backend'] == '') 
     276    { 
     277        println('Memcache', WARNING, 'The PHP Memcache module is recommended for efficient MidCOM operation. It is available but is not set to be in use.'); 
     278    } 
     279    else 
     280    { 
     281        if($_MIDCOM->cache->_modules['memcache']->_cache->_memcache_operational) 
     282        { 
     283            println('Memcache', OK); 
    300284        } 
    301285        else 
    302286        { 
    303             $tmp = implode($handlers, ", "); 
    304             println('Simple Database functions (dbm-style abstraction)', WARNING, 
    305                 "The dba module is available, but the BerkleyDB handlers are not supported. They are recommeded for their stability. Available handlers: {$tmp}"); 
    306         } 
    307     } 
     287            println('Memcache', ERROR, "The PHP Memcache module is available and set to be in use, but it cannot be connected to."); 
     288        } 
     289    } 
     290
     291 
     292// bytecode cache is recommended 
     293if(ini_get("apc.enabled") == "1") 
     294
     295    println("PHP bytecode cache", OK, "APC is enabled"); 
     296
     297else if(ini_get("eaccelerator.enable") == "1") 
     298
     299    println("PHP bytecode cache", OK, "eAccelerator is enabled"); 
     300
     301else 
     302
     303    println("PHP bytecode cache", WARNING, "A PHP bytecode cache is recommended for efficient MidCOM operation"); 
    308304} 
    309305 
     
    316312else 
    317313{ 
    318     if ($i18n->get_current_charset() == 'UTF-8') 
    319     { 
    320         $overload = ini_get('mbstring.func_overload'); 
    321         if ($overload != '7') 
    322         { 
    323             println('Multi-Byte String functions', WARNING, 'The Multi-Byte String functions are available, but this is a UTF-8 site and Function overloading is disabled, this is not recommended since string operations are erronous then.'); 
    324         } 
    325         else 
    326         { 
    327             println('Multi-Byte String functions', OK); 
    328         } 
    329     } 
    330     else 
    331     { 
    332         println('Multi-Byte String functions', OK); 
    333     } 
     314    println('Multi-Byte String functions', OK); 
    334315} 
    335316 
     
    378359} 
    379360 
    380 // Date PEAR Package for Datamanager2 date type. 
    381 println_check_for_include_file('Date.php', 'PEAR Package: Date', 
    382     WARNING, 'The Date package is required to use the Date type made available by the midcom.helper.datamanager2 library.'); 
    383  
    384 // Mail and Mail_Mime PEAR packages for the Mailtemplate interface 
    385 println_check_for_include_file('Mail.php', 'PEAR Package: Mail', 
    386     WARNING, 'The Mail package is required to use the Mailtemplate system used by various components with auto-mailing support (like n.n.orders).'); 
    387 println_check_for_include_file('Mail/mime.php', 'PEAR Package: Mail_Mime', 
    388     WARNING, 'The Mail_Mime package is required to use the Mailtemplate system used by various components with auto-mailing support (like n.n.orders).'); 
    389  
    390 // HTML_Quickform for Datamanager validation support 
    391 println_check_for_include_file('HTML/QuickForm/RuleRegistry.php', 'PEAR Package: HTML_QuickForm', 
    392     WARNING, 'The HTML_QuickForm pacakge is required for the Datamanager Form Validation code. If you use more then is_empty checks you should install it.'); 
    393  
    394 // HTML_Treemenu 
    395 println_check_for_include_file('HTML/TreeMenu.php', 'PEAR Package: HTML_TreeMenu', 
    396     WARNING, 'The HTML_TreeMenu package is required for the JS TreeMenu Navigation in AIS (disabled by default). You have to install it if you want to use the new navigation.'); 
    397  
    398 check_rcs(); 
    399 // Text_Diff 
    400 println_check_for_include_file('Text/Diff.php', 'PEAR Package: Text_Diff', WARNING, 'The Text_Diff package is used by no.bergfald.rcs to show text diffs.'); 
    401  
    402 // XML_Serilizer 
    403 println_check_for_include_file('XML/Serializer.php', 'PEAR Package: XML_Serializer', WARNING, 'The xml_serializer package is used to read and write rcs diffs by no.bergfald.rcs.'); 
    404361// ImageMagick 
    405362$cmd = "{$GLOBALS['midcom_config']['utility_imagemagick_base']}identify -version"; 
     
    420377check_for_utility('tar', 'tar', WARNING, 'The tar utility is required for bulk upload processing in the image galleries, you should install it if you plan to deploy Image Galleries.'); 
    421378check_for_utility('gzip', 'gzip', WARNING, 'The gzip utility is required for bulk upload processing in the image galleries, you should install it if you plan to deploy Image Galleries.'); 
    422 check_for_utility('jpegtran', 'jpegtran', WARNING, 'The jpegtran utility is used for lossless JPEG operations, even though ImageMagick can do the same conversions, the lossless features provided by this utility are used where appropriate, so its installation is strongly recommended.'); 
     379check_for_utility('jpegtran', 'jpegtran', WARNING, 'The jpegtran utility is used for lossless JPEG operations, even though ImageMagick can do the same conversions, the lossless features provided by this utility are used where appropriate, so its installation is recommended unless it is known to cause problems.', 'The jpegtran utility is used for lossless rotations of JPEG images. If there are problems with image rotations, disabling jpegtran, which will cause ImageMagick to be used instead, probably helps.'); 
    423380 
    424381check_for_utility('diff','diff',WARNING, 'diff is needed by the versioning library‥ You can also use the pear library Text_Diff');