This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

View | Details | Raw Unified | Return to bug 238679
Collapse All | Expand All

(-)a/php.nette2/src/org/netbeans/modules/php/nette2/Nette2FrameworkProvider.java (-2 / +27 lines)
Lines 42-52 Link Here
42
package org.netbeans.modules.php.nette2;
42
package org.netbeans.modules.php.nette2;
43
43
44
import java.io.File;
44
import java.io.File;
45
import java.io.IOException;
45
import java.util.ArrayList;
46
import java.util.ArrayList;
46
import java.util.Arrays;
47
import java.util.Arrays;
47
import java.util.Collections;
48
import java.util.Collections;
48
import java.util.List;
49
import java.util.List;
49
import java.util.Set;
50
import java.util.Set;
51
import java.util.logging.Level;
52
import java.util.logging.Logger;
50
import org.netbeans.modules.php.api.framework.BadgeIcon;
53
import org.netbeans.modules.php.api.framework.BadgeIcon;
51
import org.netbeans.modules.php.api.phpmodule.PhpModule;
54
import org.netbeans.modules.php.api.phpmodule.PhpModule;
52
import org.netbeans.modules.php.api.phpmodule.PhpModuleProperties;
55
import org.netbeans.modules.php.api.phpmodule.PhpModuleProperties;
Lines 97-105 Link Here
97
        if (!result) {
100
        if (!result) {
98
            FileObject sourceDirectory = phpModule.getSourceDirectory();
101
            FileObject sourceDirectory = phpModule.getSourceDirectory();
99
            if (sourceDirectory != null) {
102
            if (sourceDirectory != null) {
100
                FileObject bootstrap = sourceDirectory.getFileObject(Constants.COMMON_BOOTSTRAP_PATH);
103
                FileObject bootstrap = getFileObject(sourceDirectory, Constants.COMMON_BOOTSTRAP_PATH);
101
                result = bootstrap != null && !bootstrap.isFolder() && bootstrap.isValid();
104
                result = bootstrap != null && !bootstrap.isFolder() && bootstrap.isValid();
102
                FileObject config = sourceDirectory.getFileObject(Constants.COMMON_CONFIG_PATH);
105
                FileObject config = getFileObject(sourceDirectory, Constants.COMMON_CONFIG_PATH);
103
                result = result && config != null && config.isFolder() && config.isValid();
106
                result = result && config != null && config.isFolder() && config.isValid();
104
            }
107
            }
105
        }
108
        }
Lines 181-184 Link Here
181
        return new Nette2CustomizerExtender(phpModule);
184
        return new Nette2CustomizerExtender(phpModule);
182
    }
185
    }
183
186
187
    /**
188
     * Try to get a FileObject with correct filename case. See bug 238679.
189
     *
190
     * @param parent Parent FileObject.
191
     * @param relPath Relative path, separated by slashes.
192
     */
193
    private FileObject getFileObject(FileObject parent, String relPath) {
194
        File parentFile = FileUtil.toFile(parent);
195
        if (parentFile != null) {
196
            String nativePath = relPath.replace('/', File.separatorChar);
197
            try {
198
                File retFile = new File(parentFile, nativePath).getCanonicalFile();
199
                return FileUtil.toFileObject(retFile);
200
            } catch (IOException ex) {
201
                Logger.getLogger(Nette2FrameworkProvider.class.getName()).log(
202
                        Level.FINE, null, ex);
203
                return null;
204
            }
205
        } else {
206
            return null;
207
        }
208
    }
184
}
209
}
(-)a/php.symfony2/src/org/netbeans/modules/php/symfony2/commands/Symfony2Script.java (-1 / +13 lines)
Lines 68-73 Link Here
68
import org.openide.NotifyDescriptor;
68
import org.openide.NotifyDescriptor;
69
import org.openide.filesystems.FileObject;
69
import org.openide.filesystems.FileObject;
70
import org.openide.filesystems.FileUtil;
70
import org.openide.filesystems.FileUtil;
71
import org.openide.util.Exceptions;
71
import org.openide.util.NbBundle;
72
import org.openide.util.NbBundle;
72
import org.openide.util.NbBundle.Messages;
73
import org.openide.util.NbBundle.Messages;
73
import org.openide.windows.InputOutput;
74
import org.openide.windows.InputOutput;
Lines 117-123 Link Here
117
            // perhaps deleted app dir? fallback to default and let it fail later...
118
            // perhaps deleted app dir? fallback to default and let it fail later...
118
            return null;
119
            return null;
119
        }
120
        }
120
        return appDir.getFileObject(SCRIPT_NAME);
121
        File appDirFile = FileUtil.toFile(appDir); // #238679
122
        if (appDirFile != null) {
123
            try {
124
                File retFile = new File(appDirFile, SCRIPT_NAME).getCanonicalFile();
125
                return FileUtil.toFileObject(retFile);
126
            } catch (IOException ex) {
127
                LOGGER.log(Level.FINE, null, ex);
128
                return null;
129
            }
130
        } else {
131
            return null;
132
        }
121
    }
133
    }
122
134
123
    /**
135
    /**

Return to bug 238679