Routing/Filter/AssetDispatcher.php
protected function _filterAsset(CakeEvent $event) {
		$url = $event->data['request']->url;
		$response = $event->data['response'];
		$filters = Configure::read('Asset.filter');
		$isCss = (
			strpos($url, 'ccss/') === 0 ||
			preg_match('#^(theme/([^/]+)/ccss/)|(([^/]+)(?<!css)/ccss)/#i', $url)
		);
		$isJs = (
			strpos($url, 'cjs/') === 0 ||
			preg_match('#^/((theme/[^/]+)/cjs/)|(([^/]+)(?<!js)/cjs)/#i', $url)
		);

		if (($isCss && empty($filters['css'])) || ($isJs && empty($filters['js']))) {
			$response->statusCode(404);
			return $response;
		}

		if ($isCss) {
			include WWW_ROOT . DS . $filters['css'];
			return $response;
		}

		if ($isJs) {
			include WWW_ROOT . DS . $filters['js'];
			return $response;
		}
	}
protected function _filterAsset(CakeEvent $event) {
		$url = $event->data['request']->url;
		$response = $event->data['response'];
		$filters = Configure::read('Asset.filter');
		$isCss = (
			strpos($url, 'ccss/') === 0 ||
			preg_match('#^(theme/([^/]+)/ccss/)|(([^/]+)(?<!css)/ccss)/#i', $url)
		);
		$isJs = (
			strpos($url, 'cjs/') === 0 ||
			preg_match('#^/((theme/[^/]+)/cjs/)|(([^/]+)(?<!js)/cjs)/#i', $url)
		);

		if (($isCss && empty($filters['css'])) || ($isJs && empty($filters['js']))) {
			$response->statusCode(404);
			return $response;
		}

		if ($isCss) {
			include WWW_ROOT . DS . $filters['css'];
			return $response;
		}

		if ($isJs) {
			include WWW_ROOT . DS . $filters['js'];
			return $response;
		}
	}
protected function _filterAsset ( CakeEvent $ event ) { $ url = $ event -> data [ 'request' ] -> url ; $ response = $ event -> data [ 'response' ] ; $ filters = Configure :: read ( 'Asset.filter' ) ; $ isCss = ( strpos ( $ url , 'ccss/' ) === 0 || preg_match ( '#^(theme/([^/]+)/ccss/)|(([^/]+)(?<!css)/ccss)/#i' , $ url ) ) ; $ isJs = ( strpos ( $ url , 'cjs/' ) === 0 || preg_match ( '#^/((theme/[^/]+)/cjs/)|(([^/]+)(?<!js)/cjs)/#i' , $ url ) ) ; if ( ( $ isCss && empty ( $ filters [ 'css' ] ) ) || ( $ isJs && empty ( $ filters [ 'js' ] ) ) ) { $ response -> statusCode ( 404 ) ; return $ response ; } if ( $ isCss ) { include WWW_ROOT . DS . $ filters [ 'css' ] ; return $ response ; } if ( $ isJs ) { include WWW_ROOT . DS . $ filters [ 'js' ] ; return $ response ; } }
Checks if the client is requesting a filtered asset and runs the corresponding
filter if any is configured

@param CakeEvent $event containing the request and response object
@return CakeResponse if the client is requesting a recognized asset, null otherwise
Checks if the client is requesting a filtered asset and runs the corresponding filter if any is configured