summaryrefslogtreecommitdiff
path: root/framework/Util
diff options
context:
space:
mode:
Diffstat (limited to 'framework/Util')
-rw-r--r--framework/Util/TDataFieldAccessor.php1
-rw-r--r--framework/Util/TLogRouter.php21
-rw-r--r--framework/Util/TLogger.php1
-rw-r--r--framework/Util/TParameterModule.php1
-rw-r--r--framework/Util/TVarDumper.php1
5 files changed, 18 insertions, 7 deletions
diff --git a/framework/Util/TDataFieldAccessor.php b/framework/Util/TDataFieldAccessor.php
index fa65a9a2..bf0b58ae 100644
--- a/framework/Util/TDataFieldAccessor.php
+++ b/framework/Util/TDataFieldAccessor.php
@@ -80,4 +80,3 @@ class TDataFieldAccessor
}
}
-?>
diff --git a/framework/Util/TLogRouter.php b/framework/Util/TLogRouter.php
index 5c755985..aa772194 100644
--- a/framework/Util/TLogRouter.php
+++ b/framework/Util/TLogRouter.php
@@ -96,6 +96,20 @@ class TLogRouter extends TModule
}
/**
+ * Adds a TLogRoute instance to the log router.
+ *
+ * @param TLogRoute $route
+ * @throws TInvalidDataTypeException if the route object is invalid
+ */
+ public function addRoute($route)
+ {
+ if(!($route instanceof TLogRoute))
+ throw new TInvalidDataTypeException('logrouter_routetype_invalid');
+ $this->_routes[]=$route;
+ $route->init(null);
+ }
+
+ /**
* @return string external configuration file. Defaults to null.
*/
public function getConfigFile()
@@ -106,11 +120,11 @@ class TLogRouter extends TModule
/**
* @param string external configuration file in namespace format. The file
* must be suffixed with '.xml'.
- * @throws TInvalidDataValueException if the file is invalid.
+ * @throws TConfigurationException if the file is invalid.
*/
public function setConfigFile($value)
{
- if(($this->_configFile=Prado::getPathOfNamespace($value,self::LOG_FILE_EXT))===null)
+ if(($this->_configFile=Prado::getPathOfNamespace($value,self::CONFIG_FILE_EXT))===null)
throw new TConfigurationException('logrouter_configfile_invalid',$value);
}
@@ -509,8 +523,9 @@ class TEmailLogRoute extends TLogRoute
foreach($logs as $log)
$message.=$this->formatLogMessage($log[0],$log[1],$log[2],$log[3]);
$message=wordwrap($message,70);
+ $returnPath = ini_get('sendmail_path') ? "Return-Path:{$this->_from}\r\n" : '';
foreach($this->_emails as $email)
- mail($email,$this->getSubject(),$message,"From:{$this->_from}\r\n");
+ mail($email,$this->getSubject(),$message,"From:{$this->_from}\r\n{$returnPath}");
}
diff --git a/framework/Util/TLogger.php b/framework/Util/TLogger.php
index 6d5385eb..51005883 100644
--- a/framework/Util/TLogger.php
+++ b/framework/Util/TLogger.php
@@ -127,4 +127,3 @@ class TLogger extends TComponent
}
}
-?>
diff --git a/framework/Util/TParameterModule.php b/framework/Util/TParameterModule.php
index 020db8db..529f20ca 100644
--- a/framework/Util/TParameterModule.php
+++ b/framework/Util/TParameterModule.php
@@ -141,4 +141,3 @@ class TParameterModule extends TModule
}
}
-?>
diff --git a/framework/Util/TVarDumper.php b/framework/Util/TVarDumper.php
index 180bb71a..e30e2400 100644
--- a/framework/Util/TVarDumper.php
+++ b/framework/Util/TVarDumper.php
@@ -126,4 +126,3 @@ class TVarDumper
}
}
-?>