logging-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ihabu...@apache.org
Subject git commit: LOG4PHP-207: Fix BC issue with host parameter.
Date Mon, 18 Mar 2013 18:44:07 GMT
Updated Branches:
  refs/heads/develop 1b2d8801a -> f15e0cc61


LOG4PHP-207: Fix BC issue with host parameter.

Host paramter can be specified with or without mongo:// protocol prefix.
However it is prefered to specify it wouth the prefix.

Signed-off-by: Vladimir Gorej <gorej@codescale.net>
Signed-off-by: Ivan Habunek <ihabunek@apache.org>


Project: http://git-wip-us.apache.org/repos/asf/logging-log4php/repo
Commit: http://git-wip-us.apache.org/repos/asf/logging-log4php/commit/f15e0cc6
Tree: http://git-wip-us.apache.org/repos/asf/logging-log4php/tree/f15e0cc6
Diff: http://git-wip-us.apache.org/repos/asf/logging-log4php/diff/f15e0cc6

Branch: refs/heads/develop
Commit: f15e0cc618a161d04cf594e77b763bd479369b0a
Parents: 1b2d880
Author: Vladimir Gorej <gorej@codescale.net>
Authored: Mon Mar 18 19:36:01 2013 +0100
Committer: Ivan Habunek <ihabunek@apache.org>
Committed: Mon Mar 18 19:42:43 2013 +0100

----------------------------------------------------------------------
 src/main/php/appenders/LoggerAppenderMongoDB.php |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/logging-log4php/blob/f15e0cc6/src/main/php/appenders/LoggerAppenderMongoDB.php
----------------------------------------------------------------------
diff --git a/src/main/php/appenders/LoggerAppenderMongoDB.php b/src/main/php/appenders/LoggerAppenderMongoDB.php
index 8fb1db0..7486ded 100644
--- a/src/main/php/appenders/LoggerAppenderMongoDB.php
+++ b/src/main/php/appenders/LoggerAppenderMongoDB.php
@@ -264,7 +264,9 @@ class LoggerAppenderMongoDB extends LoggerAppender {
 			$clientClass = class_exists('MongoClient') ? 'MongoClient' : 'Mongo';
 			# Connection string generation.
 			if ($this->connectionString === null) {
-				$connectionString = sprintf('%s%s:%d', self::DEFAULT_MONGO_URL_PREFIX, $this->host,
$this->port);
+				$connectionString = sprintf('%s%s:%d', self::DEFAULT_MONGO_URL_PREFIX,
+							    preg_replace('/^'.preg_quote(self::DEFAULT_MONGO_URL_PREFIX, '/').'/', '', $this->host),
+							    $this->port);
 			} else {
 				$connectionString = $this->connectionString;
 			}


Mime
View raw message