public function mergeViewsSpec(array $spec)
{
foreach ($spec as $viewtype => $list) {
foreach ($list as $view => $paths) {
if (!is_array($paths)) {
$paths = [$paths];
}
foreach ($paths as $path) {
if (preg_match('~^([/\\\\]|[a-zA-Z]\\:)~', $path)) {
// absolute path
} else {
// relative path
$path = Directory\Local::root()->getPath($path);
}
if (substr($view, -1) === '/') {
// prefix
$this->autoregisterViews($view, $path, $viewtype);
} else {
$this->setViewLocation($view, $viewtype, $path);
}
}
}
}
}