PEAR is archived and read-only

This mirror preserves historical PEAR package releases and metadata so existing references remain available.

Home » Mail » Mail_Mime » Bug #2513

Default Paramters for factory

Details

Submitted2004-10-12 09:50 UTC
Frommarkus at emedia-solutions-wolf dot de
Assignedsean
StatusBogus
PackageMail_Mime
PHP Version4.3.9
OSDebian Linux
Roadmaps(Not assigned)

Comments

[2004-10-12 09:50 UTC] markus at emedia-solutions-wolf dot de

Description:
------------
We are using the Mail and Mail_mime package and I noticed that the Mail_mime needs a "\r\n" constructor parameter (which is configured as default parameter).
When (as we do) one create the Mail_mime using the Mail::factory method the parameter is overridden by the factory default which is an empty array.
This should eiter be documeted (to warn the users) or changed so that the default parameter is taken into account. Eiter in the Mail_mime or in the Mail package.

[2004-12-09 08:16 UTC] markus at emedia-solutions-wolf dot de

in Mail/mime.php:
...
function Mail_mime($crlf = "\r\n")
{
...

If you use the Mail factory as documented with:
Mail::factory( "mime" )
you should get the default implementation (constructed without parameters), but the code will result in the following Mail_mime constructor call:
... new Mail_mime( array() );

This should be documented in the Mail_mime package and/or changed in the Mail package.

[2004-12-11 02:38 UTC] markus at emedia-solutions-wolf dot de

Hmm, maybe it was my interpretation, but isn't PEARs Mail package factory for that reason?
I can't think of any other reason for haveing a factory...
If it was my fault, then just close this bug.
But I think it should be documented anyway, because it could be missleading.