protected function extractPathArrays(array $paths)
{
$templateRootPaths = array();
$layoutRootPaths = array();
$partialRootPaths = array();
// Modern plural paths configurations: sorted reverse by key to
// check the path with the highest number first.
if (TRUE === isset($paths[self::CONFIG_TEMPLATEROOTPATHS]) && TRUE === is_array($paths[self::CONFIG_TEMPLATEROOTPATHS])) {
krsort($paths[self::CONFIG_TEMPLATEROOTPATHS], SORT_NUMERIC);
$templateRootPaths = array_merge($templateRootPaths, array_values($paths[self::CONFIG_TEMPLATEROOTPATHS]));
}
if (TRUE === isset($paths[self::CONFIG_LAYOUTROOTPATHS]) && TRUE === is_array($paths[self::CONFIG_LAYOUTROOTPATHS])) {
krsort($paths[self::CONFIG_LAYOUTROOTPATHS], SORT_NUMERIC);
$layoutRootPaths = array_merge($layoutRootPaths, array_values($paths[self::CONFIG_LAYOUTROOTPATHS]));
}
if (TRUE === isset($paths[self::CONFIG_PARTIALROOTPATHS]) && TRUE === is_array($paths[self::CONFIG_PARTIALROOTPATHS])) {
krsort($paths[self::CONFIG_PARTIALROOTPATHS], SORT_NUMERIC);
$partialRootPaths = array_merge($partialRootPaths, array_values($paths[self::CONFIG_PARTIALROOTPATHS]));
}
// translate all paths to absolute paths
$templateRootPaths = array_map(array($this, 'ensureAbsolutePath'), $templateRootPaths);
$layoutRootPaths = array_map(array($this, 'ensureAbsolutePath'), $layoutRootPaths);
$partialRootPaths = array_map(array($this, 'ensureAbsolutePath'), $partialRootPaths);
$templateRootPaths = array_unique($templateRootPaths);
$partialRootPaths = array_unique($partialRootPaths);
$layoutRootPaths = array_unique($layoutRootPaths);
$templateRootPaths = array_values($templateRootPaths);
$layoutRootPaths = array_values($layoutRootPaths);
$partialRootPaths = array_values($partialRootPaths);
$pathCollections = array($templateRootPaths, $layoutRootPaths, $partialRootPaths);
return $pathCollections;
}