Skip to content

Commit

Permalink
Remove PHP interpretation of plugin/theme assets.
Browse files Browse the repository at this point in the history
This feature has caused many people pain as it interacts poorly with
many javascript libraries and environments that have short_tags enabled.

Fixes #1853
  • Loading branch information
markstory committed Sep 9, 2012
1 parent dfce0ee commit f25ee98
Showing 1 changed file with 3 additions and 12 deletions.
15 changes: 3 additions & 12 deletions lib/Cake/Routing/Filter/AssetDispatcher.php
@@ -1,8 +1,5 @@
<?php
/**
*
* PHP 5
*
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
* Copyright 2005-2012, Cake Software Foundation, Inc. (http://cakefoundation.org)
*
Expand All @@ -11,12 +8,11 @@
*
* @copyright Copyright 2005-2012, Cake Software Foundation, Inc. (http://cakefoundation.org)
* @link http://cakephp.org CakePHP(tm) Project
* @package Cake.Routing
* @since CakePHP(tm) v 2.2
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/

namespace Cake\Routing\Filter;

use Cake\Routing\DispatcherFilter;
use Cake\Core\App;
use Cake\Core\Configure;
Expand Down Expand Up @@ -151,15 +147,10 @@ protected function _deliverAsset(Response $response, $assetFile, $ext) {
$response->cache(filemtime($assetFile));
$response->send();
ob_clean();
if ($ext === 'css' || $ext === 'js') {
include $assetFile;
} else {
readfile($assetFile);
}

readfile($assetFile);
if ($compressionEnabled) {
ob_end_flush();
}
}

}
}

0 comments on commit f25ee98

Please sign in to comment.