1
|
|
|
<?php |
2
|
|
|
/* |
3
|
|
|
* Copyright (C) 2023 Joe Nilson <[email protected]> |
4
|
|
|
* |
5
|
|
|
* This program is free software: you can redistribute it and/or modify |
6
|
|
|
* it under the terms of the GNU Lesser General Public License as |
7
|
|
|
* published by the Free Software Foundation, either version 3 of the |
8
|
|
|
* License, or (at your option) any later version. |
9
|
|
|
* |
10
|
|
|
* This program is distributed in the hope that it will be useful, |
11
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
12
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
13
|
|
|
* GNU Lesser General Public License for more details. |
14
|
|
|
* You should have received a copy of the GNU Lesser General Public License |
15
|
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>. |
16
|
|
|
*/ |
17
|
|
|
|
18
|
|
|
namespace FacturaScripts\Plugins\fsRepublicaDominicana\Extension\Controller; |
19
|
|
|
|
20
|
|
|
use Closure; |
21
|
|
|
use FacturaScripts\Core\Base\DataBase; |
|
|
|
|
22
|
|
|
|
23
|
|
|
class EditSettings |
24
|
|
|
{ |
25
|
|
|
public function execAfterAction(): Closure |
26
|
|
|
{ |
27
|
|
|
return function($action) { |
28
|
|
|
//return $action; |
29
|
|
|
if ($action === 'fixfacturasprov') { |
30
|
|
|
$dataBase = new DataBase(); |
31
|
|
|
$sqlType = " CONSTRAINT "; |
32
|
|
|
if (FS_DB_TYPE === 'MYSQL') { |
|
|
|
|
33
|
|
|
$sqlType = " INDEX "; |
34
|
|
|
} |
35
|
|
|
$result = $dataBase->exec("ALTER TABLE FACTURASPROV DROP " . $sqlType . |
36
|
|
|
" IF EXISTS uniq_empresancf_facturasprov;"); |
37
|
|
|
//Exec drop if exists index uniq_empresancf_facturasprov |
38
|
|
|
if ($result) { |
39
|
|
|
self::toolBox()->i18nLog()->notice('success-drop-index-uniq_empresancf_facturasprov'); |
|
|
|
|
40
|
|
|
} else { |
41
|
|
|
self::toolBox()->i18nLog()->warning('error-drop-index-uniq_empresancf_facturasprov'); |
42
|
|
|
} |
43
|
|
|
|
44
|
|
|
|
45
|
|
|
} elseif ($action === 'fixfacturascli') { |
46
|
|
|
self::toolBox()->i18nLog()->notice('fixfacturascli'); |
47
|
|
|
} |
48
|
|
|
}; |
49
|
|
|
} |
50
|
|
|
|
51
|
|
|
} |
The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g.
excluded_paths: ["lib/*"]
, you can move it to the dependency path list as follows:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths