Use composer for some libraries (twig, phpmailer, semver)

This commit is contained in:
slawkens 2020-10-27 07:34:05 +01:00
parent 9fe419cfe7
commit 73f1ba10f9
3 changed files with 19 additions and 1 deletions

4
.gitignore vendored
View File

@ -3,6 +3,10 @@ Thumbs.db
.idea .idea
tmp tmp
# composer
composer.lock
vendor
releases releases
config.local.php config.local.php
PERSONAL_NOTES PERSONAL_NOTES

View File

@ -67,6 +67,7 @@ define('PAGES', SYSTEM . 'pages/');
define('PLUGINS', BASE . 'plugins/'); define('PLUGINS', BASE . 'plugins/');
define('TEMPLATES', BASE . 'templates/'); define('TEMPLATES', BASE . 'templates/');
define('TOOLS', BASE . 'tools/'); define('TOOLS', BASE . 'tools/');
define('VENDOR', BASE . 'vendor/');
// menu categories // menu categories
define('MENU_CATEGORY_NEWS', 1); define('MENU_CATEGORY_NEWS', 1);
@ -115,4 +116,10 @@ if(!IS_CLI) {
require SYSTEM . 'exception.php'; 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: <a href="https://getcomposer.org/download">https://getcomposer.org/download</a>, install it and execute in the main MyAAC directory this command: <b>composer install</b>. Or download MyAAC from <a href="https://github.com/slawkens/myaac/releases">GitHub releases</a>, which includes Vendor folder.');
}
require $autoloadFile;

7
composer.json Normal file
View File

@ -0,0 +1,7 @@
{
"require": {
"phpmailer/phpmailer": "^6.1",
"composer/semver": "^3.2",
"twig/twig": "~1.42.5"
}
}