cvs: pear /PHP_CompatInfo CompatInfo.php

From: Date: Thu, 06 May 2004 16:11:13 +0000
Subject: cvs: pear /PHP_CompatInfo CompatInfo.php
Groups: php.pear.cvs 
Request: Send a blank email to pear-cvs+get-19263@lists.php.net to get a copy of this message
davey Thu May 6 12:11:13 2004 EDT Modified files: /pear/PHP_CompatInfo CompatInfo.php Log: Applied patch from tektonic http://cvs.php.net/diff.php/pear/PHP_CompatInfo/CompatInfo.php?r1=1.8&r2=1.9&ty=u Index: pear/PHP_CompatInfo/CompatInfo.php diff -u pear/PHP_CompatInfo/CompatInfo.php:1.8 pear/PHP_CompatInfo/CompatInfo.php:1.9 --- pear/PHP_CompatInfo/CompatInfo.php:1.8 Mon Apr 26 12:24:38 2004 +++ pear/PHP_CompatInfo/CompatInfo.php Thu May 6 12:11:12 2004 @@ -16,7 +16,7 @@ // | Authors: Davey Shafik <davey@php.net> | // +----------------------------------------------------------------------+ // -// $Id: CompatInfo.php,v 1.8 2004/04/26 16:24:38 davey Exp $ +// $Id: CompatInfo.php,v 1.9 2004/05/06 16:11:12 davey Exp $ /** * Check Compatibility of chunk of PHP code @@ -155,23 +155,16 @@ $extensions = array(); $constants = array(); $ignored = array(); - $default_options = array('file_ext' => array('php','php4','inc','phtml'), 'recurse_dir' => true, 'debug' => false, 'ignore_file' => array(), 'ignore_dirs' => array()); + $default_options = array('file_ext' => array('php','php4','inc','phtml'), 'recurse_dir' => true, 'debug' => false, 'ignore_files' => array(), 'ignore_dirs' => array()); $options = array_merge($default_options,$options); - - if($dir{strlen($dir)-1} == '/' || $dir{strlen($dir)-1} == '\\') { - $dir = substr($dir,0,-1); - } + if(is_dir($dir) && is_readable($dir)) { - if (isset($options['ignores_dirs'])) { - $options['ignore_dirs'] = array_map("strtolower",$options['ignore_dirs']); - } else { - $options['ignore_dirs'] == array(); - } - if (isset($options['ignore_files'])) { - $options['ignore_files'] = array_map("strtolower",$options['ignore_files']); - } else { - $options['ignore_files'] = array(); + if($dir{strlen($dir)-1} == '/' || $dir{strlen($dir)-1} == '\\') { + $dir = substr($dir,0,-1); } + array_map('strtolower', $options['file_ext']); + array_map('strtolower', $options['ignore_files']); + array_map('strtolower', $options['ignore_dirs']); $files_raw = $this->_fileList($dir,$options); foreach($files_raw as $file) { if(in_array(strtolower($file),$options['ignore_files'])) { @@ -179,7 +172,7 @@ continue; } $file_info = pathinfo($file); - if (isset($file_info['extension']) && in_array($file_info['extension'],$options['file_ext'])) { + if (isset($file_info['extension']) && in_array(strtolower($file_info['extension']),$options['file_ext'])) { $tokens = $this->_tokenize($file); $files[$file] = $this->_parseTokens($tokens,$options); }

« previous php.pear.cvs (#19263) next »