mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
Merge pull request #10687 from xini/fix-classinfo-paths-windows
This commit is contained in:
commit
94b24b2390
@ -301,14 +301,14 @@ class ClassInfo
|
|||||||
*/
|
*/
|
||||||
public static function classes_for_file($filePath)
|
public static function classes_for_file($filePath)
|
||||||
{
|
{
|
||||||
$absFilePath = Director::getAbsFile($filePath);
|
$absFilePath = Convert::slashes(Director::getAbsFile($filePath));
|
||||||
$classManifest = ClassLoader::inst()->getManifest();
|
$classManifest = ClassLoader::inst()->getManifest();
|
||||||
$classes = $classManifest->getClasses();
|
$classes = $classManifest->getClasses();
|
||||||
$classNames = $classManifest->getClassNames();
|
$classNames = $classManifest->getClassNames();
|
||||||
|
|
||||||
$matchedClasses = [];
|
$matchedClasses = [];
|
||||||
foreach ($classes as $lowerClass => $compareFilePath) {
|
foreach ($classes as $lowerClass => $compareFilePath) {
|
||||||
if (strcasecmp($absFilePath ?? '', $compareFilePath ?? '') === 0) {
|
if (strcasecmp($absFilePath, Convert::slashes($compareFilePath ?? '')) === 0) {
|
||||||
$matchedClasses[$lowerClass] = $classNames[$lowerClass];
|
$matchedClasses[$lowerClass] = $classNames[$lowerClass];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -324,14 +324,14 @@ class ClassInfo
|
|||||||
*/
|
*/
|
||||||
public static function classes_for_folder($folderPath)
|
public static function classes_for_folder($folderPath)
|
||||||
{
|
{
|
||||||
$absFolderPath = Director::getAbsFile($folderPath);
|
$absFolderPath = Convert::slashes(Director::getAbsFile($folderPath));
|
||||||
$classManifest = ClassLoader::inst()->getManifest();
|
$classManifest = ClassLoader::inst()->getManifest();
|
||||||
$classes = $classManifest->getClasses();
|
$classes = $classManifest->getClasses();
|
||||||
$classNames = $classManifest->getClassNames();
|
$classNames = $classManifest->getClassNames();
|
||||||
|
|
||||||
$matchedClasses = [];
|
$matchedClasses = [];
|
||||||
foreach ($classes as $lowerClass => $compareFilePath) {
|
foreach ($classes as $lowerClass => $compareFilePath) {
|
||||||
if (stripos($compareFilePath ?? '', $absFolderPath ?? '') === 0) {
|
if (stripos(Convert::slashes($compareFilePath ?? ''), $absFolderPath) === 0) {
|
||||||
$matchedClasses[$lowerClass] = $classNames[$lowerClass];
|
$matchedClasses[$lowerClass] = $classNames[$lowerClass];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user