mirror of
https://github.com/slawkens/myaac.git
synced 2025-05-02 04:09:21 +02:00
Fixes regarding to init.php
This commit is contained in:
parent
c3dd10af96
commit
92024cfdbf
6
aac
6
aac
@ -9,14 +9,13 @@ if(!IS_CLI) {
|
||||
}
|
||||
|
||||
require_once SYSTEM . 'functions.php';
|
||||
require_once SYSTEM . 'init.php';
|
||||
|
||||
define('SELF_NAME', basename(__FILE__));
|
||||
|
||||
use MyAAC\Plugins;
|
||||
use Symfony\Component\Console\Application;
|
||||
|
||||
$application = new Application();
|
||||
$application = new Application('MyAAC', MYAAC_VERSION);
|
||||
|
||||
$commandsGlob = glob(SYSTEM . 'src/Commands/*.php');
|
||||
foreach ($commandsGlob as $item) {
|
||||
@ -34,7 +33,4 @@ foreach ($pluginCommands as $item) {
|
||||
$application->add(require $item);
|
||||
}
|
||||
|
||||
$application->setName('MyAAC');
|
||||
$application->setVersion(MYAAC_VERSION);
|
||||
|
||||
$application->run();
|
||||
|
@ -14,10 +14,10 @@ use MyAAC\CsrfToken;
|
||||
use MyAAC\Hooks;
|
||||
use MyAAC\Models\Town;
|
||||
use MyAAC\Settings;
|
||||
use MyAAC\Towns;
|
||||
|
||||
defined('MYAAC') or die('Direct access not allowed!');
|
||||
|
||||
global $config;
|
||||
if(!isset($config['installed']) || !$config['installed']) {
|
||||
throw new RuntimeException('MyAAC has not been installed yet or there was error during installation. Please install again.');
|
||||
}
|
||||
@ -46,6 +46,7 @@ if(isset($config['gzip_output']) && $config['gzip_output'] && isset($_SERVER['HT
|
||||
$cache = Cache::getInstance();
|
||||
|
||||
// event system
|
||||
global $hooks;
|
||||
$hooks = new Hooks();
|
||||
$hooks->load();
|
||||
|
||||
|
@ -16,6 +16,8 @@ class CacheClearCommand extends Command
|
||||
|
||||
protected function execute(InputInterface $input, OutputInterface $output): int
|
||||
{
|
||||
require SYSTEM . 'init.php';
|
||||
|
||||
$io = new SymfonyStyle($input, $output);
|
||||
|
||||
if (!clearCache()) {
|
||||
|
@ -2,12 +2,8 @@
|
||||
|
||||
namespace MyAAC\Commands;
|
||||
|
||||
use MyAAC\Hooks;
|
||||
use Symfony\Component\Console\Command\Command as SymfonyCommand;
|
||||
|
||||
class Command extends SymfonyCommand
|
||||
{
|
||||
public function __construct() {
|
||||
parent::__construct();
|
||||
}
|
||||
}
|
||||
|
@ -16,10 +16,11 @@ class CronjobCommand extends Command
|
||||
|
||||
protected function execute(InputInterface $input, OutputInterface $output): int
|
||||
{
|
||||
require SYSTEM . 'init.php';
|
||||
|
||||
// Create a new scheduler
|
||||
$scheduler = new Scheduler();
|
||||
|
||||
global $hooks;
|
||||
$hooks->trigger(HOOK_CRONJOB, ['scheduler' => $scheduler]);
|
||||
|
||||
// Let the scheduler execute jobs which are due.
|
||||
|
@ -17,6 +17,8 @@ class CronjobInstallCommand extends Command
|
||||
|
||||
protected function execute(InputInterface $input, OutputInterface $output): int
|
||||
{
|
||||
require SYSTEM . 'init.php';
|
||||
|
||||
$io = new SymfonyStyle($input, $output);
|
||||
|
||||
if (MYAAC_OS !== 'LINUX') {
|
||||
|
@ -21,6 +21,8 @@ class MailSendCommand extends Command
|
||||
|
||||
protected function execute(InputInterface $input, OutputInterface $output): int
|
||||
{
|
||||
require SYSTEM . 'init.php';
|
||||
|
||||
$io = new SymfonyStyle($input, $output);
|
||||
|
||||
if (!setting('core.mail_enabled')) {
|
||||
|
@ -21,6 +21,8 @@ class MigrateRunCommand extends Command
|
||||
|
||||
protected function execute(InputInterface $input, OutputInterface $output): int
|
||||
{
|
||||
require SYSTEM . 'init.php';
|
||||
|
||||
$io = new SymfonyStyle($input, $output);
|
||||
|
||||
$ids = $input->getArgument('id');
|
||||
|
@ -19,6 +19,8 @@ class PluginInstallCommand extends Command
|
||||
|
||||
protected function execute(InputInterface $input, OutputInterface $output): int
|
||||
{
|
||||
require SYSTEM . 'init.php';
|
||||
|
||||
$io = new SymfonyStyle($input, $output);
|
||||
|
||||
$pathToFile = $input->getArgument('plugin');
|
||||
|
@ -19,6 +19,8 @@ class PluginInstallInstallCommand extends Command
|
||||
|
||||
protected function execute(InputInterface $input, OutputInterface $output): int
|
||||
{
|
||||
require SYSTEM . 'init.php';
|
||||
|
||||
$io = new SymfonyStyle($input, $output);
|
||||
|
||||
$pluginName = $input->getArgument('plugin');
|
||||
|
@ -19,6 +19,8 @@ class SettingsResetCommand extends Command
|
||||
|
||||
protected function execute(InputInterface $input, OutputInterface $output): int
|
||||
{
|
||||
require SYSTEM . 'init.php';
|
||||
|
||||
$io = new SymfonyStyle($input, $output);
|
||||
|
||||
if (!$io->confirm('Are you sure you want to reset all settings in database?', false)) {
|
||||
|
@ -27,6 +27,8 @@ class SettingsSetCommand extends Command
|
||||
|
||||
protected function execute(InputInterface $input, OutputInterface $output): int
|
||||
{
|
||||
require SYSTEM . 'init.php';
|
||||
|
||||
$io = new SymfonyStyle($input, $output);
|
||||
|
||||
$key = $input->getArgument('key');
|
||||
|
Loading…
x
Reference in New Issue
Block a user