diff --git a/CHANGELOG-1.x.md b/CHANGELOG-1.x.md index 34439313..28c946ec 100644 --- a/CHANGELOG-1.x.md +++ b/CHANGELOG-1.x.md @@ -1,5 +1,14 @@ # Changelog +## [1.7.1 - 27.06.2025] + +### Changed +* Rename plugin:install:install to plugin:setup, also add alias to previous command (https://github.com/slawkens/myaac/commit/13d33822b59df349199e885a78a3d6beb0863d0b) + +### Fixed +* Fix commands: setup + cache:clear (https://github.com/slawkens/myaac/commit/0da524fefe93b3028392e9014550eea3324d3a22, https://github.com/slawkens/myaac/commit/fe8281594e989f00280ba1adc734a9198c6b5cc1) +* Fix polls link in tibiacom template (https://github.com/slawkens/myaac/commit/d90fa323d7c77d81768df60feeb1c374b1650a0c) + ## [1.7 - 22.06.2025] ### Added diff --git a/system/functions.php b/system/functions.php index 3ef7a8a2..540c9af3 100644 --- a/system/functions.php +++ b/system/functions.php @@ -1275,9 +1275,6 @@ function clearCache() deleteDirectory(CACHE . 'plugins', ['index.html'], true); deleteDirectory(CACHE, ['signatures', 'twig', 'plugins', 'index.html', 'persistent'], true); - // routes cache - clearRouteCache(); - global $hooks; $hooks->trigger(HOOK_CACHE_CLEAR, ['cache' => Cache::getInstance()]); diff --git a/system/pages/404.php b/system/pages/404.php index 90a8921a..60fb66aa 100644 --- a/system/pages/404.php +++ b/system/pages/404.php @@ -8,7 +8,7 @@ * @link https://my-aac.org */ defined('MYAAC') or die('Direct access not allowed!'); -$title = '404 Not Found'; +$title = 'Not Found'; header('HTTP/1.0 404 Not Found'); ?> diff --git a/system/pages/405.php b/system/pages/405.php index 3d585f59..d1eee43a 100644 --- a/system/pages/405.php +++ b/system/pages/405.php @@ -8,7 +8,7 @@ * @link https://my-aac.org */ defined('MYAAC') or die('Direct access not allowed!'); -$title = '405 Method Not Allowed'; +$title = 'Method Not Allowed'; header('HTTP/1.0 405 Method Not Allowed'); ?> diff --git a/system/src/Commands/CacheClearCommand.php b/system/src/Commands/CacheClearCommand.php index 3b052995..5b1715b5 100644 --- a/system/src/Commands/CacheClearCommand.php +++ b/system/src/Commands/CacheClearCommand.php @@ -17,10 +17,7 @@ class CacheClearCommand extends Command protected function execute(InputInterface $input, OutputInterface $output): int { - global $hooks; - $hooks = new Hooks(); - $hooks->load(); - $hooks->trigger(HOOK_INIT); + require SYSTEM . 'init.php'; $io = new SymfonyStyle($input, $output); diff --git a/system/src/Commands/MailSendCommand.php b/system/src/Commands/MailSendCommand.php index ff1450e6..983e6fc5 100644 --- a/system/src/Commands/MailSendCommand.php +++ b/system/src/Commands/MailSendCommand.php @@ -12,9 +12,10 @@ class MailSendCommand extends Command { protected function configure(): void { - $this->setName('mail:send') + $this->setName('email:send') + ->setAliases(['mail:send']) ->setDescription('This command sends E-Mail to single user. Message can be provided as follows: ' . PHP_EOL - . ' echo "Hello World" | php sa email:send --subject="This is the subject" test@test.com') + . ' echo "Hello World" | php aac email:send --subject="This is the subject" test@test.com') ->addArgument('recipient', InputArgument::REQUIRED, 'Email, Account Name, Account id or Player Name') ->addOption('subject', 's', InputOption::VALUE_REQUIRED, 'Subject'); } diff --git a/system/src/Commands/PluginInstallInstallCommand.php b/system/src/Commands/PluginInstallInstallCommand.php index fe1b4f14..116eeb13 100644 --- a/system/src/Commands/PluginInstallInstallCommand.php +++ b/system/src/Commands/PluginInstallInstallCommand.php @@ -12,7 +12,8 @@ class PluginInstallInstallCommand extends Command { protected function configure(): void { - $this->setName('plugin:install:install') + $this->setName('plugin:setup') + ->setAliases(['plugin:install:install']) ->setDescription('This command executes the "install" part of the plugin') ->addArgument('plugin', InputArgument::REQUIRED, 'Plugin name'); } diff --git a/system/src/Plugins.php b/system/src/Plugins.php index 85f0a2ba..c880dd90 100644 --- a/system/src/Plugins.php +++ b/system/src/Plugins.php @@ -781,15 +781,20 @@ class Plugins { return false; } - if(!isset($plugin_json['install'])) { - self::$error = "Plugin doesn't have install options defined. Skipping..."; + $install = $plugin_json['install'] ?? ''; + if (self::getAutoLoadOption($plugin_json, 'install', true) && is_file(PLUGINS . $plugin_name . '/install.php')) { + $install = 'plugins/' . $plugin_name . '/install.php'; + } + + if (empty($install)) { + self::$error = "This plugin doesn't seem to have install script defined."; return false; } global $db; - if (file_exists(BASE . $plugin_json['install'])) { + if (file_exists(BASE . $install)) { $db->revalidateCache(); - require BASE . $plugin_json['install']; + require BASE . $install; $db->revalidateCache(); } else { diff --git a/templates/tibiacom/boxes/templates/poll.html.twig b/templates/tibiacom/boxes/templates/poll.html.twig index 0b643ee5..25f10865 100644 --- a/templates/tibiacom/boxes/templates/poll.html.twig +++ b/templates/tibiacom/boxes/templates/poll.html.twig @@ -1,6 +1,6 @@
diff --git a/templates/tibiacom/index.php b/templates/tibiacom/index.php index 6d0d1e63..46ef0698 100644 --- a/templates/tibiacom/index.php +++ b/templates/tibiacom/index.php @@ -454,7 +454,7 @@ foreach($config['menu_categories'] as $id => $cat) { foreach($config['boxes'] as $box) { /** @var string $template_name */ - $file = TEMPLATES . $template_name . '/boxes/' . $box . '.php'; + $file = __DIR__ . '/boxes/' . $box . '.php'; if(file_exists($file)) { include($file); ?>