* @param pm
* @return
*/
@Override
public PhpModuleProperties getPhpModuleProperties(PhpModule pm) {
PhpModuleProperties properties = new PhpModuleProperties();
FileObject sourceDirectory = pm.getSourceDirectory();
if (sourceDirectory == null) {
return properties;
}
// set index file
FileObject index = sourceDirectory.getFileObject("index.php"); // NOI18N
if (index != null) {
properties = properties.setIndexFile(index);
}
// set include path
String path = YiiOptions.getInstance().getYiiScript();
if (path != null && !path.isEmpty()) {
path = path.replace(YiiScript.YII_SCRIPT_NAME_LONG, ""); // NOI18N
List<String> includePaths = Collections.singletonList(path);
properties = properties.setIncludePath(includePaths);
}
// add unit test and webroot directories
FileObject tests = sourceDirectory.getFileObject("protected/tests"); // NOI18N
if (tests != null) {
properties = properties.setTests(tests);
}
return properties;
}