Debian Codegraph @

src/softs/Spip.php

raw
1 <?php
2
3 class Spip {
4
5 /**
6 * search for a spip in that folder.
7 * if this class think that a spip is here, returns the version number, normalized.
8 */
9 function search($root) {
10
11 if (is_file($root."/ecrire/inc_version.php")) {
12 $f=fopen($root."/ecrire/inc_version.php","rb");
13 if (!$f) return false;
14 while($s=fgets($f,1024)) {
15 if (preg_match('#\$spip_version_branche\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 Spip