4 * Get the Compatibility info for an entire folder (recursive)
8 require_once 'PHP/CompatInfo.php';
10 $info = new PHP_CompatInfo('null');
14 'file_ext' => array('php'),
17 $res = $info->parseData($folder);
18 if (version_compare($res['version'], '5.0.0', 'ge')) {
20 // produce dependencies only for php5
22 // session has always been compiled in
23 // date, spl are internal for php
24 $staticmods = array('session', 'date', 'spl');
27 // produce dependencies where php4/php5 both are ok
29 // session has always been compiled in
30 $staticmods = array('session');
32 echo "Requires:\tphp-common >= ", $epoch, ":", $res['version'], "\n";
35 foreach ($res['extensions'] as $ext) {
36 if (in_array($ext, $staticmods)) {
41 echo "Requires:\tphp(", $ext, ")\n";
43 echo "Requires:\tphp-", $ext, "\n";