Debian Codegraph @

src/softs/Dolibarr.php

raw
1 <?php
2
3 class Dolibarr {
4
5 /**
6 * search for a dokuwiki in that folder.
7 * if this class think that a dokuwiki is here, returns the version number, normalized.
8 */
9 function search($root) {
10
11 if (is_file($root."/filefunc.inc.php") && is_dir($root."/public")) {
12 $f=fopen($root."/filefunc.inc.php","rb");
13 if (!$f) return false;
14 while($s=fgets($f,1024)) {
15 if (preg_match('#define.[\'"]DOL_VERSION[\'"]\s*,\s*[\'"]([^\'"]+)[\'"]#',$s,$mat)) {
16 fclose($f);
17 return $mat[1];
18 }
19 }
20 fclose($f);
21 return false;
22 } else {
23 return false;
24 }
25
26 } // search
27
28 } // class Dolibarr