Examine the entry for getCache() on this page:
https://api.joomla.org/cms-3/classes/JFactory.html
The document states:
"Returns the global JCache object"
See: \JCache
The actual returned object is a JCacheController.
Category | ⇒ | Cache Documentation |
Labels |
Added:
?
|
It's the comment at the head:
Returns the global {@link JCache} object
On 4/27/2016 6:35 PM, Walt Sorensen wrote:
Looks right in the code, but the API definitely shows the wrong
information—
You are receiving this because you authored the thread.
Reply to this email directly or view it on GitHub
#10112 (comment)
George Sexton
MH Software, Inc.
Voice: 303 438 9585
http://www.connectdaily.com
Please submit a Pull request to fix it
Status | New | ⇒ | Confirmed |
If I read the code right it should be JCache since it "Returns a reference to a cache adapter object, always creating it" thus a JCache object as the JFactory code is calling JCache::getInstance()
If the JFactory code was using JCacheController::getInstance()
it "Returns a reference to a cache adapter object, always creating it" it would be a JCacheController object.
If I followed the JFactory code correctly, the DocBlock at line 263 should be JCache
@gsexton Since this is your issue, do you want to submit a Pull Request to fix it?
It returns JCacheController
. JCache::getInstance()
returns a JCacheController
instance "decorating" JCache
.
On 4/28/2016 10:26 AM, Michael Babker wrote:
It returns |JCacheController|. |JCache::getInstance()| returns a
|JCacheController| instance "decorating" |JCache|.
I'm kind of a beginner at PHP, can you explain to me what "instance
"decorating" JCache" means? I'll do a pull request, I just want to make
sure I understand that first.
—
You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHub
#10112 (comment)
George Sexton
MH Software, Inc.
Voice: 303 438 9585
http://www.connectdaily.com
Never mind. I found some stuff. That means the doc is still wrong... I'll submit a pull request. I want to fix the issue with JCache->setLifeTime() not telling what the units are as well.
Thanks for the clarification @mbabker (It's nice to have people around who are well versed in what these things truly mean when the documentation is lacking in specifics)
We should probably clarify this distinction that JCache::getInstance()
returns a JCacheController
instance in the documentation too.
@mbabker Looks like the 3.5 API docs are Wrong for JCache::getInstance()
as it says the response is JCache object, whereas the JCache::getInstance()
code correctly shows JCacheController for the return.
Seems a bit strange...
Status | Confirmed | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2016-05-07 16:13:59 |
Closed_By | ⇒ | mbabker |
Looks right in the code, but the API definitely shows the wrong information
https://github.com/joomla/joomla-cms/blob/881021635765e6b055188e6ad7d25d50a6db2cf8/libraries/joomla/factory.php#L254-L268