Source for file Array.php
Documentation is available at Array.php
* Copyright (c) 2008, Laurent Laville <pear@laurent-laville.org>
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* * Neither the name of the authors nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
* @package PHP_CompatInfo
* @author Laurent Laville <pear@laurent-laville.org>
* @license http://www.opensource.org/licenses/bsd-license.php BSD
* @version CVS: $Id: Array.php,v 1.8 2008/07/22 20:26:19 farell Exp $
* @link http://pear.php.net/package/PHP_CompatInfo
* @since File available since Release 1.8.0b2
* Array renderer for PHP_CompatInfo component.
* The PHP_CompatInfo_Renderer_Array class is a concrete implementation
* of PHP_CompatInfo_Renderer abstract class. It simply display results as
* @package PHP_CompatInfo
* @author Laurent Laville <pear@laurent-laville.org>
* @license http://www.opensource.org/licenses/bsd-license.php BSD
* @version Release: 1.9.0b1
* @link http://pear.php.net/package/PHP_CompatInfo
* @since Class available since Release 1.8.0b2
* Driver to display results array.
* Default is PHP::var_export, but you can use PEAR::Var_Dump if available
* Array Renderer Class constructor (ZE1) for PHP4
* @param object &$parser Instance of the parser (model of MVC pattern)
* @param array $conf A hash containing any additional configuration
* @since version 1.8.0b2 (2008-06-03)
* Array Renderer Class constructor (ZE2) for PHP5+
* @param object &$parser Instance of the parser (model of MVC pattern)
* @param array $conf A hash containing any additional configuration
* @since version 1.8.0b2 (2008-06-03)
$driver = 'PEAR::Var_Dump';
if (isset ($conf[$driver])) {
$var_dump = 'Var_Dump.php';
$class_options = $conf['PEAR::Var_Dump'];
if (isset ($class_options['options'])) {
$options = $class_options['options'];
if (isset ($class_options['rendererOptions'])) {
$rendererOptions = $class_options['rendererOptions'];
$rendererOptions = array ();
// prevent wrong display on command line interface
$options['display_mode'] = 'Text';
Var_Dump ::displayInit ($options, $rendererOptions);
// if optional driver not defined, then use default PHP::var_export
* Display final results, when data source parsing is over.
* @since version 1.8.0b2 (2008-06-03)
$o = $this->args['output-level'];
$v = $this->args['verbose'];
$src = $this->_parser->dataSource;
Var_Dump ::display ($data);
$options = $this->_parser->options;
if (isset ($this->args['dir'])) {
$files = $this->_parser->getFilelist ($this->args['dir'], $options);
} elseif (isset ($this->args['file'])) {
$files = array ($this->args['file']);
} elseif ($src['dataType'] == 'directory') {
$files = $src['dataSource'];
} elseif ($src['dataType'] == 'file') {
$files = array ($src['dataSource']);
$files = $src['dataSource'];
if ($options['is_string'] == true ) {
foreach ($files as $k => $str) {
$files[$k] = 'string_' . ($k+1 );
unset ($data['version'], $data['max_version']);
unset ($data['cond_code']);
unset ($data['extensions']);
// display Constants/Tokens
unset ($data['constants']);
if ($v & 4 || $options['debug'] == true ) {
unset ($data['functions']);
if ($this->args['summarize'] === true ) {
foreach ($files as $file) {
foreach ($files as $file) {
unset ($data[$file]['version'], $data[$file]['max_version']);
unset ($data[$file]['cond_code']);
unset ($data[$file]['extensions']);
// display Constants/Tokens
unset ($data[$file]['tokens']);
unset ($data[$file]['constants']);
unset ($data[$file]['tokens']);
if ($v & 4 || $options['debug'] == true ) {
unset ($data[$file]['functions']);
Var_Dump ::display ($data);
Documentation generated on Sun, 30 Nov 2008 16:30:22 -0500 by phpDocumentor 1.4.0. PEAR Logo Copyright © PHP Group 2004.
|