$file =
$fileinfo->
openFile('r'
);
while (!
$type && !
$file->
eof()) { preg_match('@^type:\s*(\'|")?(\w+)\1?\s*(?:\#.*)?$@',
$file->
fgets(),
$matches);
if (isset($matches[2
])) { $type =
$matches[2
];
} } if (empty($type)) { continue;
} $name =
$fileinfo->
getBasename('.info.yml'
);
$pathname =
$dir_prefix .
$fileinfo->
getSubPathname();
// Determine whether the extension has a main extension file.
// For theme engines, the file extension is .engine.
if ($type == 'theme_engine'
) { $filename =
$name . '.engine';
} // For profiles/modules/themes, it is the extension type.
else { $filename =
$name . '.' .
$type;
} if (!
file_exists($this->root . '/' .
dirname($pathname) . '/' .
$filename)) {