Hi,

can we use LoggerReflectionUtils::createObject
instead of all those factory methods? Its duplicated code over all log4php,
so it makes sense to use it from one point.

Cheers
Christian

On Sat, May 23, 2009 at 9:42 PM,  <[email protected]> wrote:
> Author: kurdalen
> Date: Sat May 23 19:42:41 2009
> New Revision: 777996
>
> URL: http://svn.apache.org/viewvc?rev=777996&view=rev
> Log:
> reverted factory method (it's actually used in LoggerAppender::singleton() to 
> instansiate appenders)
>
> Modified:
>    incubator/log4php/trunk/src/main/php/LoggerAppender.php
>
> Modified: incubator/log4php/trunk/src/main/php/LoggerAppender.php
> URL: 
> http://svn.apache.org/viewvc/incubator/log4php/trunk/src/main/php/LoggerAppender.php?rev=777996&r1=777995&r2=777996&view=diff
> ==============================================================================
> --- incubator/log4php/trunk/src/main/php/LoggerAppender.php (original)
> +++ incubator/log4php/trunk/src/main/php/LoggerAppender.php Sat May 23 
> 19:42:41 2009
> @@ -81,6 +81,21 @@
>        }
>
>        /**
> +        * Factory
> +        *
> +        * @param string $name appender name
> +        * @param string $class create an instance of this appender class
> +        * @return LoggerAppender
> +        */
> +       public static function factory($name, $class) {
> +               $class = basename($class);
> +               if(!empty($class)) {
> +                       return new $class($name);
> +               }
> +               return null;
> +       }
> +
> +       /**
>         * Singleton
>         *
>         * @param string $name appender name
>
>
>

Reply via email to