Subversion-Projekte lars-tiefland.php_share

Revision

Details | Letzte Änderung | Log anzeigen | RSS feed

Revision Autor Zeilennr. Zeile
1 lars 1
<?php
2
/**
3
 * Get the Compatibility info for a single file
4
 *
5
 * This example show the new options|features available with API 1.8.0
6
 *
7
 * PHP versions 4 and 5
8
 *
9
 * @category PHP
10
 * @package  PHP_CompatInfo
11
 * @author   Laurent Laville <pear@laurent-laville.org>
12
 * @license  http://www.opensource.org/licenses/bsd-license.php  BSD
13
 * @version  CVS: $Id: pci180_parsefile.php,v 1.3 2008/07/22 20:26:45 farell Exp $
14
 * @link     http://pear.php.net/package/PHP_CompatInfo
15
 * @since    version 1.8.0b2 (2008-06-03)
16
 * @ignore
17
 */
18
 
19
require_once 'PHP/CompatInfo.php';
20
 
21
/*
22
   With all default options, its same as version 1.8.0b1 or less
23
   No need to specify driver type ('array') and options, in class constructor
24
   Results display made with PHP::var_export
25
*/
26
//$compatInfo = new PHP_CompatInfo();
27
 
28
/*
29
   With API 1.8.0 you may choose a custom render,
30
   between all default renderers (all customizable).
31
 
32
   Here we choose to display result still as an array, but with PEAR::Var_Dump
33
   package if available (installed).
34
   On CLI we have only ability to use the "Text" Var_Dump renderer (display_mode)
35
 */
36
$driverType = 'array';
37
 
38
// use default "HTML4_Table" Var_Dump renderer
39
/* Be aware that if you run this script in CLI, the Var_Dump renderer used
40
   is "Text" (no choice) */
41
$driverOptions
42
    = array('PEAR::Var_Dump' =>
43
            array('options' => array('display_mode' => 'HTML4_Table')));
44
 
45
$compatInfo = new PHP_CompatInfo($driverType, $driverOptions);
46
 
47
$source = 'C:\php\pear\HTML_Progress2\Progress2.php';
48
$r = $compatInfo->parseFile($source);
49
// You may also use the new unified method parseData(), parseFile() became an alias
50
//$r = $compatInfo->parseData($source);
51
 
52
/*
53
   To keep backward compatibility, result is also return (here in $r)
54
   but you don't need to print it, it's the default behavior of API 1.8.0
55
 */
56
?>