-- Matthew Ratzloff <[EMAIL PROTECTED]> wrote
(on Wednesday, 07 March 2007, 02:40 PM -0800):
> In that case, we need to go back to the drawing board with components that
> model "simple" processes like Zend_Session (Zend_Session_Namespace adds
> value, but is not intuitive) 

Zend_Session_Namespace may not be intuitive in terms of naming or what
it does, but the actual *usage* is incredibly simple and very intuitive:

    $auth = Zend_Session_Namespace('auth');
    echo $auth->name;

I personally like that notation, but I may be an OO junkie.

> or the new Zend_Log class (passing a
> Zend_Log_Writer_* object to the constructor could be confusing).

How is:

    $log = new Zend_Log(new Zend_Log_Writer_Stream($filename));
    $log->log('My error message'):

harder than:

    Zend_Log::setAdapter(new Zend_Log_Adapter_File($filename));
    Zend_Log::log('My error message');
    
?

They're almost identical in usage. And the former is *better* because I
can have a different log object for each log I want to keep, instead of
needing to pass extraneous arguments to each log action indicating which
named log I want to write to. With the new Zend_Log, I create a log for
each discrete task I want to log, and then store the object in the
registry; this is easier and more intuitive in many regards. (If you've
used Zend_Log for much, you'll know what I'm talking about.)

-- 
Matthew Weier O'Phinney
PHP Developer            | [EMAIL PROTECTED]
Zend - The PHP Company   | http://www.zend.com/

Reply via email to