1
0
mirror of https://github.com/e107inc/e107.git synced 2025-07-31 20:00:37 +02:00

New feature: Create a new theme from an existing one. See: e107_admin/theme.php?mode=convert

This commit is contained in:
Cameron
2017-01-31 07:52:19 -08:00
parent 6531a68e00
commit 363a5e4c4c
4 changed files with 313 additions and 82 deletions

View File

@@ -880,7 +880,43 @@ class e_file
}
/**
* Copy a file, or copy the contents of a folder.
* @param string $source Source path
* @param string $dest Destination path
* @param int $perm
* @return bool Returns true on success, false on error
*/
function copy($source, $dest, $perm = 0755)
{
// Simple copy for a file
if(is_file($source))
{
return copy($source, $dest);
}
// Make destination directory
if(!is_dir($dest))
{
mkdir($dest, $perm);
}
// Directory - so copy it.
$dir = scandir($source);
foreach($dir as $folder)
{
// Skip pointers
if($folder === '.' || $folder == '..')
{
continue;
}
$this->copy("$source/$folder", "$dest/$folder", $perm);
}
return true;
}
/**