Passed
Push — develop ( 4ee49c...50b447 )
by Nikolay
05:12
created

UpdateConfigsUpToVer20220316::addNewCodecs()   A

Complexity

Conditions 5
Paths 6

Size

Total Lines 19
Code Lines 16

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 16
c 1
b 0
f 0
dl 0
loc 19
rs 9.4222
cc 5
nc 6
nop 1
1
<?php
2
/*
3
 * MikoPBX - free phone system for small business
4
 * Copyright © 2017-2023 Alexey Portnov and Nikolay Beketov
5
 *
6
 * This program is free software: you can redistribute it and/or modify
7
 * it under the terms of the GNU General Public License as published by
8
 * the Free Software Foundation; either version 3 of the License, or
9
 * (at your option) any later version.
10
 *
11
 * This program is distributed in the hope that it will be useful,
12
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14
 * GNU General Public License for more details.
15
 *
16
 * You should have received a copy of the GNU General Public License along with this program.
17
 * If not, see <https://www.gnu.org/licenses/>.
18
 */
19
20
namespace MikoPBX\Core\System\Upgrade\Releases;
21
22
use MikoPBX\Common\Models\Codecs;
23
use MikoPBX\Common\Models\Extensions;
24
use MikoPBX\Common\Models\FirewallRules;
25
use MikoPBX\Common\Models\NetworkFilters;
26
use MikoPBX\Common\Models\PbxSettings;
27
use MikoPBX\Common\Models\Sip;
28
use MikoPBX\Core\System\Upgrade\UpgradeSystemConfigInterface;
29
use MikoPBX\Core\System\Util;
30
use Phalcon\Di\Injectable;
31
32
class UpdateConfigsUpToVer20220316 extends Injectable implements UpgradeSystemConfigInterface
33
{
34
  	public const PBX_VERSION = '2022.3.16';
35
36
	/**
37
     * Class constructor.
38
     */
39
    public function __construct()
40
    {
41
    }
42
43
    /**
44
     * https://github.com/mikopbx/Core/issues/269
45
     */
46
    public function processUpdate():void
47
    {
48
        $u = new UpdateConfigsUpToVer20220284();
49
        $u->processUpdate();
50
51
        $u = new UpdateConfigsUpToVer202202103();
52
        $u->processUpdate();
53
54
        // Чистим старый кэш pdnsd;
55
        $rmPath = Util::which('rm');
56
        shell_exec("$rmPath -rf /storage/usbdisk1/mikopbx/log/pdnsd");
57
    }
58
}