diff --git a/.gitignore b/.gitignore index af74f1e7..eaf66084 100644 --- a/.gitignore +++ b/.gitignore @@ -3,6 +3,10 @@ Thumbs.db .idea tmp +# composer +composer.lock +vendor + releases config.local.php PERSONAL_NOTES diff --git a/common.php b/common.php index a97a6be5..415c3d1e 100644 --- a/common.php +++ b/common.php @@ -67,6 +67,7 @@ define('PAGES', SYSTEM . 'pages/'); define('PLUGINS', BASE . 'plugins/'); define('TEMPLATES', BASE . 'templates/'); define('TOOLS', BASE . 'tools/'); +define('VENDOR', BASE . 'vendor/'); // menu categories define('MENU_CATEGORY_NEWS', 1); @@ -115,4 +116,10 @@ if(!IS_CLI) { require SYSTEM . 'exception.php'; } -require SYSTEM . 'autoload.php'; + +$autoloadFile = VENDOR . 'autoload.php'; +if (!is_file($autoloadFile)) { + throw new RuntimeException('The vendor folder is missing. Please download Composer: https://getcomposer.org/download, install it and execute in the main MyAAC directory this command: composer install. Or download MyAAC from GitHub releases, which includes Vendor folder.'); +} + +require $autoloadFile; diff --git a/composer.json b/composer.json new file mode 100644 index 00000000..d91b02ee --- /dev/null +++ b/composer.json @@ -0,0 +1,7 @@ +{ + "require": { + "phpmailer/phpmailer": "^6.1", + "composer/semver": "^3.2", + "twig/twig": "~1.42.5" + } +}