Subversion-Projekte lars-tiefland.php_share

Revision

Details | Letzte Änderung | Log anzeigen | RSS feed

Revision Autor Zeilennr. Zeile
1 lars 1
<?php
2
/**
3
 * Request #6056 Add support for reporting max PHP version
4
 *
5
 * PHP versions 4 and 5
6
 *
7
 * @category PHP
8
 * @package  PHP_CompatInfo
9
 * @author   Laurent Laville <pear@laurent-laville.org>
10
 * @license  http://www.opensource.org/licenses/bsd-license.php  BSD
11
 * @version  CVS: $Id: checkMax.php,v 1.5 2008/07/22 20:27:11 farell Exp $
12
 * @link     http://pear.php.net/bugs/bug.php?id=6056
13
 * @ignore
14
 */
15
 
16
require_once 'PHP/CompatInfo.php';
17
 
18
$info = new PHP_CompatInfo();
19
 
20
$file = dirname(__FILE__) . DIRECTORY_SEPARATOR . 'sample_req6056.php';
21
$arr  = array($file, __FILE__);
22
 
23
$options = array('debug' => true);
24
 
25
$res = $info->parseArray($arr, $options);
26
 
27
echo 'PHP min = ' . $res['version'] . "<br />\n";
28
if ($res['max_version'] != '') {
29
    echo 'PHP max = ' . $res['max_version'] . "<br />\n";
30
 
31
    foreach ($arr as $file) {
32
        $min = $res[$file]['version'];
33
        $max = $res[$file]['max_version'];
34
        if (($max != '') && (version_compare($min, $max) === 1)) {
35
            echo 'ATTENTION file "'.$file.
36
                '" cannot run : PHP version Min > Max '."\n";
37
        }
38
    }
39
}
40
if (count($res['extensions'])) {
41
    echo 'Extensions required : ' . implode(', ', $res['extensions']) . "<br />\n";
42
}
43
 
44
echo '<pre>';
45
var_dump($res);
46
echo '</pre>';
47
 
48
?>