private function copyDir($from, $to)
{
// FIXME implement native copy
$output = array();
$return = 0;
if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') {
// WINDOWS
$command = sprintf('XCOPY "%s" "%s" /hievry', $from, $to);
} else {
// *NIX
$command = sprintf('cp -rf %s %s', $from, $to);
}
exec($command, $output, $return);
if ($return !== 0) {
throw new \Exception('Could not copy directory');
}
return $this;
}