<?php

	header('Content-Type: text/css');
	//header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT');

	$CSS = '';
	$cssFiles = array_merge(rglob('ui/style/*.css'), rglob('custom/style/*.css'));

	array_unshift($cssFiles, 'reset.css');

	foreach($cssFiles as $cssFile) {

		$CSS .= file_get_contents($cssFile) . PHP_EOL . PHP_EOL;
	}

	echo $CSS;

	function rglob($_pattern, $_flags = 0) {

		$files = glob($_pattern, $_flags); 
		foreach(glob(dirname($_pattern) . '/*', GLOB_ONLYDIR | GLOB_NOSORT) as $dir) { $files = array_merge($files, rglob($dir . '/' . basename($_pattern), $_flags)); }
		return $files;
	}