Browse Source

php : added php.Lib.mail()

Franco Ponticelli 13 years ago
parent
commit
9bb0069222
3 changed files with 26 additions and 5 deletions
  1. 4 4
      doc/CHANGES.txt
  2. 19 0
      std/php/Lib.hx
  3. 3 1
      tests/unit/unit.hxml

+ 4 - 4
doc/CHANGES.txt

@@ -38,10 +38,10 @@
 	all : allow to access root package with std prefix (std.Type for example)
 	all : allow to access root package with std prefix (std.Type for example)
 	all : added haxe.EnumFlags
 	all : added haxe.EnumFlags
 	sys : io.File.getChar/stdin/stdout/stderr are now in Sys class
 	sys : io.File.getChar/stdin/stdout/stderr are now in Sys class
-   cpp : Reflect.getField and Reflect.setField no longer call property functions.  Use Reflect.getProperty and Refelect.setProperty instead.
-   cpp : Default arguments now use Null<T> for performance increase and interface compatibility
-   cpp : Added metadata options for injecting native cpp code into headers, classes and functions
-
+	cpp : Reflect.getField and Reflect.setField no longer call property functions.  Use Reflect.getProperty and Refelect.setProperty instead.
+	cpp : Default arguments now use Null<T> for performance increase and interface compatibility
+	cpp : Added metadata options for injecting native cpp code into headers, classes and functions
+	php : added php.Lib.mail
 
 
 2011-09-25: 2.08
 2011-09-25: 2.08
 	js : added js.JQuery
 	js : added js.JQuery

+ 19 - 0
std/php/Lib.hx

@@ -75,6 +75,25 @@ class Lib {
 	public static function associativeArrayOfObject(ob : Dynamic) : NativeArray {
 	public static function associativeArrayOfObject(ob : Dynamic) : NativeArray {
 		return untyped __php__("(array) $ob");
 		return untyped __php__("(array) $ob");
 	}
 	}
+	
+	/**
+	 * See the documentation for the equivalent PHP function for details on usage: 
+	 * http://php.net/manual/en/function.mail.php
+	 * @param	to
+	 * @param	subject
+	 * @param	message
+	 * @param	?additionalHeaders
+	 * @param	?additionalParameters
+	 */
+	public static function mail(to : String, subject : String, message : String, ?additionalHeaders : String, ?additionalParameters : String) : Bool
+	{
+		if(null != additionalParameters)
+			return untyped __call__("mail", to, subject, message, additionalHeaders, additionalParameters);
+		else if(null != additionalHeaders)
+			return untyped __call__("mail", to, subject, message, additionalHeaders);
+		else
+			return untyped __call__("mail", to, subject, message);
+	}
 
 
 	/**
 	/**
 		For neko compatibility only.
 		For neko compatibility only.

+ 3 - 1
tests/unit/unit.hxml

@@ -7,6 +7,7 @@
 params.hxml
 params.hxml
 --next
 --next
 -swf unit9.swf
 -swf unit9.swf
+-swf-header 300:650:30:FFFFFF
 -swf-version 11
 -swf-version 11
 -main unit.Test
 -main unit.Test
 params.hxml
 params.hxml
@@ -16,7 +17,8 @@ params.hxml
 -main unit.Test
 -main unit.Test
 --next
 --next
 -js unit.js
 -js unit.js
-unit.Test
+-main unit.Test
+--js-modern
 params.hxml
 params.hxml
 --next
 --next
 -neko unit.n
 -neko unit.n