diff --git a/.gitignore b/.gitignore
index 05b968a..2e65b3b 100644
--- a/.gitignore
+++ b/.gitignore
@@ -18,10 +18,10 @@ cache/
!/logs/.gitkeep
# excludes modules
-/src/Modules/*
+modules/*
# but allow example module
-!/src/Modules/ModuleName/
+!modules/ModuleName/
# OS Related Exclusions (used: https://gitignore.io/)
diff --git a/composer.json b/composer.json
index 54bd4b7..e911ecc 100644
--- a/composer.json
+++ b/composer.json
@@ -12,10 +12,10 @@
"autoload": {
"psr-4": {
"DeltaCMS\\": "src/DeltaCMS",
- "": "src/Modules"
+ "": "modules"
},
"exclude-from-classmap": [
- "src/Modules"
+ "modules"
],
"files": [
"src/DeltaCMS/Functions.php"
@@ -44,10 +44,10 @@
"scripts": {
"phpunit": "phpunit --coverage-text --colors=never",
"codacy": "codacycoverage clover tmp/code-coverage.xml",
- "phpstan": "phpstan analyse src/DeltaCMS public tests --level=max",
+ "phpstan": "phpstan analyse src modules/ModuleName public tests --level=max",
"phpcs": "phpcs",
- "phpmd": "vendor/bin/phpmd . text phpmd --exclude vendor/,cache/",
+ "phpmd": "vendor/bin/phpmd src,modules/ModuleName,public text phpmd",
"test": "composer run phpunit && composer run phpstan",
"quality": "composer run phpmd && composer run phpcs",
diff --git a/src/Modules/ModuleName/Controller/ExampleController.php b/modules/ModuleName/Controller/ExampleController.php
similarity index 100%
rename from src/Modules/ModuleName/Controller/ExampleController.php
rename to modules/ModuleName/Controller/ExampleController.php
diff --git a/src/Modules/ModuleName/modulename.json b/modules/ModuleName/modulename.json
similarity index 100%
rename from src/Modules/ModuleName/modulename.json
rename to modules/ModuleName/modulename.json
diff --git a/phpcs.xml b/phpcs.xml
index 719322a..4cb90d1 100644
--- a/phpcs.xml
+++ b/phpcs.xml
@@ -2,4 +2,7 @@
The PSR-12 coding standard.
src
+ public
+ modules
+ tests
diff --git a/phpunit.xml b/phpunit.xml
index 1716d41..4bdf5ce 100644
--- a/phpunit.xml
+++ b/phpunit.xml
@@ -6,7 +6,7 @@
bootstrap="vendor/autoload.php"
cacheResult="false"
cacheTokens="false"
- colors="true"
+ colors="false"
convertErrorsToExceptions="true"
convertNoticesToExceptions="true"
convertWarningsToExceptions="true"
@@ -25,7 +25,8 @@
verbose="false">
- src/DeltaCMS
+ src
+ public
diff --git a/production.txt b/production.txt
index 222a310..a4f3620 100644
--- a/production.txt
+++ b/production.txt
@@ -2,6 +2,7 @@ logs/
src/
vendor/
public/
+modules/
CHANGELOG.md
LICENSE
README.md
diff --git a/public/index.php b/public/index.php
index 4ce9b88..d7083e6 100644
--- a/public/index.php
+++ b/public/index.php
@@ -31,7 +31,7 @@ $caches = (array) $cache->getMultiple(array(
$cachesBool = $caches["routes"] === null || $caches['templates'] === null || $caches['forms'] === null;
if (!$ap->isCacheEnabled() || $cachesBool) {
$cache->clear();
- $modulesDIR = dirname(__DIR__) . "/src/Modules";
+ $modulesDIR = dirname(__DIR__) . "/modules";
$dirs = scandir($modulesDIR);
if ($dirs === false) {
throw new Exception("Modules folder seems is not readable, Exiting", 1);
diff --git a/src/DeltaCMS/DeltaCMS.php b/src/DeltaCMS/DeltaCMS.php
index 4e7ce6d..625e572 100644
--- a/src/DeltaCMS/DeltaCMS.php
+++ b/src/DeltaCMS/DeltaCMS.php
@@ -95,7 +95,7 @@ class DeltaCMS
{
if (!isset($this->em)) {
$config = Setup::createAnnotationMetadataConfiguration(array(
- $this->root . "/Modules/Aptatio/DB"
+ dirname($this->root) . "/modules/Aptatio/DB"
), true);
$db = $this->settings->database;
diff --git a/tests/LoggerTest.php b/tests/LoggerTest.php
index 67017f8..25f4258 100644
--- a/tests/LoggerTest.php
+++ b/tests/LoggerTest.php
@@ -41,7 +41,15 @@ final class LoggerTest extends TestCase
));
$this->assertStringEqualsFile(
$this->file,
- "[Alert]: " . (new \DateTime())->format("Y-m-d H:i:s") . " test\n[Alert]: " . (new \DateTime())->format("Y-m-d H:i:s") . " 0 " . $exception->getFile() . "[Exception] 0 " . $exception->getMessage() . "\n"
+ "[Alert]: " .
+ (new \DateTime())->format("Y-m-d H:i:s") .
+ " test\n[Alert]: " .
+ (new \DateTime())->format("Y-m-d H:i:s") .
+ " 0 " .
+ $exception->getFile() .
+ "[Exception] 0 " .
+ $exception->getMessage() .
+ "\n"
);
}