<?php
namespace AssetCompress\Filter;

use AssetCompress\AssetFilter;
/**
 * CssMin filter.
 *
 * Allows you to filter Css files through CssMin. You need to put CssMin in your application's
 * vendors directories. You can get it from http://code.google.com/p/cssmin/
 */
class CssMinFilter extends AssetFilter {

/**
 * Where CssMin can be found.
 *
 * @var array
 */
	protected $_settings = array(
		'path' => 'cssmin/CssMin.php'
	);

/**
 * Apply CssMin to $content.
 *
 * @param string $filename target filename
 * @param string $content Content to filter.
 * @throws Exception
 * @return string
 */
	public function output($filename, $content) {
		require_once APP . 'vendor' . DS . $this->_settings['path'];
		if (!class_exists('CssMin')) {
			throw new Exception(sprintf('Cannot not load filter class "%s".', 'CssMin'));
		}
		return CssMin::minify($content);
	}

}

<?php
namespace AssetCompress\Filter;

use AssetCompress\AssetFilter;
use CssMin;

/**
 * CssMin filter.
 *
 * Allows you to filter Css files through CssMin. You need to install CssMin with composer.
 */
class CssMinFilter extends AssetFilter {

/**
 * Apply CssMin to $content.
 *
 * @param string $filename target filename
 * @param string $content Content to filter.
 * @throws Exception
 * @return string
 */
	public function output($filename, $content) {
		if (!class_exists('CssMin')) {
			throw new Exception(sprintf('Cannot not load filter class "%s".', 'CssMin'));
		}
		return CssMin::minify($content);
	}

}

Fix fatal error when using CssMin filter.
Fix fatal error when using CssMin filter.
