At the beginning of dmemcache_object, if $flush, the code tries to identify which closing method to use on the object based on the extension being used, and set it in $rc.

However, the extension is only identified after that check by a call to dmemcache_extension, meaning the two checks always fail, and $rc is not initialized.

However, even if it worked, the value is never reused, being overwritten with a different meaning by a (looped) call to dmemcache_connect.

So that whole part of the plugin should just be removed.

Comments

fgm created an issue. See original summary.

fgm’s picture

Status: Active » Needs review
StatusFileSize
new2.71 KB

Suggested patch.

jeremy’s picture

StatusFileSize
new1.19 KB

The [] short array syntax requires PHP 5.4+ and this module only requires PHP 5.2 -- removing that part of the patch.

We do not seem to use this flush functionality in the code-base, I'm tempted to simply remove it. I assume that's why this very broken logic was never detected. In any case, it may be desirable to reconnect to the server when flushing, if third-party code is using this functionality, so fixing the intent.

jeremy’s picture

StatusFileSize
new968 bytes

Actually, let's just flush all statics.

jeremy’s picture

StatusFileSize
new1.59 KB

Renamed the parameter and updated the documentation thanks to feedback from fabianx.

  • Jeremy committed 8987471 on 7.x-1.x
    Issue #3044938 by Jeremy, fgm, fabianx: dmemcache_object uses undefined...
jeremy’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.