Permalink
Browse files

sfGoogleAnalyticsPlugin: Addressed compat logging issue, increased sy…

…mfony dependency to include 1.2, released 1.1.4.
  • Loading branch information...
1 parent fb73a6f commit 726159608f3cc1829fbfbfc21ba26ad6b9438734 Kris.Wallsmith committed Oct 16, 2008
Showing with 13 additions and 15 deletions.
  1. +2 −2 config/config.php
  2. +5 −7 lib/util/sfGoogleAnalyticsToolkit.class.php
  3. +6 −6 package.xml
View
@@ -1,8 +1,8 @@
<?php
-if (defined('SYMFONY_VERSION') && strpos(SYMFONY_VERSION, '1.1') === 0)
+if (defined('SYMFONY_VERSION') && 0 !== strpos(SYMFONY_VERSION, '1.0'))
{
- // symfony 1.1
+ // >= symfony 1.1
$listener = array('sfGoogleAnalyticsListener', 'observe');
$this->dispatcher->connect('request.method_not_found', $listener);
@@ -17,18 +17,16 @@ class sfGoogleAnalyticsToolkit
* @param string $message
* @param string $priority
*/
- static public function logMessage($subject, $message, $priority = null)
+ static public function logMessage($subject, $message, $priority = 'info')
{
- $priority = strtoupper($priority);
-
- if (class_exists('ProjectConfiguration'))
+ if (class_exists('ProjectConfiguration', false))
{
- ProjectConfiguration::getActive()->getEventDispatcher()->notify(new sfEvent($subject, 'application.log', array($message, 'priority' => $priority ? constant('sfLogger::'.$priority) : sfLogger::INFO)));
+ ProjectConfiguration::getActive()->getEventDispatcher()->notify(new sfEvent($subject, 'application.log', array($message, 'priority' => constant('sfLogger::'.strtoupper($priority)))));
}
- elseif ($priority)
+ else
{
$message = sprintf('{%s} %s', is_object($subject) ? get_class($subject) : $subject, $message);
- sfContext::getInstance()->getLogger()->log($message, constant('SF_LOG_'.$priority));
+ sfContext::getInstance()->getLogger()->log($message, constant('SF_LOG_'.strtoupper($priority)));
}
}
}
View
@@ -7,13 +7,13 @@
<lead>
<name>Kris Wallsmith</name>
<user>Kris.Wallsmith</user>
- <email>kris.wallsmith@gmail.com</email>
+ <email>kris.wallsmith@symfony-project.com</email>
<active>yes</active>
</lead>
- <date>2008-07-06</date>
+ <date>2008-10-16</date>
<version>
- <release>1.1.3</release>
- <api>1.1.3</api>
+ <release>1.1.4</release>
+ <api>1.1.4</api>
</version>
<stability>
<release>stable</release>
@@ -70,8 +70,8 @@
<name>symfony</name>
<channel>pear.symfony-project.com</channel>
<min>1.0.0</min>
- <max>1.2.0</max>
- <exclude>1.2.0</exclude>
+ <max>1.3.0</max>
+ <exclude>1.3.0</exclude>
</package>
</required>
</dependencies>

0 comments on commit 7261596

Please sign in to comment.