Log/observer.php
function &factory($type, $priority = PEAR_LOG_INFO, $conf = array())
    {
        $type = strtolower($type);
        $class = 'Log_observer_' . $type;

        /*
         * If the desired class already exists (because the caller has supplied
         * it from some custom location), simply instantiate and return a new
         * instance.
         */
        if (class_exists($class)) {
            $object = new $class($priority, $conf);
            return $object;
        }

        /* Support both the new-style and old-style file naming conventions. */
        $newstyle = true;
        $classfile = dirname(__FILE__) . '/observer_' . $type . '.php';

        if (!file_exists($classfile)) {
            $classfile = 'Log/' . $type . '.php';
            $newstyle = false;
        }

        /*
         * Attempt to include our version of the named class, but don't treat
         * a failure as fatal.  The caller may have already included their own
         * version of the named class.
         */
        @include_once $classfile;

        /* If the class exists, return a new instance of it. */
        if (class_exists($class)) {
            /* Support both new-style and old-style construction. */
            if ($newstyle) {
                $object = new $class($priority, $conf);
            } else {
                $object = new $class($priority);
            }
            return $object;
        }

        $null = null;
        return $null;
    }
function &factory($type, $priority = PEAR_LOG_INFO, $conf = array())
    {
        $type = strtolower($type);
        $class = 'Log_observer_' . $type;

        /*
         * If the desired class already exists (because the caller has supplied
         * it from some custom location), simply instantiate and return a new
         * instance.
         */
        if (class_exists($class)) {
            $object = new $class($priority, $conf);
            return $object;
        }

        /* Support both the new-style and old-style file naming conventions. */
        $newstyle = true;
        $classfile = dirname(__FILE__) . '/observer_' . $type . '.php';

        if (!file_exists($classfile)) {
            $classfile = 'Log/' . $type . '.php';
            $newstyle = false;
        }

        /*
         * Attempt to include our version of the named class, but don't treat
         * a failure as fatal.  The caller may have already included their own
         * version of the named class.
         */
        @include_once $classfile;

        /* If the class exists, return a new instance of it. */
        if (class_exists($class)) {
            /* Support both new-style and old-style construction. */
            if ($newstyle) {
                $object = new $class($priority, $conf);
            } else {
                $object = new $class($priority);
            }
            return $object;
        }

        $null = null;
        return $null;
    }
function & factory ( $ type , $ priority = PEAR_LOG_INFO , $ conf = array ( ) ) { $ type = strtolower ( $ type ) ; $ class = 'Log_observer_' . $ type ; /*
         * If the desired class already exists (because the caller has supplied
         * it from some custom location), simply instantiate and return a new
         * instance.
         */ if ( class_exists ( $ class ) ) { $ object = new $ class ( $ priority , $ conf ) ; return $ object ; } /* Support both the new-style and old-style file naming conventions. */ $ newstyle = true ; $ classfile = dirname ( __FILE__ ) . '/observer_' . $ type . '.php' ; if ( ! file_exists ( $ classfile ) ) { $ classfile = 'Log/' . $ type . '.php' ; $ newstyle = false ; } /*
         * Attempt to include our version of the named class, but don't treat
         * a failure as fatal.  The caller may have already included their own
         * version of the named class.
         */ @ include_once $ classfile ; /* If the class exists, return a new instance of it. */ if ( class_exists ( $ class ) ) { /* Support both new-style and old-style construction. */ if ( $ newstyle ) { $ object = new $ class ( $ priority , $ conf ) ; } else { $ object = new $ class ( $ priority ) ; } return $ object ; } $ null = null ; return $ null ; }
Attempts to return a new concrete Log_observer instance of the requested
type.

@param string    $type       The type of concreate Log_observer subclass
to return.
@param integer   $priority   The highest priority at which to receive
log event notifications.
@param array     $conf       Optional associative array of additional
configuration values.

@return object               The newly created concrete Log_observer
instance, or null on an error.
Attempts to return a new concrete Log_observer instance of the requested type .