ZF-10698: monitor_custom_event() signature wrong in ZendMonitor.php

Issue Type: Bug Created: 2010-11-17T07:25:39.000+0000 Last Updated: 2010-11-17T09:05:59.000+0000 Status: Resolved Fix version(s): - 1.11.1 (30/Nov/10)

Reporter: Jonathan Marston (marstonstudio) Assignee: Matthew Weier O'Phinney (matthew) Tags: - Zend_Log

Related issues: - ZF-10308



I'm getting this warning when using ZendMonitor

Warning: monitor_custom_event() expects at most 3 parameters, 4 given in /usr/local/zend/share/ZendFramework/library/Zend/Log/Writer/ZendMonitor.php on line 106

taking a look at the ZendMonitor.php code, the call looks like this:

<pre class="literal">
    protected function _write($event)
        $priority = $event['priority'];
        $message  = $event['message'];
        unset($event['priority'], $event['message']);

        if (!empty($event)) {
            monitor_custom_event($priority, $message, false, $event);
        } else {
            monitor_custom_event($priority, $message);

the actual signature of the method as documented in…

<pre class="literal">
void zend_monitor_custom_event (string $class, string $text, mixed $user_data)


Posted by Matthew Weier O'Phinney (matthew) on 2010-11-17T07:32:21.000+0000

This issue was fixed yesterday in trunk and the 1.11 release branch.

Posted by Ramon Henrique Ornelas (ramon) on 2010-11-17T07:57:38.000+0000

Hi @matthew

I think that could be added in the clause else (line 127 Zend/Log/Writer/ZendMonitor.php) too a verification if is Zend Server to call the function zend_monitor_custom_event.

<pre class="highlight">
else {
    if ($this->_isZendServer) {
        zend_monitor_custom_event($priority, $message);
    } else {
        monitor_custom_event($priority, $message);

Greetings Ramon

Posted by Matthew Weier O'Phinney (matthew) on 2010-11-17T09:05:59.000+0000

We could, but it's not strictly necessary, as the first two arguments of each is the same, and monitor_custom_event() is aliased to zend_monitor_custom_event() in Zend Server.

Have you found an issue?

See the Overview section for more details.


© 2006-2016 by Zend, a Rogue Wave Company. Made with by awesome contributors.

This website is built using zend-expressive and it runs on PHP 7.