Skip to content

Commit cb34749

Browse files
authored
Merge pull request #168 from mcg-web/make-classmap-more-flexible
Make classmap more flexible
2 parents e37be73 + d1e0ffe commit cb34749

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

Generator/TypeGenerator.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,12 @@ public function compile(array $configs, $loadClasses = true)
195195
}
196196

197197
$classes = $this->generateClasses($configs, $cacheDir, true);
198-
file_put_contents($this->getClassesMap(), "<?php\nreturn ".var_export($classes, true).';');
198+
199+
$content = "<?php\nreturn ".var_export($classes, true).';';
200+
// replaced hard-coding absolute path by __DIR__ (see https://github.com/overblog/GraphQLBundle/issues/167)
201+
$content = str_replace(' => \''.$cacheDir, ' => __DIR__ . \'', $content);
202+
203+
file_put_contents($this->getClassesMap(), $content);
199204

200205
if ($loadClasses) {
201206
$this->loadClasses(true);

0 commit comments

Comments
 (0)