--- a/php.nette2/src/org/netbeans/modules/php/nette2/Nette2FrameworkProvider.java +++ a/php.nette2/src/org/netbeans/modules/php/nette2/Nette2FrameworkProvider.java @@ -42,11 +42,17 @@ package org.netbeans.modules.php.nette2; import java.io.File; +import java.io.IOException; +import java.nio.file.Files; +import java.nio.file.LinkOption; +import java.nio.file.Path; import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; import java.util.List; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import org.netbeans.modules.php.api.framework.BadgeIcon; import org.netbeans.modules.php.api.phpmodule.PhpModule; import org.netbeans.modules.php.api.phpmodule.PhpModuleProperties; @@ -97,9 +103,9 @@ if (!result) { FileObject sourceDirectory = phpModule.getSourceDirectory(); if (sourceDirectory != null) { - FileObject bootstrap = sourceDirectory.getFileObject(Constants.COMMON_BOOTSTRAP_PATH); + FileObject bootstrap = getFileObject(sourceDirectory, Constants.COMMON_BOOTSTRAP_PATH); result = bootstrap != null && !bootstrap.isFolder() && bootstrap.isValid(); - FileObject config = sourceDirectory.getFileObject(Constants.COMMON_CONFIG_PATH); + FileObject config = getFileObject(sourceDirectory, Constants.COMMON_CONFIG_PATH); result = result && config != null && config.isFolder() && config.isValid(); } } @@ -181,4 +187,30 @@ return new Nette2CustomizerExtender(phpModule); } + /** + * Try to get a FileObject with correct filename case. See bug 238679. + * + * @param parent Parent FileObject. + * @param relPath Relative path, separated by slashes. + */ + private FileObject getFileObject(FileObject parent, String relPath) { + File parentFile = FileUtil.toFile(parent); + if (parentFile != null) { + String nativePath = relPath.replace('/', File.separatorChar); + try { + Path filePath = parentFile.toPath().resolve(nativePath); + if (!Files.exists(filePath)) { + return null; + } + Path realPath = filePath.toRealPath(LinkOption.NOFOLLOW_LINKS); + return FileUtil.toFileObject(realPath.toFile()); + } catch (IOException ex) { + Logger.getLogger(Nette2FrameworkProvider.class.getName()).log( + Level.FINE, null, ex); + return null; + } + } else { + return null; + } + } } --- a/php.symfony2/src/org/netbeans/modules/php/symfony2/commands/Symfony2Script.java +++ a/php.symfony2/src/org/netbeans/modules/php/symfony2/commands/Symfony2Script.java @@ -47,6 +47,9 @@ import java.io.IOException; import java.io.InputStreamReader; import java.io.Reader; +import java.nio.file.Files; +import java.nio.file.LinkOption; +import java.nio.file.Path; import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; @@ -117,7 +120,22 @@ // perhaps deleted app dir? fallback to default and let it fail later... return null; } - return appDir.getFileObject(SCRIPT_NAME); + File appDirFile = FileUtil.toFile(appDir); // #238679 + if (appDirFile != null) { + try { + Path filePath = appDirFile.toPath().resolve(SCRIPT_NAME); + if (!Files.exists(filePath)) { + return null; + } + Path realPath = filePath.toRealPath(LinkOption.NOFOLLOW_LINKS); + return FileUtil.toFileObject(realPath.toFile()); + } catch (IOException ex) { + LOGGER.log(Level.FINE, null, ex); + return null; + } + } else { + return null; + } } /**