I found the anwser finaly.
function _getComponentGroupsFromDirectory($directory)
{
$aGroups = array();
if (is_readable($directory))
{
if ($aFiles = scandir($directory))
{
foreach ($aFiles as $i => $name)
{
if (substr($name, 0, 1) == '.')
{
continue;
}
if (is_dir($directory.$name))
{
$aGroups[] = $name;
}
}
}
}
return $aGroups;
}
Because my server disabled the function "scandir" as default. Turn it on it is worked well.