#!/usr/bin/php
]+dcwebui.css[^>]*>~', function() { return ''; }, $html_content);
// Embed JS into HTML file
$html_content = preg_replace_callback('~'; }, $html_content);
// Embed socketio into HTML file
define('SIO_NAME', 'socket.io-1.7.2.js');
$html_content = preg_replace_callback('~'; }, $html_content);
// Minify the combined file
file_put_contents('clientpack/index.htm', $html_content);
`html-minifier --collapse-whitespace -o clientpack/index.min.htm clientpack/index.htm`;
// Clean up files
`rm clientpack/{index.htm,dcwebui{.min,}.js,dcwebui{.min,}.css}`;
unlink('clientpack/'.SIO_NAME);
rename('clientpack/index.min.htm', 'clientpack/index.htm');