Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
base fork: playframework/play1
...
head fork: IMIS/play
Checking mergeability… Don’t worry, you can still create the pull request.
  • 3 commits
  • 1 file changed
  • 0 commit comments
  • 2 contributors
Showing with 19 additions and 15 deletions.
  1. +19 −15 framework/src/play/Play.java
View
34 framework/src/play/Play.java
@@ -117,9 +117,9 @@ public boolean isProd() {
*/
public static Map<String, VirtualFile> modulesRoutes;
/**
- * The main application.conf
+ * The loaded configuration files
*/
- public static VirtualFile conf;
+ public static Set<VirtualFile> confs = new HashSet<VirtualFile>(1);
/**
* The app configuration (already resolved from the framework id)
*/
@@ -337,23 +337,23 @@ public static void guessFrameworkPath() {
* Read application.conf and resolve overriden key using the play id mechanism.
*/
public static void readConfiguration() {
- configuration = readOneConfigurationFile("application.conf", new HashSet<String>());
+ confs = new HashSet<VirtualFile>(1);
+ configuration = readOneConfigurationFile("application.conf");
// Plugins
pluginCollection.onConfigurationRead();
}
- private static Properties readOneConfigurationFile(String filename, Set<String> seenFileNames) {
-
- if (seenFileNames.contains(filename)) {
- throw new RuntimeException("Detected recursive @include usage. Have seen the file " + filename + " before");
- }
- seenFileNames.add(filename);
-
+ private static Properties readOneConfigurationFile(String filename) {
Properties propsFromFile=null;
VirtualFile appRoot = VirtualFile.open(applicationPath);
- conf = appRoot.child("conf/" + filename);
+
+ VirtualFile conf = appRoot.child("conf/" + filename);
+ if (confs.contains(conf)) {
+ throw new RuntimeException("Detected recursive @include usage. Have seen the file " + filename + " before");
+ }
+
try {
propsFromFile = IO.readUtf8Properties(conf.inputstream());
} catch (RuntimeException e) {
@@ -362,6 +362,8 @@ private static Properties readOneConfigurationFile(String filename, Set<String>
fatalServerErrorOccurred();
}
}
+ confs.add(conf);
+
// OK, check for instance specifics configuration
Properties newConfiguration = new OrderSafeProperties();
Pattern pattern = Pattern.compile("^%([a-zA-Z0-9_\\-]+)\\.(.*)$");
@@ -415,7 +417,7 @@ private static Properties readOneConfigurationFile(String filename, Set<String>
if (key.toString().startsWith("@include.")) {
try {
String filenameToInclude = propsFromFile.getProperty(key.toString());
- toInclude.putAll( readOneConfigurationFile(filenameToInclude, seenFileNames) );
+ toInclude.putAll( readOneConfigurationFile(filenameToInclude) );
} catch (Exception ex) {
Logger.warn("Missing include: %s", key);
}
@@ -612,9 +614,11 @@ public static synchronized void detectChanges() {
classloader.detectChanges();
}
Router.detectChanges(ctxPath);
- if (conf.lastModified() > startedAt) {
- start();
- return;
+ for(VirtualFile conf : confs) {
+ if (conf.lastModified() > startedAt) {
+ start();
+ return;
+ }
}
pluginCollection.detectChange();
if (!Play.started) {

No commit comments for this range

Something went wrong with that request. Please try again.