-
- 1,336 Posts
I’m converting Frontpage for 2.1 use, there’s a ticket raised on Frontpage about clearing the cache on resource edit, I want to implement this in the next release.
Looking at 2.0.8 the resource update processor uses $cacheManager->clearCache to do this, in 2.1(latest git as of today #4372) it uses a new method on the cachemanager called ’refresh’ and does this $modx->cacheManager->refresh.
In 2.1 the clearCache method is marked as deprecated and says use refresh, OK, but I can’t do this 2.0.8 as there is no refresh.
So, all I can do at the mo is use clearcache in both cases or check which version of revo we are installed in and switch the code as appropriate, is this intended?
This kind of situation may impact other packages.
Use MODx, or the cat gets it!
The problem is the
version checking.
I propose that MODX needs to have another CONSTANT about the running version.
So at least we can do this:
<?php
// let's say
define('MODX_VERSION', '2.0.4');
define('MODX_VERSION_RELEASE', 'pl');
if (MODX_VERSION >= '2.1.0') { // just tested that this works!
$modx->cacheManager->refresh();
} else {
$modx->cacheManager->clearCache();
}
Rico
Genius is one percent inspiration and ninety-nine percent perspiration.
Thomas A. Edison
MODx is great, but knowing how to use it well makes it perfect!
www.virtudraft.com
Security, security, security! |
Indonesian MODx Forum |
MODx Revo's cheatsheets |
MODx Evo's cheatsheets
Author of
Easy 2 Gallery 1.4.x,
PHPTidy,
spieFeed,
FileDownload R,
Upload To Users CMP,
Inherit Template TV,
LexRating,
ExerPlan,
Lingua,
virtuNewsletter,
Grid Class Key,
SmartTag,
prevNext
Maintainter/contributor of
Babel
Because it's hard to follow all topics on the forum, PING ME ON TWITTER
@_goldsky if you need my help.
Damn, I feel stupid!
Thx, Jason.
Rico
Genius is one percent inspiration and ninety-nine percent perspiration.
Thomas A. Edison
MODx is great, but knowing how to use it well makes it perfect!
www.virtudraft.com
Security, security, security! |
Indonesian MODx Forum |
MODx Revo's cheatsheets |
MODx Evo's cheatsheets
Author of
Easy 2 Gallery 1.4.x,
PHPTidy,
spieFeed,
FileDownload R,
Upload To Users CMP,
Inherit Template TV,
LexRating,
ExerPlan,
Lingua,
virtuNewsletter,
Grid Class Key,
SmartTag,
prevNext
Maintainter/contributor of
Babel
Because it's hard to follow all topics on the forum, PING ME ON TWITTER
@_goldsky if you need my help.