[PEAR-BUG] Bug #18606 [Opn->Csd]: setOption

[email protected]
Newsgroups php.pear.bugs
Message-ID <[email protected]>
Edit report at http://pear.php.net/bugs/bug.php?id=18606&edit=1

 ID:               18606
 Updated by:       [email protected]
 Reported By:      diemuzi at gmail dot com
 Summary:          setOption
-Status:           Open
+Status:           Closed
 Type:             Bug
 Package:          System_Daemon
 Operating System: NA
 Package Version:  1.0.0RC1
 PHP Version:      5.3.6
-Assigned To:      
+Assigned To:      kvz
 Roadmap Versions: 
 New Comment:

-Status:      Open
+Status:      Closed
-Assigned To:
+Assigned To: kvz
This bug has been fixed in SVN.

If this was a documentation problem, the fix will appear on pear.php.net
by the end of next Sunday (CET).

If this was a problem with the pear.php.net website, the change should
be live shortly.

Otherwise, the fix will appear in the package's next release.

Thank you for the report and for helping us make PEAR better.

Thanks for pointing that out Sammie.
The $reason is passed by reference, but not defined before that. Fixed
in: 
https://github.com/kvz/system_daemon/commit/b7df875f4741aa6909ccf8bffe38d38ef
cdbfe37


Previous Comments:
------------------------------------------------------------------------

[2011-06-17 23:10:19] diemuzi

Description:
------------
    public function setOption($name, $value)
    {
        $success = true;
        // Not validated?
        if (!$this->_validate($name, $value, $reason)) {
            // Default not used or failed as well!
            $this->errors[] = "Option ".$name." invalid: ".$reason;
            $success        = false;
        }
        
        $this->_options[$name] = $value;
        return $success;
    }

Expected result:
----------------
From what I can understand the $reason variable cannot be set when
calling setOption. This variable appears to be an undefined var. I see
in the _validate() function $reason is set but setOption has no
configuration for it

------------------------------------------------------------------------


-- 
Edit this bug report at http://pear.php.net/bugs/bug.php?id=18606&edit=1
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.