#!/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
unlink('clientpack/index.htm');
unlink('clientpack/dcwebui.js');
unlink('clientpack/dcwebui.min.js');
unlink('clientpack/dcwebui.css');
unlink('clientpack/dcwebui.min.css');
unlink('clientpack/'.SIO_NAME);
rename('clientpack/index.min.htm', 'clientpack/index.htm');