Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

sfGoogleAnalyticsPlugin: Addressed compat logging issue, increased sy…

…mfony dependency to include 1.2, released 1.1.4.
  • Loading branch information...
commit 726159608f3cc1829fbfbfc21ba26ad6b9438734 1 parent fb73a6f
authored October 16, 2008
4  config/config.php
... ...
@@ -1,8 +1,8 @@
1 1
 <?php
2 2
 
3  
-if (defined('SYMFONY_VERSION') && strpos(SYMFONY_VERSION, '1.1') === 0)
  3
+if (defined('SYMFONY_VERSION') && 0 !== strpos(SYMFONY_VERSION, '1.0'))
4 4
 {
5  
-  // symfony 1.1
  5
+  // >= symfony 1.1
6 6
   $listener = array('sfGoogleAnalyticsListener', 'observe');
7 7
   
8 8
   $this->dispatcher->connect('request.method_not_found', $listener);
12  lib/util/sfGoogleAnalyticsToolkit.class.php
@@ -17,18 +17,16 @@ class sfGoogleAnalyticsToolkit
17 17
    * @param   string  $message
18 18
    * @param   string  $priority
19 19
    */
20  
-  static public function logMessage($subject, $message, $priority = null)
  20
+  static public function logMessage($subject, $message, $priority = 'info')
21 21
   {
22  
-    $priority = strtoupper($priority);
23  
-    
24  
-    if (class_exists('ProjectConfiguration'))
  22
+    if (class_exists('ProjectConfiguration', false))
25 23
     {
26  
-      ProjectConfiguration::getActive()->getEventDispatcher()->notify(new sfEvent($subject, 'application.log', array($message, 'priority' => $priority ? constant('sfLogger::'.$priority) : sfLogger::INFO)));
  24
+      ProjectConfiguration::getActive()->getEventDispatcher()->notify(new sfEvent($subject, 'application.log', array($message, 'priority' => constant('sfLogger::'.strtoupper($priority)))));
27 25
     }
28  
-    elseif ($priority)
  26
+    else
29 27
     {
30 28
       $message = sprintf('{%s} %s', is_object($subject) ? get_class($subject) : $subject, $message);
31  
-      sfContext::getInstance()->getLogger()->log($message, constant('SF_LOG_'.$priority));
  29
+      sfContext::getInstance()->getLogger()->log($message, constant('SF_LOG_'.strtoupper($priority)));
32 30
     }
33 31
   }
34 32
 }
12  package.xml
@@ -7,13 +7,13 @@
7 7
   <lead>
8 8
     <name>Kris Wallsmith</name>
9 9
     <user>Kris.Wallsmith</user>
10  
-    <email>kris.wallsmith@gmail.com</email>
  10
+    <email>kris.wallsmith@symfony-project.com</email>
11 11
     <active>yes</active>
12 12
   </lead>
13  
-  <date>2008-07-06</date>
  13
+  <date>2008-10-16</date>
14 14
   <version>
15  
-    <release>1.1.3</release>
16  
-    <api>1.1.3</api>
  15
+    <release>1.1.4</release>
  16
+    <api>1.1.4</api>
17 17
   </version>
18 18
   <stability>
19 19
     <release>stable</release>
@@ -70,8 +70,8 @@
70 70
         <name>symfony</name>
71 71
         <channel>pear.symfony-project.com</channel>
72 72
         <min>1.0.0</min>
73  
-        <max>1.2.0</max>
74  
-        <exclude>1.2.0</exclude>
  73
+        <max>1.3.0</max>
  74
+        <exclude>1.3.0</exclude>
75 75
       </package>
76 76
     </required>
77 77
   </dependencies>

0 notes on commit 7261596

Please sign in to comment.
Something went wrong with that request. Please try again.