Skip to content

Commit 52acf8f

Browse files
author
Carlos Garcia
committed
Modificado Plugins::disable() para permitir desactivar la ejecución del Init::uninstall()
1 parent b50d5c6 commit 52acf8f

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

Core/Controller/Deploy.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
22
/**
33
* This file is part of FacturaScripts
4-
* Copyright (C) 2023 Carlos Garcia Gomez <carlos@facturascripts.com>
4+
* Copyright (C) 2023-2025 Carlos Garcia Gomez <carlos@facturascripts.com>
55
*
66
* This program is free software: you can redistribute it and/or modify
77
* it under the terms of the GNU Lesser General Public License as
@@ -83,7 +83,7 @@ protected function disablePluginsAction(): void
8383

8484
// desactivamos todos los plugins
8585
foreach (Plugins::enabled() as $name) {
86-
Plugins::disable($name);
86+
Plugins::disable($name, false);
8787
}
8888

8989
echo '<p>Plugins disabled.</p>';

Core/Plugins.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ public static function deploy(bool $clean = true, bool $initControllers = false)
126126
}
127127
}
128128

129-
public static function disable(string $pluginName): bool
129+
public static function disable(string $pluginName, bool $runPostDisable = true): bool
130130
{
131131
// si el plugin no existe o ya está desactivado, no hacemos nada
132132
$plugin = self::get($pluginName);
@@ -141,7 +141,7 @@ public static function disable(string $pluginName): bool
141141
if ($value->name === $pluginName) {
142142
self::$plugins[$key]->enabled = false;
143143
self::$plugins[$key]->post_enable = false;
144-
self::$plugins[$key]->post_disable = true;
144+
self::$plugins[$key]->post_disable = $runPostDisable;
145145
break;
146146
}
147147
}

0 commit comments

Comments
 (0)