From eae48cf47d314ec85f26143fbc0ae84b09efebd4 Mon Sep 17 00:00:00 2001
From: Martin Konecny <martin.konecny@gmail.com>
Date: Thu, 6 Sep 2012 12:54:44 -0400
Subject: [PATCH 1/2] CC-4348: Prepared statements - part 4

-User.php
---
 airtime_mvc/application/models/User.php | 2 --
 1 file changed, 2 deletions(-)

diff --git a/airtime_mvc/application/models/User.php b/airtime_mvc/application/models/User.php
index fbfb84794..a1982687e 100644
--- a/airtime_mvc/application/models/User.php
+++ b/airtime_mvc/application/models/User.php
@@ -304,8 +304,6 @@ class Application_Model_User
             $sql  = $sql . " AND ".$like;
         }
 
-        echo $sql.PHP_EOL;
-        print_r($params);
         $sql = $sql ." ORDER BY login";
 
         return Application_Common_Database::prepareAndExecute($sql, $params, "all");

From acf06e289fb8645ec434d6c31a1a7a4deade7f2b Mon Sep 17 00:00:00 2001
From: Martin Konecny <martin.konecny@gmail.com>
Date: Thu, 6 Sep 2012 14:01:54 -0400
Subject: [PATCH 2/2] Try catching more errors into zendphp.log

---
 airtime_mvc/application/Bootstrap.php | 11 +--------
 airtime_mvc/public/index.php          | 32 ++++++++++++++++-----------
 2 files changed, 20 insertions(+), 23 deletions(-)

diff --git a/airtime_mvc/application/Bootstrap.php b/airtime_mvc/application/Bootstrap.php
index dc4776ee5..8666d60bf 100644
--- a/airtime_mvc/application/Bootstrap.php
+++ b/airtime_mvc/application/Bootstrap.php
@@ -1,14 +1,4 @@
 <?php
-//DateTime in PHP 5.3.0+ need a default timezone set. Set to UTC initially
-//in case Application_Model_Preference::GetTimezone fails and creates needs to create
-//a log entry. This log entry requires a call to date(), which then complains that
-//timezone isn't set. Setting a default timezone allows us to create a a graceful log
-//that getting the real timezone failed, without PHP complaining that it cannot log because
-//there is no timezone :|.
-date_default_timezone_set('UTC');
-
-require_once __DIR__."/logging/Logging.php";
-Logging::setLogPath('/var/log/airtime/zendphp.log');
 require_once __DIR__."/configs/conf.php";
 require_once __DIR__."/configs/ACL.php";
 require_once 'propel/runtime/lib/Propel.php';
@@ -37,6 +27,7 @@ Zend_Validate::setDefaultNamespaces("Zend");
 $front = Zend_Controller_Front::getInstance();
 $front->registerPlugin(new RabbitMqPlugin());
 
+
 /* The bootstrap class should only be used to initialize actions that return a view.
    Actions that return JSON will not use the bootstrap class! */
 class Bootstrap extends Zend_Application_Bootstrap_Bootstrap
diff --git a/airtime_mvc/public/index.php b/airtime_mvc/public/index.php
index 062e2aed2..78f94c489 100644
--- a/airtime_mvc/public/index.php
+++ b/airtime_mvc/public/index.php
@@ -34,19 +34,25 @@ if (file_exists('/usr/share/php/libzend-framework-php')) {
 /** Zend_Application */
 require_once 'Zend/Application.php';
 
-// Create application, bootstrap, and run
-$application = new Zend_Application(
-    APPLICATION_ENV,
-    APPLICATION_PATH . '/configs/application.ini'
-);
+date_default_timezone_set('UTC');
+require_once (APPLICATION_PATH."/logging/Logging.php");
+Logging::setLogPath('/var/log/airtime/zendphp.log');
 
-$sapi_type = php_sapi_name();
-if (substr($sapi_type, 0, 3) == 'cli') {
-    set_include_path(APPLICATION_PATH . PATH_SEPARATOR . get_include_path());
-    require_once("Bootstrap.php");
-} else {
-    $application->bootstrap()
-            ->run();
+// Create application, bootstrap, and run
+try {
+    $application = new Zend_Application(
+        APPLICATION_ENV,
+        APPLICATION_PATH . '/configs/application.ini'
+    );
+
+    $sapi_type = php_sapi_name();
+    if (substr($sapi_type, 0, 3) == 'cli') {
+        set_include_path(APPLICATION_PATH . PATH_SEPARATOR . get_include_path());
+        require_once("Bootstrap.php");
+    } else {
+        $application->bootstrap()->run();
+    }
+} catch (Exception $e) {
+    Logging::info($e->getMessage());
 }
 
-