Ticket #199 (closed defect: fixed)
PHP wrapper object code
| Reported by: | Shnapoo | Owned by: | moo |
|---|---|---|---|
| Priority: | major | Milestone: | 1.3.0 |
| Component: | website | Version: | 1.2.1 |
| Keywords: | Cc: | ||
| Blocked By: | PHP Version: | ||
| Application: | Need User Feedback: | no | |
| Other Exts: | SAPI: | Irrelevant | |
| Probability: | Blocking: |
Description
Hi there,
I was unable to log into the website (although giving right password for sure). Just wanted to inform you of a tiny bug in the XCache wrapper object code provided here.
It currently doesn't handle its singleton correctly. When calling xcache::getInstance() you get a new instance each time, because the class doesn't store the reached out instance.
Bad version:
public static function getInstance()
{
return (self::$xcobj instanceof XCache) ? self::$xcobj : new XCache;
}
Fixed version should look like:
public static function getInstance()
{
if( !(self::$xcobj instanceof XCache) ){
self::$xcobj = new XCache;
}
return self::$xcobj;
}
Change History
Note: See
TracTickets for help on using
tickets.

