Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Always do count on buffer array not a good idea #120

Closed
omgnull opened this Issue · 0 comments

2 participants

@omgnull

This issue for all buffered handlers.

    $this->buffer[] = $record;
    if ($this->bufferSize > 0 && count($this->buffer) > $this->bufferSize) {
        array_shift($this->buffer);
    }

Better its shoud be independent counter and change the name "size" to "limit"

    $this->buffer[] = $record;
    $this->bufferSize++;
    if ($this->bufferLimit > 0 && $this->bufferSize === $this->bufferLimit) {
        array_shift($this->buffer);
        $this->bufferSize--;
    }

Or add option to flush records if buffer is full

@Seldaek Seldaek closed this in bcb51e0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.