3131 --------------------------------------------------------------------------
3232 */
3333
34- define ("PLUGIN_MANTIS_VERSION " , "3 .0.2 " );
34+ define ("PLUGIN_MANTIS_VERSION " , "4 .0.0 " );
3535
3636// Minimal GLPI version, inclusive
37- define ("PLUGIN_MANTIS_MIN_GLPI " , "9.1 " );
37+ define ("PLUGIN_MANTIS_MIN_GLPI " , "9.2 " );
3838// Maximum GLPI version, exclusive
3939define ("PLUGIN_MANTIS_MAX_GLPI " , "9.3 " );
4040
@@ -87,57 +87,39 @@ function plugin_init_mantis() {
8787 * @return array
8888 */
8989function plugin_version_mantis () {
90- return array (
91- 'name ' => __ ("MantisBT synchronization " , "mantis " ),
92- 'version ' => PLUGIN_MANTIS_VERSION ,
93- 'author ' => 'TECLIB \'' ,
94- 'license ' => 'GPLv3 ' ,
95- 'homepage ' => 'https://github.com/pluginsGLPI/mantis ' ,
96- 'minGlpiVersion ' => PLUGIN_MANTIS_MIN_GLPI
97- );
90+
91+ return [
92+ 'name ' => __ ("MantisBT synchronization " , "mantis " ),
93+ 'version ' => PLUGIN_MANTIS_VERSION ,
94+ 'author ' => 'TECLIB \'' ,
95+ 'license ' => 'GPLv3 ' ,
96+ 'homepage ' =>'https://github.com/pluginsGLPI/mantis ' ,
97+ 'requirements ' => [
98+ 'glpi ' => [
99+ 'min ' => PLUGIN_MANTIS_MIN_GLPI ,
100+ 'max ' => PLUGIN_MANTIS_MAX_GLPI ,
101+ 'dev ' => true
102+ ]
103+ ]
104+ ];
98105}
99106
100107/**
101- * function to check the prerequisites
108+ * Check pre-requisites before install
102109 *
103110 * @return boolean
104111 */
105112function plugin_mantis_check_prerequisites () {
106- if (version_compare (GLPI_VERSION , PLUGIN_MANTIS_MIN_GLPI , 'lt ' )
107- || version_compare (GLPI_VERSION , PLUGIN_MANTIS_MAX_GLPI , 'ge ' )
108- ) {
109- echo sprintf (
110- __ ('This plugin requires GLPi > %1$s and < %2$s ' ),
111- PLUGIN_MANTIS_MIN_GLPI ,
112- PLUGIN_MANTIS_MAX_GLPI
113- );
114-
115- return false ;
116- }
117-
118- if (!extension_loaded ('soap ' )) {
119- _e ("This plugin requires SOAP extension for PHP " );
120- return false ;
121- }
122-
123113 return true ;
124114}
125115
126116/**
127- * function to check the initial configuration
117+ * Check configuration process
118+ *
119+ * @param boolean $verbose Whether to display message on failure. Defaults to false
128120 *
129- * @param boolean $verbose
130121 * @return boolean
131122 */
132123function plugin_mantis_check_config ($ verbose = false ) {
133- if (true ) {
134- // your configuration check
135- return true ;
136- }
137-
138- if ($ verbose ) {
139- echo _x ('plugin ' , 'Installed / not configured ' );
140- }
141-
142- return false ;
143- }
124+ return true ;
125+ }
0 commit comments