Skip to content

Commit 6c7f388

Browse files
committed
move templates out of src
1 parent 55a7790 commit 6c7f388

39 files changed

+19
-18
lines changed

bin/phpmetrics

+2
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,6 @@ if (
1717
);
1818
};
1919

20+
define('PROJECT_DIR', dirname(__DIR__));
21+
2022
(new \Hal\Application\Application())->run($argv);

src/Hal/Report/Html/Reporter.php

+17-18
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88

99
class Reporter
1010
{
11-
1211
/**
1312
* @var Config
1413
*/
@@ -66,27 +65,27 @@ public function generate(Metrics $metrics)
6665
if (!file_exists($logDir . '/fonts')) {
6766
mkdir($logDir . '/fonts', 0755, true);
6867
}
69-
recurse_copy(__DIR__ . '/template/js', $logDir . '/js');
70-
recurse_copy(__DIR__ . '/template/css', $logDir . '/css');
71-
recurse_copy(__DIR__ . '/template/images', $logDir . '/images');
72-
recurse_copy(__DIR__ . '/template/fonts', $logDir . '/fonts');
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');
7372

7473
// render dynamic pages
75-
$this->renderPage(__DIR__ . '/template/index.php', $logDir . '/index.html', $consolidated, $history);
76-
$this->renderPage(__DIR__ . '/template/loc.php', $logDir . '/loc.html', $consolidated, $history);
77-
$this->renderPage(__DIR__ . '/template/relations.php', $logDir . '/relations.html', $consolidated, $history);
78-
$this->renderPage(__DIR__ . '/template/coupling.php', $logDir . '/coupling.html', $consolidated, $history);
79-
$this->renderPage(__DIR__ . '/template/all.php', $logDir . '/all.html', $consolidated, $history);
80-
$this->renderPage(__DIR__ . '/template/oop.php', $logDir . '/oop.html', $consolidated, $history);
81-
$this->renderPage(__DIR__ . '/template/complexity.php', $logDir . '/complexity.html', $consolidated, $history);
82-
$this->renderPage(__DIR__ . '/template/panel.php', $logDir . '/panel.html', $consolidated, $history);
83-
$this->renderPage(__DIR__ . '/template/violations.php', $logDir . '/violations.html', $consolidated, $history);
84-
$this->renderPage(__DIR__ . '/template/packages.php', $logDir . '/packages.html', $consolidated, $history);
85-
$this->renderPage(__DIR__ . '/template/package_relations.php', $logDir . '/package_relations.html', $consolidated, $history);
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);
8685
if ($this->config->has('git')) {
87-
$this->renderPage(__DIR__ . '/template/git.php', $logDir . '/git.html', $consolidated, $history);
86+
$this->renderPage(PROJECT_DIR . '/templates/html_report/git.php', $logDir . '/git.html', $consolidated, $history);
8887
}
89-
$this->renderPage(__DIR__ . '/template/junit.php', $logDir . '/junit.html', $consolidated, $history);
88+
$this->renderPage(PROJECT_DIR . '/templates/html_report/junit.php', $logDir . '/junit.html', $consolidated, $history);
9089

9190
// js data
9291
file_put_contents(
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)