We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 7231
    • 4,205 Posts
    Just to give a progress report on this:

    1) I have the version check ready just need to polish it up. This one was easy wink
    Question: should I add the messages to the language file as is with the other error messages? Or just hard code them in (as they are at the moment)? Yes I know it should be done the MODx way so why even ask, but then we will need some translations.

    Here is the code as a preview, maybe a better warning message would be good (I will post the complete edited document once complete):
    // Mysql version check and strict mode check
        if ( version_compare(mysql_get_server_info(), '5.0.51', '=') ) {
        	$mysqlAlert .= "Atention: The MySQL server version is 5.0.51 ...";
        	$colorMysql = '#ff0000';
    	} else {
        	$mysqlAlert .= "Your MySQL version is: ".mysql_get_server_info()."...  ";
            $colorMysql = '#007700';
        }


    2) Strict mode is a pain. I have gone around the block with this and have had several working attempts but not easy to check since my MAMP does not allow you to change the my.cnf making it is a bit hard to determine if it is really working or only partially working. Also the session needs to die before any changes show so when I activate strict mode via a query it takes some time before the results show. shocked I will work on this some more in the morning.

    Time to walk the mutt and get some beer grin
      [font=Verdana]Shane Sponagle | [wiki] Snippet Call Anatomy | MODx Developer Blog | [nettuts] Working With a Content Management Framework: MODx

      Something is happening here, but you don't know what it is.
      Do you, Mr. Jones? - [bob dylan]
      • 3749
      • 24,544 Posts
      Quote from: dev_cw at Feb 22, 2008, 12:25 PM

      Quote from: rthrash at Feb 22, 2008, 09:34 AM

      Funny you should mention that dev_cw: http://modxcms.com/bugs/task/1018?histring=mysql%20version%20check&tasks=last

      I could look into this (is that what you are saying?) but I am not confident that I could do this since I have only recently built up the courage to look under the hood and my php skills are a bit rusty. However, the install is the one part that I have looked at more and have a bit of an understanding. The idea is to have a warning if the user is using 5.0.51 or strict mode. Well this function easily returns the version, now how to know if it is in strict mode? Maybe a query to get the server settings...humm time to hit the manuals.

      Oh, crap, did I just volunteer for this? shocked

      I haven’t tried it, but I was just looking at this earlier today:


      You can retrieve the current global or session sql_mode value with the following statements:
      SELECT @@global.sql_mode;
      SELECT @@session.sql_mode;

      Here’s more: http://dev.mysql.com/doc/refman/5.0/en/server-sql-mode.html

      Hope this helps,

      Bob
        Did I help you? Buy me a beer
        Get my Book: MODX:The Official Guide
        MODX info for everyone: http://bobsguides.com/modx.html
        My MODX Extras
        Bob's Guides is now hosted at A2 MODX Hosting