2018-09-21 23:43:06 +02:00
|
|
|
<?php namespace Todaymade\Daux\Format\HTML;
|
|
|
|
|
|
|
|
use Todaymade\Daux\GeneratorHelper;
|
|
|
|
|
2020-04-22 21:55:53 +02:00
|
|
|
trait HTMLUtils
|
|
|
|
{
|
2018-09-21 23:43:06 +02:00
|
|
|
public function ensureEmptyDestination($destination)
|
|
|
|
{
|
|
|
|
if (is_dir($destination)) {
|
|
|
|
GeneratorHelper::rmdir($destination);
|
|
|
|
} else {
|
|
|
|
mkdir($destination);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2020-04-22 22:24:52 +02:00
|
|
|
* Copy all files from $local to $destination.
|
2018-09-21 23:43:06 +02:00
|
|
|
*
|
|
|
|
* @param string $destination
|
|
|
|
* @param string $local_base
|
|
|
|
*/
|
|
|
|
public function copyThemes($destination, $local_base)
|
|
|
|
{
|
|
|
|
mkdir($destination . DIRECTORY_SEPARATOR . 'themes');
|
|
|
|
GeneratorHelper::copyRecursive(
|
|
|
|
$local_base,
|
|
|
|
$destination . DIRECTORY_SEPARATOR . 'themes'
|
|
|
|
);
|
|
|
|
}
|
2020-04-22 21:55:53 +02:00
|
|
|
}
|