I have to admit my knowledge of the inner workings of classes is somewhat limited. I'm open to any method that adds some versatility to the system...
After thinking about this and doing a little testing, here's another approach (that would require no core edits). While their may be a more efficient method to replace a value in a multidimensional array; I'll leave that to you
For a global replacement of jquery to use a cdn, create includes/addons/body-cdn.php
(using body addon because jquery.js may be included by some head.xxx files)
Code:if (!defined('NUKE_FILE')) die ('You can\'t access this file directly...');
global $headJS;
$needle = array('file','includes/jquery/jquery.js');
$replacement = array('file','http://code.jquery.com/jquery-1.6.2.min.js');
for($i=0;$i<count($headJS);$i++) {
if($headJS[$i] == $needle) {
$headJS[$i] = $replacement;
}
}
|
Only possibility that the core jquery.js could be included after that, is with the use of RN_MODULE_HEAD, which is unused within the distro at this point.... But could possibly be used by some 3rd party addons.
By the way, RN_MODULE_HEAD would be perfect for any module level overrides of CSS/JS using the same method.... as it is included just prior to writeHEAD()
Just another take on an approach that doesn't have to wait for improvements/enhancements to the dh system.