?
avatar gsexton
gsexton
27 Apr 2016

Steps to reproduce the issue

Examine the entry for getCache() on this page:

https://api.joomla.org/cms-3/classes/JFactory.html

Expected result

The document states:

"Returns the global JCache object"

See: \JCache

Actual result

The actual returned object is a JCacheController.

avatar gsexton gsexton - open - 27 Apr 2016
avatar brianteeman brianteeman - change - 27 Apr 2016
Category Cache Documentation
avatar brianteeman brianteeman - change - 27 Apr 2016
Labels Added: ?
avatar photodude
photodude - comment - 28 Apr 2016
avatar gsexton
gsexton - comment - 28 Apr 2016

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

https://github.com/joomla/joomla-cms/blob/881021635765e6b055188e6ad7d25d50a6db2cf8/libraries/joomla/factory.php#L254-L268


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

avatar brianteeman
brianteeman - comment - 28 Apr 2016

Please submit a Pull request to fix it


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/10112.

avatar brianteeman brianteeman - change - 28 Apr 2016
Status New Confirmed
avatar photodude
photodude - comment - 28 Apr 2016

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?

avatar mbabker
mbabker - comment - 28 Apr 2016

It returns JCacheController. JCache::getInstance() returns a JCacheController instance "decorating" JCache.

avatar gsexton
gsexton - comment - 28 Apr 2016

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

avatar gsexton
gsexton - comment - 28 Apr 2016

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.

avatar photodude
photodude - comment - 28 Apr 2016

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.

avatar photodude
photodude - comment - 28 Apr 2016

@gsexton one of the best ways to get your feet wet and/or build your skills is to Submit PR's.

avatar photodude
photodude - comment - 29 Apr 2016

@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...

avatar izharaazmi
izharaazmi - comment - 7 May 2016

Can we close this as the PR #10152 was merged?

avatar mbabker mbabker - change - 7 May 2016
Status Confirmed Closed
Closed_Date 0000-00-00 00:00:00 2016-05-07 16:13:59
Closed_By mbabker
avatar mbabker mbabker - close - 7 May 2016

Add a Comment

Login with GitHub to post a comment