File tree 1 file changed +19
-2
lines changed
1 file changed +19
-2
lines changed Original file line number Diff line number Diff line change 29
29
* @return environment_results|null updated results or null.
30
30
*/
31
31
function search_postgresfulltext_check_database (environment_results $ result ) {
32
- global $ CFG ;
32
+ global $ CFG , $ DB ;
33
+
33
34
if ($ CFG ->dbtype !== 'pgsql ' ) {
34
35
$ result ->setInfo ('You must be using PostgreSQL. ' );
35
36
$ result ->setStatus (false );
36
37
return $ result ;
37
38
}
38
- return null ;
39
+
40
+ // To use websearch function, we need PG 11 or higher.
41
+ $ neededversion = "11 " ;
42
+
43
+ $ currentvendor = $ DB ->get_dbvendor ();
44
+ $ dbinfo = $ DB ->get_server_info ();
45
+ $ currentversion = normalize_version ($ dbinfo ['version ' ]);
46
+
47
+ if (version_compare ($ currentversion , $ neededversion , '>= ' )) {
48
+ $ result ->setStatus (true );
49
+ } else {
50
+ $ result ->setStatus (false );
51
+ }
52
+ $ result ->setCurrentVersion ($ currentversion );
53
+ $ result ->setNeededVersion ($ neededversion );
54
+ $ result ->setInfo ($ currentvendor . ' ( ' . $ dbinfo ['description ' ] . ') ' );
55
+ return $ result ;
39
56
}
You can’t perform that action at this time.
0 commit comments