Javascript 跨多个应用程序共享TinyMCE插件

Javascript 跨多个应用程序共享TinyMCE插件,javascript,cakephp,tinymce,assets,Javascript,Cakephp,Tinymce,Assets,我正在使用CakePHP2.4.7和CakeDC的TinyMCE插件 我在服务器上的共享位置设置了CakePHP内核和插件,以便多个应用程序可以访问它。这使我不必更新TinyMCE的多个副本。在我迁移到新服务器并更新软件之前,一切都很好 新服务器运行的是Apache2.4而不是2.2,并使用mod_ruid2而不是suexec 现在,我在尝试加载编辑器时出现以下错误: 致命错误(4):语法错误,在[/xyz/Plugin/TinyMCE/webroot/js/tiny\u mce/tiny\u

我正在使用CakePHP2.4.7和CakeDC的TinyMCE插件

我在服务器上的共享位置设置了CakePHP内核和插件,以便多个应用程序可以访问它。这使我不必更新TinyMCE的多个副本。在我迁移到新服务器并更新软件之前,一切都很好

新服务器运行的是Apache2.4而不是2.2,并使用mod_ruid2而不是suexec

现在,我在尝试加载编辑器时出现以下错误:

致命错误(4):语法错误,在[/xyz/Plugin/TinyMCE/webroot/js/tiny\u mce/tiny\u mce.js,第1行中出现意外的T\u常量\u封装字符串]

我应该如何开始调试它

变通尝试
我尝试将一个符号链接从应用程序的webroot添加到TinyMCE的插件webroot。这是因为它加载了js文件和编辑器,但是TinyMCE插件在错误的当前目录下工作,文件管理不会被分离。

问题在于
AssetDispatcher
过滤器,它包括
css
js
文件,使用PHPs
include()
语句,使文件通过PHP解析器发送,在PHP解析器中,它会在出现
时出错,您对新服务器上的短打开标记的看法是正确的。我为自定义AssetDispatcher创建了一个插件,一切正常。谢谢。什么是$compressionEnabled?它会引起通知,从而导致错误。@ArvindK。在
方法的排除部分中定义的变量。该示例仅显示与更改相关的部分,请检查链接源(分别是您正在使用的版本的源)以获取完整信息(更新了答案)。与此问题相关的另一个问题。我确实创建了一个新的过滤器,如“答案”中所述,现在css文件出现了问题。它们现在并没有被解释为CSS,而是被解释为破坏整个网站的文本。有人吗?我是否将其作为新问题发布?
// app/Routing/Filter/MyAssetDispatcher.php

App::uses('AssetDispatcher', 'Routing/Filter');

class MyAssetDispatcher extends AssetDispatcher {
    protected function _deliverAsset(CakeResponse $response, $assetFile, $ext) {
        // see the source of your CakePHP core for the
        // actual code that you'd need to reimpelment

        ob_start();
        $compressionEnabled = Configure::read('Asset.compress') && $response->compress();
        if ($response->type($ext) == $ext) {
            $contentType = 'application/octet-stream';
            $agent = env('HTTP_USER_AGENT');
            if (preg_match('%Opera(/| )([0-9].[0-9]{1,2})%', $agent) || preg_match('/MSIE ([0-9].[0-9]{1,2})/', $agent)) {
                $contentType = 'application/octetstream';
            }
            $response->type($contentType);
        }
        if (!$compressionEnabled) {
            $response->header('Content-Length', filesize($assetFile));
        }
        $response->cache(filemtime($assetFile));
        $response->send();
        ob_clean();


        // instead of the possible `include()` in the original
        // methods source, use `readfile()` only 
        readfile($assetFile);


        if ($compressionEnabled) {
            ob_end_flush();
        }
    }
}
// app/Config/bootstrap.php

Configure::write('Dispatcher.filters', array(
    'MyAssetDispatcher', // instead of AssetDispatcher
    // ...
));