1
|
|
|
<?php |
2
|
|
|
/************************************************************************ |
3
|
|
|
* OVIDENTIA http://www.ovidentia.org * |
4
|
|
|
************************************************************************ |
5
|
|
|
* Copyright (c) 2003 by CANTICO ( http://www.cantico.fr ) * |
6
|
|
|
* * |
7
|
|
|
* This file is part of Ovidentia. * |
8
|
|
|
* * |
9
|
|
|
* Ovidentia is free software; you can redistribute it and/or modify * |
10
|
|
|
* it under the terms of the GNU General Public License as published by * |
11
|
|
|
* the Free Software Foundation; either version 2, or (at your option) * |
12
|
|
|
* any later version. * |
13
|
|
|
* * |
14
|
|
|
* This program is distributed in the hope that it will be useful, but * |
15
|
|
|
* WITHOUT ANY WARRANTY; without even the implied warranty of * |
16
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * |
17
|
|
|
* See the GNU General Public License for more details. * |
18
|
|
|
* * |
19
|
|
|
* You should have received a copy of the GNU General Public License * |
20
|
|
|
* along with this program; if not, write to the Free Software * |
21
|
|
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,* |
22
|
|
|
* USA. * |
23
|
|
|
************************************************************************/ |
24
|
|
|
|
25
|
|
|
$prerequisits = array(); |
26
|
|
|
$LibCaldav = bab_getAddonInfosInstance('LibCaldav'); |
27
|
|
|
|
28
|
|
View Code Duplication |
if ($LibCaldav && $LibCaldav->isInstalled()) |
|
|
|
|
29
|
|
|
{ |
30
|
|
|
$prerequisits[] = array( |
31
|
|
|
|
32
|
|
|
'description' => 'module LibCaldav', |
33
|
|
|
'required' => '0.4.6', |
34
|
|
|
'recommended' => false, |
35
|
|
|
'current' => $LibCaldav->getIniVersion(), |
36
|
|
|
'result' => $LibCaldav->isInstalled() && version_compare($LibCaldav->getIniVersion(), '0.4.6', '>=' ) |
37
|
|
|
|
38
|
|
|
); |
39
|
|
|
} |
40
|
|
|
|
41
|
|
|
|
42
|
|
|
$LibZendFramework = bab_getAddonInfosInstance('LibZendFramework'); |
43
|
|
|
|
44
|
|
View Code Duplication |
if ($LibZendFramework && $LibZendFramework->isInstalled()) |
|
|
|
|
45
|
|
|
{ |
46
|
|
|
$prerequisits[] = array( |
47
|
|
|
|
48
|
|
|
'description' => 'module LibZendFramework', |
49
|
|
|
'required' => '1.12.0rc3.01', |
50
|
|
|
'recommended' => false, |
51
|
|
|
'current' => $LibZendFramework->getIniVersion(), |
52
|
|
|
'result' => version_compare($LibZendFramework->getIniVersion(), '1.12.0rc3.01', '>=' ) |
53
|
|
|
|
54
|
|
|
); |
55
|
|
|
} |
56
|
|
|
|
57
|
|
|
|
58
|
|
|
$workschedules = bab_getAddonInfosInstance('workschedules'); |
59
|
|
|
|
60
|
|
View Code Duplication |
if ($workschedules && $workschedules->isInstalled()) |
|
|
|
|
61
|
|
|
{ |
62
|
|
|
$prerequisits[] = array( |
63
|
|
|
|
64
|
|
|
'description' => 'module Workschedules', |
65
|
|
|
'required' => '1.5', |
66
|
|
|
'recommended' => false, |
67
|
|
|
'current' => $workschedules->getIniVersion(), |
68
|
|
|
'result' => version_compare($workschedules->getIniVersion(), '1.5', '>=' ) |
69
|
|
|
|
70
|
|
|
); |
71
|
|
|
} |
72
|
|
|
|
73
|
|
|
|
74
|
|
|
|
75
|
|
|
return $prerequisits; |
Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.
You can also find more detailed suggestions in the “Code” section of your repository.