evocms-community / evolution

Welcome to the new evolution of MODX Evolution!
GNU General Public License v3.0
84 stars 29 forks source link

[Bug] Evo 3.1.29 getCacheFolder #490

Open Nicola1971 opened 3 weeks ago

Nicola1971 commented 3 weeks ago

Summary

Evo 3.1.29 return just 'cache/' with $modx->getCacheFolder()

Steps to reproduce.

Evo 1.4.35 with $modx->getCacheFolder()

'assets/cache/'

Evo 3.1.29 with $modx->getCacheFolder()

'cache/' instead of 'core/storage/bootstrap'

Observed behavior

EvoCMS version

Evo 3.1.29

PHP version

8.1.29

Pathologic commented 3 weeks ago

What's your case? Do you need to cache something?

Nicola1971 commented 3 weeks ago

Just testing a Evo 1.4 plugin with Evo 3x. Anyway, I just found this bug, reported by you, five years ago :) https://github.com/evolution-cms/evolution/issues/998

Pathologic commented 2 weeks ago

@Nicola1971 I've declared this method as deprecated, so it would be better not to use it at all. In the case of your PageCacheManager plugin, you needn't getCacheFolder, because you can call $modx->clearCache($doc_id) instead of all this code: https://github.com/Nicola1971/PageCacheManager/blob/main/install/assets/plugins/PageCacheManager.tpl#L64-L101;

Nicola1971 commented 2 weeks ago

Is there anyway a replacement for getCacheFolder? without hardcoding the path? I didn't know you could use clearcache with doc_id! I don't think I ever read that in the documentation. Thanks a lot!

Nicola1971 commented 2 weeks ago

clearCache($doc_id) streamlined my code a lot :)

Pathologic commented 2 weeks ago

I don't think we need a replacement, because there's Storage facade in 3.x.

Nicola1971 commented 2 weeks ago

is there still clearcache on 3x?

Pathologic commented 2 weeks ago

Yes.