@@ -18,6 +18,11 @@ class Reporter
1818 */
1919 private $ output ;
2020
21+ /**
22+ * @var string
23+ */
24+ protected $ templateDir ;
25+
2126 /**
2227 * @param Config $config
2328 * @param Output $output
@@ -26,6 +31,7 @@ public function __construct(Config $config, Output $output)
2631 {
2732 $ this ->config = $ config ;
2833 $ this ->output = $ output ;
34+ $ this ->templateDir = __DIR__ . '/../../../../templates ' ;
2935 }
3036
3137
@@ -65,27 +71,27 @@ public function generate(Metrics $metrics)
6571 if (!file_exists ($ logDir . '/fonts ' )) {
6672 mkdir ($ logDir . '/fonts ' , 0755 , true );
6773 }
68- recurse_copy (PROJECT_DIR . '/templates /html_report/js ' , $ logDir . '/js ' );
69- recurse_copy (PROJECT_DIR . '/templates /html_report/css ' , $ logDir . '/css ' );
70- recurse_copy (PROJECT_DIR . '/templates /html_report/images ' , $ logDir . '/images ' );
71- recurse_copy (PROJECT_DIR . '/templates /html_report/fonts ' , $ logDir . '/fonts ' );
74+ recurse_copy ($ this -> templateDir . '/html_report/js ' , $ logDir . '/js ' );
75+ recurse_copy ($ this -> templateDir . '/html_report/css ' , $ logDir . '/css ' );
76+ recurse_copy ($ this -> templateDir . '/html_report/images ' , $ logDir . '/images ' );
77+ recurse_copy ($ this -> templateDir . '/html_report/fonts ' , $ logDir . '/fonts ' );
7278
7379 // render dynamic pages
74- $ this ->renderPage (PROJECT_DIR . '/templates /html_report/index.php ' , $ logDir . '/index.html ' , $ consolidated , $ history );
75- $ this ->renderPage (PROJECT_DIR . '/templates /html_report/loc.php ' , $ logDir . '/loc.html ' , $ consolidated , $ history );
76- $ this ->renderPage (PROJECT_DIR . '/templates /html_report/relations.php ' , $ logDir . '/relations.html ' , $ consolidated , $ history );
77- $ this ->renderPage (PROJECT_DIR . '/templates /html_report/coupling.php ' , $ logDir . '/coupling.html ' , $ consolidated , $ history );
78- $ this ->renderPage (PROJECT_DIR . '/templates /html_report/all.php ' , $ logDir . '/all.html ' , $ consolidated , $ history );
79- $ this ->renderPage (PROJECT_DIR . '/templates /html_report/oop.php ' , $ logDir . '/oop.html ' , $ consolidated , $ history );
80- $ this ->renderPage (PROJECT_DIR . '/templates /html_report/complexity.php ' , $ logDir . '/complexity.html ' , $ consolidated , $ history );
81- $ this ->renderPage (PROJECT_DIR . '/templates /html_report/panel.php ' , $ logDir . '/panel.html ' , $ consolidated , $ history );
82- $ this ->renderPage (PROJECT_DIR . '/templates /html_report/violations.php ' , $ logDir . '/violations.html ' , $ consolidated , $ history );
83- $ this ->renderPage (PROJECT_DIR . '/templates /html_report/packages.php ' , $ logDir . '/packages.html ' , $ consolidated , $ history );
84- $ this ->renderPage (PROJECT_DIR . '/templates /html_report/package_relations.php ' , $ logDir . '/package_relations.html ' , $ consolidated , $ history );
80+ $ this ->renderPage ($ this -> templateDir . '/html_report/index.php ' , $ logDir . '/index.html ' , $ consolidated , $ history );
81+ $ this ->renderPage ($ this -> templateDir . '/html_report/loc.php ' , $ logDir . '/loc.html ' , $ consolidated , $ history );
82+ $ this ->renderPage ($ this -> templateDir . '/html_report/relations.php ' , $ logDir . '/relations.html ' , $ consolidated , $ history );
83+ $ this ->renderPage ($ this -> templateDir . '/html_report/coupling.php ' , $ logDir . '/coupling.html ' , $ consolidated , $ history );
84+ $ this ->renderPage ($ this -> templateDir . '/html_report/all.php ' , $ logDir . '/all.html ' , $ consolidated , $ history );
85+ $ this ->renderPage ($ this -> templateDir . '/html_report/oop.php ' , $ logDir . '/oop.html ' , $ consolidated , $ history );
86+ $ this ->renderPage ($ this -> templateDir . '/html_report/complexity.php ' , $ logDir . '/complexity.html ' , $ consolidated , $ history );
87+ $ this ->renderPage ($ this -> templateDir . '/html_report/panel.php ' , $ logDir . '/panel.html ' , $ consolidated , $ history );
88+ $ this ->renderPage ($ this -> templateDir . '/html_report/violations.php ' , $ logDir . '/violations.html ' , $ consolidated , $ history );
89+ $ this ->renderPage ($ this -> templateDir . '/html_report/packages.php ' , $ logDir . '/packages.html ' , $ consolidated , $ history );
90+ $ this ->renderPage ($ this -> templateDir . '/html_report/package_relations.php ' , $ logDir . '/package_relations.html ' , $ consolidated , $ history );
8591 if ($ this ->config ->has ('git ' )) {
86- $ this ->renderPage (PROJECT_DIR . '/templates /html_report/git.php ' , $ logDir . '/git.html ' , $ consolidated , $ history );
92+ $ this ->renderPage ($ this -> templateDir . '/html_report/git.php ' , $ logDir . '/git.html ' , $ consolidated , $ history );
8793 }
88- $ this ->renderPage (PROJECT_DIR . '/templates /html_report/junit.php ' , $ logDir . '/junit.html ' , $ consolidated , $ history );
94+ $ this ->renderPage ($ this -> templateDir . '/html_report/junit.php ' , $ logDir . '/junit.html ' , $ consolidated , $ history );
8995
9096 // js data
9197 file_put_contents (
0 commit comments