akaunting/bootstrap/autoload.php

32 lines
767 B
PHP
Raw Permalink Normal View History

2017-09-14 22:21:00 +03:00
<?php
2020-06-28 00:24:03 +03:00
// Define minimum supported PHP version
2022-07-10 00:19:28 +03:00
define('AKAUNTING_PHP', '8.0.2');
2020-06-28 00:24:03 +03:00
// Check PHP version
if (version_compare(PHP_VERSION, AKAUNTING_PHP, '<')) {
2020-08-25 16:15:51 +03:00
$message = 'Error: Ask your hosting provider to use PHP ' . AKAUNTING_PHP . ' or higher for HTTP, CLI, and php command.' . PHP_EOL . PHP_EOL . 'Current PHP version: ' . PHP_VERSION . PHP_EOL;
2020-08-24 17:45:29 +03:00
if (defined('STDOUT')) {
fwrite(STDOUT, $message);
} else {
echo($message);
}
die(1);
2020-06-28 00:24:03 +03:00
}
2017-09-14 22:21:00 +03:00
2020-06-28 00:24:03 +03:00
// Load composer for core
require __DIR__ . '/../vendor/autoload.php';
2017-12-02 13:22:10 +03:00
// Load composer for modules
foreach (glob(__DIR__ . '/../modules/*') as $folder) {
$autoload = $folder . '/vendor/autoload.php';
2022-07-10 00:19:28 +03:00
if (! is_file($autoload)) {
2017-12-02 13:22:10 +03:00
continue;
}
require $autoload;
2020-06-28 00:24:03 +03:00
}