-
☆ A M B ☆
- 3,112 Posts
I’m thinking that bridging those 2 versions should be relatively simple.
Just create an internal method that switches the API which is different.
For an instance Evo uses dbapi and Revo uses xPDO.
Let’s say that we ignore the installation and the add-on’s folder issues.
The question is that what is the best practice on sniffing which version is currently running the add-on.
if (defined(MODX_CORE_PATH)) means Revo?
Currently there is no CONSTANT that defines EVO or REVO versions.
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.
Try this:
print_r($modx->getVersionData(),true);
That said, I’ve tried making an add-on that will work in both Evo and Revo. The code was horribly inefficient and cluttered, and worst of all, it was really, really unpleasant to work on. I could see that I’d end up in a mental institution if I kept at it. YMMV.
-
☆ A M B ☆
- 3,112 Posts
lol...
I think we can do this.
CONSTANT will play as a major role in here.
But probably the core-dev team can consider to add a CONSTANT version to distinct the MODx’s versions.
Revo is taking a nice path, while Evo won’t die.
Smart bridging should be considered as a new weaponry to win the CMS battle.
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.
-
☆ A M B ☆
- 24,524 Posts
Hmmm... I would think it would be much more efficient to have different files to include, depending on the version, rather than try to accommodate both in one script. Have a lot of "getter" and "putter" functions that would act as wrappers, and the include files selected would have the appropriate API functions from the version being used. Or just have all the files included, and the snippet/plugin itself would just have the code to determine which version to include.