]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Merge from 1.0.x
authorEvan Prodromou <evan@status.net>
Thu, 8 Mar 2012 12:57:54 +0000 (06:57 -0600)
committerEvan Prodromou <evan@status.net>
Thu, 8 Mar 2012 12:57:54 +0000 (06:57 -0600)
1  2 
lib/framework.php

diff --combined lib/framework.php
index 05a8b7abda7728d8195da5167cbd34dfe4c2c4c0,e7a1829bc697065d4ad56ea0feb21609fa0934f3..8f5cdf31c648a7a1b0da12128493d9f91b165689
  
  if (!defined('STATUSNET') && !defined('LACONICA')) { exit(1); }
  
 -define('STATUSNET_BASE_VERSION', '1.0.1');
 -define('STATUSNET_LIFECYCLE', ''); // 'dev', 'alpha[0-9]+', 'beta[0-9]+', 'rc[0-9]+', 'release'
 +define('STATUSNET_BASE_VERSION', '1.1.0');
 +define('STATUSNET_LIFECYCLE', 'dev'); // 'dev', 'alpha[0-9]+', 'beta[0-9]+', 'rc[0-9]+', 'release'
  define('STATUSNET_VERSION', STATUSNET_BASE_VERSION . STATUSNET_LIFECYCLE);
  
  define('LACONICA_VERSION', STATUSNET_VERSION); // compatibility
  
 -define('STATUSNET_CODENAME', 'Get It Together');
 +define('STATUSNET_CODENAME', 'Fight for Your Right');
  
  define('AVATAR_PROFILE_SIZE', 96);
  define('AVATAR_STREAM_SIZE', 48);
@@@ -34,6 -34,7 +34,6 @@@ define('AVATAR_MINI_SIZE', 24)
  define('NOTICES_PER_PAGE', 20);
  define('PROFILES_PER_PAGE', 20);
  define('MESSAGES_PER_PAGE', 20);
 -define('GROUPS_PER_PAGE', 20);
  
  define('FOREIGN_NOTICE_SEND', 1);
  define('FOREIGN_NOTICE_RECV', 2);
@@@ -151,10 -152,28 +151,27 @@@ function PEAR_ErrorToPEAR_Exception($er
      if ($err->getCode() == DB_DATAOBJECT_ERROR_NODATA) {
          return;
      }
+     $msg      = $err->getMessage();
+     $userInfo = $err->getUserInfo();
+     // Log this; push the message up as an exception
+     common_log(LOG_ERR, "PEAR Error: $msg ($userInfo)");
+     // HACK: queue handlers get kicked by the long-query killer, and 
+     // keep the same broken connection. We die here to get a new
+     // process started.
+     if (php_sapi_name() == 'cli' && preg_match('/nativecode=2006/', $userInfo)) {
+         common_log(LOG_ERR, "Lost DB connection; dying.");
+         exit(100);
+     }
      if ($err->getCode()) {
 -        throw new PEAR_Exception($msg, $err, $err->getCode());
 -    } else {
 -        throw new PEAR_Exception($msg, $err);
 +        throw new PEAR_Exception($err->getMessage(), $err->getCode());
      }
 +    throw new PEAR_Exception($err->getMessage());
  }
  
  PEAR::setErrorHandling(PEAR_ERROR_CALLBACK, 'PEAR_ErrorToPEAR_Exception');