cvs: pear /PhpDocumentor/phpDocumentor Io.inc Setup.inc.php /PhpDocumentor/tutorials/phpDocumentor phpDocumentor.howto.pkg

From: Date: Fri, 23 Feb 2007 17:38:42 +0000
Subject: cvs: pear /PhpDocumentor/phpDocumentor Io.inc Setup.inc.php /PhpDocumentor/tutorials/phpDocumentor phpDocumentor.howto.pkg
Groups: php.pear.cvs 
Request: Send a blank email to pear-cvs+get-44848@lists.php.net to get a copy of this message
ashnazg Fri Feb 23 17:38:42 2007 UTC Modified files: /pear/PhpDocumentor/tutorials/phpDocumentor phpDocumentor.howto.pkg /pear/PhpDocumentor/phpDocumentor Io.inc Setup.inc.php Log: sourceforge [1543289] Apply ignore patterns to subdir of dir, instead of full path

http://cvs.php.net/viewvc.cgi/pear/PhpDocumentor/tutorials/phpDocumentor/phpDocumentor.howto.pkg?r1=1.5&r2=1.6&diff_format=u Index: pear/PhpDocumentor/tutorials/phpDocumentor/phpDocumentor.howto.pkg diff -u pear/PhpDocumentor/tutorials/phpDocumentor/phpDocumentor.howto.pkg:1.5 pear/PhpDocumentor/tutorials/phpDocumentor/phpDocumentor.howto.pkg:1.6 --- pear/PhpDocumentor/tutorials/phpDocumentor/phpDocumentor.howto.pkg:1.5 Thu Feb 15 17:28:17 2007 +++ pear/PhpDocumentor/tutorials/phpDocumentor/phpDocumentor.howto.pkg Fri Feb 23 17:38:42 2007 @@ -975,7 +975,7 @@ </refsect3> <refsect3 id="{@id ignore}"> <title>-i, --ignore</title> - <para>Use the -i option to exclude files and directories from parsing. The -i option recognizes the * and ? wildcards, like -f does. In addition, it is possible to ignore a subdirectory of any directory using &quot;dirname/&quot;</para> + <para>Use the -i option to exclude files and directories from parsing. The -i option recognizes the * and ? wildcards, like -f does. In addition, it is possible to ignore a subdirectory of any directory using &quot;dirname/&quot;.</para> <para> <itemizedlist> <listitem><para>phpdoc -i tests/ will ignore /path/to/here/tests/* and /path/tests/*</para></listitem> @@ -984,6 +984,13 @@ <listitem><para>phpdoc -i *test* will ignore /path/tests/* and /path/here/my_test.php</para></listitem> </itemizedlist> </para> + <para>Since v1.3.2, the value or pattern you provide will be case-sensitive (OS permitting, anyway), and will be applied relative to the top-level directory in the -d argument.</para> + <para> + <itemizedlist> + <listitem><para>phpdoc -i CVS/ will ignore /path/to/CVS/* but will not ignore /path/to/cvs</para></listitem> + <listitem><para>phpdoc -d /home/myhome/cvs/myproject -i cvs/ will ignore /home/myhome/cvs/myproject/files/cvs/* but will not ignore /home/myhome/cvs/*</para></listitem> + </itemizedlist> + </para> </refsect3> <refsect3 id="{@id ignore-tags}"> <title>-it, --ignore-tags</title> http://cvs.php.net/viewvc.cgi/pear/PhpDocumentor/phpDocumentor/Io.inc?r1=1.13&r2=1.14&diff_format=u Index: pear/PhpDocumentor/phpDocumentor/Io.inc diff -u pear/PhpDocumentor/phpDocumentor/Io.inc:1.13 pear/PhpDocumentor/phpDocumentor/Io.inc:1.14 --- pear/PhpDocumentor/phpDocumentor/Io.inc:1.13 Thu Feb 15 17:28:17 2007 +++ pear/PhpDocumentor/phpDocumentor/Io.inc Fri Feb 23 17:38:42 2007 @@ -33,7 +33,7 @@ * @author Gregory Beaver <cellog@php.net> * @copyright 2000-2006 Joshua Eichorn, Gregory Beaver * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @version CVS: $Id: Io.inc,v 1.13 2007/02/15 17:28:17 ashnazg Exp $ + * @version CVS: $Id: Io.inc,v 1.14 2007/02/23 17:38:42 ashnazg Exp $ * @filesource * @link http://www.phpdoc.org * @link http://pear.php.net/PhpDocumentor @@ -44,7 +44,7 @@ * * @author Joshua Eichorn <jeichorn@phpdoc.org> * @author Gregory Beaver <cellog@php.net> - * @version $Id: Io.inc,v 1.13 2007/02/15 17:28:17 ashnazg Exp $ + * @version $Id: Io.inc,v 1.14 2007/02/23 17:38:42 ashnazg Exp $ * @package phpDocumentor */ class Io @@ -60,7 +60,7 @@ * regexp-ready string to search for basename of ignore strings),...) * @var false|array */ - var $ignore = false; + var $ignore; /** * A specific array of values that boolean-based arguments can understand, * aided by the {@link decideOnOrOff()} helper method. @@ -516,7 +516,7 @@ $struc = array(); foreach($allfiles as $file) { - if ($this->checkIgnore(basename($file),dirname($file),$ignore)) continue; + if ($this->checkIgnore(basename($file),dirname(realpath($file)),$ignore)) continue; $path = substr(dirname($file),strlen(str_replace('\\','/',realpath($base_dir)))+1); if (!$path) $path = '/'; $parts = pathinfo($file); @@ -652,28 +652,31 @@ * @author Greg Beaver <cellog@users.sourceforge.net> * @param string $file just the file name of the file or directory, * in the case of directories this is the last dir - * @param string $path the full path + * @param string $path the path to consider (should be checked by + * realpath() before, and may be relative) * @param array $ignore * @return bool true if $path should be ignored, false if it should not */ function checkIgnore($file,$path,$ignore,$ignore_no_ext = true) { global $_phpDocumentor_RIC_files; - $path = realpath($path); + if (!count($ignore)) return false; + + if (!isset($this->ignore)) + { + $this->_setupIgnore($ignore); + } + if (!$this->ignore) + { + return false; + } + if ($ignore_no_ext && !in_array(strtoupper($file), $_phpDocumentor_RIC_files)) { if (!is_numeric(strpos($file,'.'))) return true; } - if (!isset($this->ignore) || !$this->ignore) - { - $this->_setupIgnore($ignore); - if (!$this->ignore) - { - return false; - } - } if (is_array($this->ignore)) { foreach($this->ignore as $match) @@ -734,29 +737,31 @@ function _setupIgnore($ignore) { $ig = array(); - if (is_array($ignore)) + if ( ! is_array($ignore)) { - for($i=0; $i<count($ignore);$i++) - { - $ignore[$i] = strtr($ignore[$i], "\\", "/"); - $ignore[$i] = str_replace('//','/',$ignore[$i]); + $this->ignore = false; + return; + } + for($i=0; $i<count($ignore);$i++) + { + if (empty($ignore[$i])) + continue; - if (!empty($ignore[$i])) - { - if (!is_numeric(strpos($ignore[$i],PATH_DELIMITER))) - { - $ig[] = $this->getRegExpableSearchString($ignore[$i]); - } else - { - if (basename($ignore[$i]) . PATH_DELIMITER == $ignore[$i]) - $ig[] = $this->getRegExpableSearchString($ignore[$i]); - else - $ig[] = array($this->getRegExpableSearchString($ignore[$i]),$this->getRegExpableSearchString(basename($ignore[$i]))); - } - } + $ignore[$i] = strtr($ignore[$i], '\\', '/'); + $ignore[$i] = str_replace('//','/',$ignore[$i]); + + if (!is_numeric(strpos($ignore[$i],PATH_DELIMITER))) + { + $ig[] = $this->getRegExpableSearchString($ignore[$i]); + } else + { + if (basename($ignore[$i]) . PATH_DELIMITER == $ignore[$i]) + $ig[] = $this->getRegExpableSearchString($ignore[$i]); + else + $ig[] = array($this->getRegExpableSearchString($ignore[$i]),$this->getRegExpableSearchString(basename($ignore[$i]))); } - if (count($ig)) $this->ignore = $ig; - } else $this->ignore = false; + } + if (count($ig)) $this->ignore = $ig; } /** http://cvs.php.net/viewvc.cgi/pear/PhpDocumentor/phpDocumentor/Setup.inc.php?r1=1.19&r2=1.20&diff_format=u Index: pear/PhpDocumentor/phpDocumentor/Setup.inc.php diff -u pear/PhpDocumentor/phpDocumentor/Setup.inc.php:1.19 pear/PhpDocumentor/phpDocumentor/Setup.inc.php:1.20 --- pear/PhpDocumentor/phpDocumentor/Setup.inc.php:1.19 Thu Feb 15 17:28:17 2007 +++ pear/PhpDocumentor/phpDocumentor/Setup.inc.php Fri Feb 23 17:38:42 2007 @@ -30,7 +30,7 @@ * @author Gregory Beaver <cellog@php.net> * @copyright 2002-2006 Gregory Beaver * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @version CVS: $Id: Setup.inc.php,v 1.19 2007/02/15 17:28:17 ashnazg Exp $ + * @version CVS: $Id: Setup.inc.php,v 1.20 2007/02/23 17:38:42 ashnazg Exp $ * @link http://www.phpdoc.org * @link http://pear.php.net/PhpDocumentor * @since 1.2 @@ -606,12 +606,16 @@ foreach($files as $file) { // Make sure the file isn't a hidden file - $file = strtr($file, "\\", "/"); + $file = strtr($file, '\\', '/'); if (substr(basename($file),0,1) != ".") { - if (!$this->setup->checkIgnore(basename($file),str_replace('\\','/',dirname($file)),$this->ignore_files)) + // file's subpath, relative to $dir + $file_subpath = str_replace('\\', '/', realpath(dirname($file))); + $file_subpath = preg_replace('~^' . preg_quote($dir, '~') . '~', '', $file_subpath); + + if (!$this->setup->checkIgnore(basename($file), $file_subpath, $this->ignore_files)) { - $filelist[] = str_replace('\\','/',$file); + $filelist[] = $file; } else { phpDocumentor_out("File $file Ignored\n"); flush();
« previous php.pear.cvs (#44848) next »