Changeset 419


Ignore:
Timestamp:
Jul 3, 2013 3:36:59 PM (11 years ago)
Author:
anonymous
Message:

Final check for active mysql connection. Changed truncate function arg defaults.

Location:
trunk/lib
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/lib/DB.inc.php

    r418 r419  
    302302        }
    303303       
    304         // Ensure we have an active connection.
     304        // Ensure we have an active connection.
     305        // If we continue on a dead connection we might experience a "MySQL server has gone away" error.
     306        // http://dev.mysql.com/doc/refman/5.0/en/gone-away.html
    305307        if (!mysql_ping($this->dbh)) {
    306             $app->logMsg('MySQL ping failed; reconnecting
', LOG_NOTICE, __FILE__, __LINE__);
     308            $app->logMsg(sprintf('MySQL ping failed; reconnecting
 ("%s")', truncate(trim($debugqry), 150)), LOG_NOTICE, __FILE__, __LINE__);
    307309            $this->reconnect();
    308310        }
  • trunk/lib/Utilities.inc.php

    r414 r419  
    276276 * @since   29 Mar 2006 13:48:49
    277277 */
    278 function truncate($str, $len, $where='middle', $delim='…')
     278function truncate($str, $len, $where='end', $delim='
')
    279279{
    280280    if ($len <= 3 || mb_strlen($str) <= 3) {
Note: See TracChangeset for help on using the changeset viewer.