Code: Select all
<?php
/**
*
* @copyright (c) 2008 evil3
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
*
*/
function modx_from_to($root, $dir = '')
{
foreach (scandir($root . $dir) as $file)
{
if ($file != '.' && $file != '..' && $file != '.svn')
{
if (is_file($root . $dir . $file))
{
echo '<file from="root/' . $dir . $file . '" to="' . $dir . $file . '" />' . "\n";
}
else
{
modx_from_to($root, $dir . $file . '/');
}
}
}
}
header('Content-type: text/plain');
modx_from_to('./root/');
?>