Hello community,
here is the log from the commit of package php5-pear-phpunit-File_Iterator for openSUSE:Factory checked in at 2012-02-29 14:09:37
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/php5-pear-phpunit-File_Iterator (Old)
and /work/SRC/openSUSE:Factory/.php5-pear-phpunit-File_Iterator.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "php5-pear-phpunit-File_Iterator", Maintainer is ""
Changes:
--------
--- /work/SRC/openSUSE:Factory/php5-pear-phpunit-File_Iterator/php5-pear-phpunit-File_Iterator.changes 2011-12-20 10:55:26.000000000 +0100
+++ /work/SRC/openSUSE:Factory/.php5-pear-phpunit-File_Iterator.new/php5-pear-phpunit-File_Iterator.changes 2012-02-29 14:09:45.000000000 +0100
@@ -6,0 +7,9 @@
+Mon Dec 5 21:08:07 UTC 2011 - robert.munteanu@gmail.com
+
+- Updated to version 1.3.0
+ - Added `File_Iterator_Facade` for the most common use case.
+ - Moved `File_Iterator_Factory::getFilesAsArray()` to
+ `File_Iterator_Facade::getFilesAsArray()`.
+ - `File_Iterator_Factory` is no longer static.
+
+-------------------------------------------------------------------
Old:
----
File_Iterator-1.2.6.tgz
New:
----
File_Iterator-1.3.0.tgz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ php5-pear-phpunit-File_Iterator.spec ++++++
--- /var/tmp/diff_new_pack.0oqFhW/_old 2012-02-29 14:09:47.000000000 +0100
+++ /var/tmp/diff_new_pack.0oqFhW/_new 2012-02-29 14:09:47.000000000 +0100
@@ -1,7 +1,7 @@
#
# spec file for package php5-pear-phpunit-File_Iterator
#
-# Copyright (c) 2011 SUSE LINUX Products GmbH, Nuernberg, Germany.
+# Copyright (c) 2012 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -16,14 +16,15 @@
#
+
Name: php5-pear-phpunit-File_Iterator
%define pear_name File_Iterator
%define pear_sname file_iterator
Summary: Filters files based on a list of suffixes
+Version: 1.3.0
+Release: 1
License: BSD-3-Clause
Group: Development/Libraries/PHP
-Version: 1.2.6
-Release: 0
Source0: http://pear.phpunit.de/get/File_Iterator-%{version}.tgz
Url: http://pear.phpunit.de/
Requires: php5-pear-channel-phpunit
@@ -94,5 +95,9 @@
%files -f %{name}.files
%defattr(-,root,root)
+/%{_docdir}/%{pear_name}
+/%{_docdir}/%{pear_name}/ChangeLog.markdown
+/%{_docdir}/%{pear_name}/LICENSE
+/%{_docdir}/%{pear_name}/README.markdown
%changelog
++++++ File_Iterator-1.2.6.tgz -> File_Iterator-1.3.0.tgz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/File_Iterator-1.2.6/File/Iterator/Factory.php new/File_Iterator-1.2.6/File/Iterator/Factory.php
--- old/File_Iterator-1.2.6/File/Iterator/Factory.php 2011-03-03 12:09:06.000000000 +0100
+++ new/File_Iterator-1.2.6/File/Iterator/Factory.php 1970-01-01 01:00:00.000000000 +0100
@@ -1,159 +0,0 @@
-<?php
-/**
- * php-file-iterator
- *
- * Copyright (c) 2009-2011, Sebastian Bergmann <sb@sebastian-bergmann.de>.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * * 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 Sebastian Bergmann nor the names of his
- * 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 File
- * @author Sebastian Bergmann <sb@sebastian-bergmann.de>
- * @copyright 2009-2011 Sebastian Bergmann <sb@sebastian-bergmann.de>
- * @license http://www.opensource.org/licenses/bsd-license.php BSD License
- * @since File available since Release 1.1.0
- */
-
-require_once 'File/Iterator.php';
-
-/**
- * Factory Method implementation that creates a File_Iterator that operates on
- * an AppendIterator that contains an RecursiveDirectoryIterator for each given
- * path.
- *
- * @author Sebastian Bergmann <sb@sebastian-bergmann.de>
- * @copyright 2009-2011 Sebastian Bergmann <sb@sebastian-bergmann.de>
- * @license http://www.opensource.org/licenses/bsd-license.php BSD License
- * @version Release: 1.2.6
- * @link http://github.com/sebastianbergmann/php-file-iterator/tree
- * @since Class available since Release 1.1.0
- */
-class File_Iterator_Factory
-{
- /**
- * @param array|string $paths
- * @param array|string $suffixes
- * @param array|string $prefixes
- * @param array $exclude
- * @return AppendIterator
- */
- public static function getFileIterator($paths, $suffixes = '', $prefixes = '', array $exclude = array())
- {
- if (is_string($paths)) {
- $paths = array($paths);
- }
-
- $_paths = array();
-
- foreach ($paths as $path) {
- if ($locals = glob($path, GLOB_ONLYDIR)) {
- $_paths = array_merge($_paths, $locals);
- } else {
- $_paths[] = $path;
- }
- }
-
- $paths = $_paths;
- unset($_paths);
-
- if (is_string($prefixes)) {
- if ($prefixes != '') {
- $prefixes = array($prefixes);
- } else {
- $prefixes = array();
- }
- }
-
- if (is_string($suffixes)) {
- if ($suffixes != '') {
- $suffixes = array($suffixes);
- } else {
- $suffixes = array();
- }
- }
-
- $iterator = new AppendIterator;
-
- foreach ($paths as $path) {
- if (is_dir($path)) {
- $iterator->append(
- new File_Iterator(
- new RecursiveIteratorIterator(
- new RecursiveDirectoryIterator($path)
- ),
- $suffixes,
- $prefixes,
- $exclude,
- $path
- )
- );
- }
- }
-
- return $iterator;
- }
-
- /**
- * @param array|string $paths
- * @param array|string $suffixes
- * @param array|string $prefixes
- * @param array $exclude
- * @return array
- */
- public static function getFilesAsArray($paths, $suffixes = '', $prefixes = '', array $exclude = array())
- {
- if (is_string($paths)) {
- $paths = array($paths);
- }
-
- $result = array();
-
- $iterator = self::getFileIterator(
- $paths, $suffixes, $prefixes, $exclude
- );
-
- foreach ($iterator as $file) {
- $file = $file->getRealPath();
-
- if ($file) {
- $result[] = $file;
- }
- }
-
- foreach ($paths as $path) {
- if (is_file($path)) {
- $result[] = realpath($path);
- }
- }
-
- return array_unique($result);
- }
-}
-?>
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/File_Iterator-1.2.6/File/Iterator.php new/File_Iterator-1.2.6/File/Iterator.php
--- old/File_Iterator-1.2.6/File/Iterator.php 2011-03-03 12:09:06.000000000 +0100
+++ new/File_Iterator-1.2.6/File/Iterator.php 1970-01-01 01:00:00.000000000 +0100
@@ -1,197 +0,0 @@
-<?php
-/**
- * php-file-iterator
- *
- * Copyright (c) 2009-2011, Sebastian Bergmann <sb@sebastian-bergmann.de>.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * * 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 Sebastian Bergmann nor the names of his
- * 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 File
- * @author Sebastian Bergmann <sb@sebastian-bergmann.de>
- * @copyright 2009-2011 Sebastian Bergmann <sb@sebastian-bergmann.de>
- * @license http://www.opensource.org/licenses/bsd-license.php BSD License
- * @since File available since Release 1.0.0
- */
-
-/**
- * FilterIterator implementation that filters files based on prefix(es) and/or
- * suffix(es). Hidden files and files from hidden directories are also filtered.
- *
- * @author Sebastian Bergmann <sb@sebastian-bergmann.de>
- * @copyright 2009-2011 Sebastian Bergmann <sb@sebastian-bergmann.de>
- * @license http://www.opensource.org/licenses/bsd-license.php BSD License
- * @version Release: 1.2.6
- * @link http://github.com/sebastianbergmann/php-file-iterator/tree
- * @since Class available since Release 1.0.0
- */
-class File_Iterator extends FilterIterator
-{
- const PREFIX = 0;
- const SUFFIX = 1;
-
- /**
- * @var array
- */
- protected $suffixes = array();
-
- /**
- * @var array
- */
- protected $prefixes = array();
-
- /**
- * @var array
- */
- protected $exclude = array();
-
- /**
- * @var string
- */
- protected $basepath;
-
- /**
- * @param Iterator $iterator
- * @param array $suffixes
- * @param array $prefixes
- * @param array $exclude
- * @param string $basepath
- */
- public function __construct(Iterator $iterator, array $suffixes = array(), array $prefixes = array(), array $exclude = array(), $basepath = NULL)
- {
- $exclude = array_filter(array_map('realpath', $exclude));
-
- if ($basepath !== NULL) {
- $basepath = realpath($basepath);
- }
-
- if ($basepath === FALSE) {
- $basepath = NULL;
- } else {
- foreach ($exclude as &$_exclude) {
- $_exclude = str_replace($basepath, '', $_exclude);
- }
- }
-
- $this->prefixes = $prefixes;
- $this->suffixes = $suffixes;
- $this->exclude = $exclude;
- $this->basepath = $basepath;
-
- parent::__construct($iterator);
- }
-
- /**
- * @return boolean
- */
- public function accept()
- {
- $current = $this->getInnerIterator()->current();
- $filename = $current->getFilename();
- $realpath = $current->getRealPath();
-
- if ($this->basepath !== NULL) {
- $realpath = str_replace($this->basepath, '', $realpath);
- }
-
- // Filter files in hidden directories.
- if (preg_match('=/\.[^/]*/=', $realpath)) {
- return FALSE;
- }
-
- return $this->acceptPath($realpath) &&
- $this->acceptPrefix($filename) &&
- $this->acceptSuffix($filename);
- }
-
- /**
- * @param string $path
- * @return boolean
- * @since Method available since Release 1.1.0
- */
- protected function acceptPath($path)
- {
- foreach ($this->exclude as $exclude) {
- if (strpos($path, $exclude) === 0) {
- return FALSE;
- }
- }
-
- return TRUE;
- }
-
- /**
- * @param string $filename
- * @return boolean
- * @since Method available since Release 1.1.0
- */
- protected function acceptPrefix($filename)
- {
- return $this->acceptSubString($filename, $this->prefixes, self::PREFIX);
- }
-
- /**
- * @param string $filename
- * @return boolean
- * @since Method available since Release 1.1.0
- */
- protected function acceptSuffix($filename)
- {
- return $this->acceptSubString($filename, $this->suffixes, self::SUFFIX);
- }
-
- /**
- * @param string $filename
- * @param array $subString
- * @param integer $type
- * @return boolean
- * @since Method available since Release 1.1.0
- */
- protected function acceptSubString($filename, array $subStrings, $type)
- {
- if (empty($subStrings)) {
- return TRUE;
- }
-
- $matched = FALSE;
-
- foreach ($subStrings as $string) {
- if (($type == self::PREFIX && strpos($filename, $string) === 0) ||
- ($type == self::SUFFIX &&
- substr($filename, -1 * strlen($string)) == $string)) {
- $matched = TRUE;
- break;
- }
- }
-
- return $matched;
- }
-}
-?>
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/File_Iterator-1.3.0/ChangeLog.markdown new/File_Iterator-1.3.0/ChangeLog.markdown
--- old/File_Iterator-1.3.0/ChangeLog.markdown 1970-01-01 01:00:00.000000000 +0100
+++ new/File_Iterator-1.3.0/ChangeLog.markdown 2011-10-31 08:35:20.000000000 +0100
@@ -0,0 +1,11 @@
+File_Iterator 1.3
+=================
+
+This is the list of changes for the File_Iterator 1.3 release series.
+
+File_Iterator 1.3.0
+-------------------
+
+* Added `File_Iterator_Facade` for the most common use case.
+* Moved `File_Iterator_Factory::getFilesAsArray()` to `File_Iterator_Facade::getFilesAsArray()`.
+* `File_Iterator_Factory` is no longer static.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/File_Iterator-1.3.0/File/Iterator/Autoload.php new/File_Iterator-1.3.0/File/Iterator/Autoload.php
--- old/File_Iterator-1.3.0/File/Iterator/Autoload.php 1970-01-01 01:00:00.000000000 +0100
+++ new/File_Iterator-1.3.0/File/Iterator/Autoload.php 2011-10-31 08:35:20.000000000 +0100
@@ -0,0 +1,75 @@
+<?php
+/**
+ * php-file-iterator
+ *
+ * Copyright (c) 2009-2011, Sebastian Bergmann <sb@sebastian-bergmann.de>.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * * 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 Sebastian Bergmann nor the names of his
+ * 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 File
+ * @author Sebastian Bergmann <sb@sebastian-bergmann.de>
+ * @copyright 2009-2011 Sebastian Bergmann <sb@sebastian-bergmann.de>
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @since File available since Release 1.3.0
+ */
+
+function file_iterator_autoload($class = NULL) {
+ static $classes = NULL;
+ static $path = NULL;
+
+ if ($classes === NULL) {
+ $classes = array(
+ 'file_iterator' => '/Iterator.php',
+ 'file_iterator_facade' => '/Iterator/Facade.php',
+ 'file_iterator_factory' => '/Iterator/Factory.php'
+ );
+
+ $path = dirname(dirname(__FILE__));
+ }
+
+ if ($class === NULL) {
+ $result = array(__FILE__);
+
+ foreach ($classes as $file) {
+ $result[] = $path . $file;
+ }
+
+ return $result;
+ }
+
+ $cn = strtolower($class);
+
+ if (isset($classes[$cn])) {
+ require $path . $classes[$cn];
+ }
+}
+
+spl_autoload_register('file_iterator_autoload');
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/File_Iterator-1.3.0/File/Iterator/Facade.php new/File_Iterator-1.3.0/File/Iterator/Facade.php
--- old/File_Iterator-1.3.0/File/Iterator/Facade.php 1970-01-01 01:00:00.000000000 +0100
+++ new/File_Iterator-1.3.0/File/Iterator/Facade.php 2011-10-31 08:35:20.000000000 +0100
@@ -0,0 +1,157 @@
+<?php
+/**
+ * php-file-iterator
+ *
+ * Copyright (c) 2009-2011, Sebastian Bergmann <sb@sebastian-bergmann.de>.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * * 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 Sebastian Bergmann nor the names of his
+ * 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 File
+ * @author Sebastian Bergmann <sb@sebastian-bergmann.de>
+ * @copyright 2009-2011 Sebastian Bergmann <sb@sebastian-bergmann.de>
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @since File available since Release 1.3.0
+ */
+
+/**
+ * Façade implementation that uses File_Iterator_Factory to create a
+ * File_Iterator that operates on an AppendIterator that contains an
+ * RecursiveDirectoryIterator for each given path. The list of unique
+ * files is returned as an array.
+ *
+ * @author Sebastian Bergmann <sb@sebastian-bergmann.de>
+ * @copyright 2009-2011 Sebastian Bergmann <sb@sebastian-bergmann.de>
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @version Release: 1.3.0
+ * @link http://github.com/sebastianbergmann/php-file-iterator/tree
+ * @since Class available since Release 1.3.0
+ */
+class File_Iterator_Facade
+{
+ /**
+ * @param array|string $paths
+ * @param array|string $suffixes
+ * @param array|string $prefixes
+ * @param array $exclude
+ * @param boolean $commonPath
+ * @return array
+ */
+ public function getFilesAsArray($paths, $suffixes = '', $prefixes = '', array $exclude = array(), $commonPath = FALSE)
+ {
+ if (is_string($paths)) {
+ $paths = array($paths);
+ }
+
+ $factory = new File_Iterator_Factory;
+ $iterator = $factory->getFileIterator(
+ $paths, $suffixes, $prefixes, $exclude
+ );
+
+ $files = array();
+
+ foreach ($iterator as $file) {
+ $file = $file->getRealPath();
+
+ if ($file) {
+ $files[] = $file;
+ }
+ }
+
+ foreach ($paths as $path) {
+ if (is_file($path)) {
+ $files[] = realpath($path);
+ }
+ }
+
+ $files = array_unique($files);
+ sort($files);
+
+ if ($commonPath) {
+ return array(
+ 'commonPath' => $this->getCommonPath($files),
+ 'files' => $files
+ );
+ } else {
+ return $files;
+ }
+ }
+
+ /**
+ * Returns the common path of a set of files.
+ *
+ * @param array $files
+ * @return string
+ */
+ protected function getCommonPath(array $files)
+ {
+ $count = count($files);
+
+ if ($count == 1) {
+ return dirname($files[0]) . DIRECTORY_SEPARATOR;
+ }
+
+ $_files = array();
+
+ foreach ($files as $file) {
+ $_files[] = $_fileParts = explode(DIRECTORY_SEPARATOR, $file);
+
+ if (empty($_fileParts[0])) {
+ $_fileParts[0] = DIRECTORY_SEPARATOR;
+ }
+ }
+
+ $common = '';
+ $done = FALSE;
+ $j = 0;
+ $count--;
+
+ while (!$done) {
+ for ($i = 0; $i < $count; $i++) {
+ if ($_files[$i][$j] != $_files[$i+1][$j]) {
+ $done = TRUE;
+ break;
+ }
+ }
+
+ if (!$done) {
+ $common .= $_files[0][$j];
+
+ if ($j > 0) {
+ $common .= DIRECTORY_SEPARATOR;
+ }
+ }
+
+ $j++;
+ }
+
+ return $common;
+ }
+}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/File_Iterator-1.3.0/File/Iterator/Factory.php new/File_Iterator-1.3.0/File/Iterator/Factory.php
--- old/File_Iterator-1.3.0/File/Iterator/Factory.php 1970-01-01 01:00:00.000000000 +0100
+++ new/File_Iterator-1.3.0/File/Iterator/Factory.php 2011-10-31 08:35:20.000000000 +0100
@@ -0,0 +1,120 @@
+<?php
+/**
+ * php-file-iterator
+ *
+ * Copyright (c) 2009-2011, Sebastian Bergmann <sb@sebastian-bergmann.de>.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * * 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 Sebastian Bergmann nor the names of his
+ * 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 File
+ * @author Sebastian Bergmann <sb@sebastian-bergmann.de>
+ * @copyright 2009-2011 Sebastian Bergmann <sb@sebastian-bergmann.de>
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @since File available since Release 1.1.0
+ */
+
+/**
+ * Factory Method implementation that creates a File_Iterator that operates on
+ * an AppendIterator that contains an RecursiveDirectoryIterator for each given
+ * path.
+ *
+ * @author Sebastian Bergmann <sb@sebastian-bergmann.de>
+ * @copyright 2009-2011 Sebastian Bergmann <sb@sebastian-bergmann.de>
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @version Release: 1.3.0
+ * @link http://github.com/sebastianbergmann/php-file-iterator/tree
+ * @since Class available since Release 1.1.0
+ */
+class File_Iterator_Factory
+{
+ /**
+ * @param array|string $paths
+ * @param array|string $suffixes
+ * @param array|string $prefixes
+ * @param array $exclude
+ * @return AppendIterator
+ */
+ public function getFileIterator($paths, $suffixes = '', $prefixes = '', array $exclude = array())
+ {
+ if (is_string($paths)) {
+ $paths = array($paths);
+ }
+
+ $_paths = array();
+
+ foreach ($paths as $path) {
+ if ($locals = glob($path, GLOB_ONLYDIR)) {
+ $_paths = array_merge($_paths, $locals);
+ } else {
+ $_paths[] = $path;
+ }
+ }
+
+ $paths = $_paths;
+ unset($_paths);
+
+ if (is_string($prefixes)) {
+ if ($prefixes != '') {
+ $prefixes = array($prefixes);
+ } else {
+ $prefixes = array();
+ }
+ }
+
+ if (is_string($suffixes)) {
+ if ($suffixes != '') {
+ $suffixes = array($suffixes);
+ } else {
+ $suffixes = array();
+ }
+ }
+
+ $iterator = new AppendIterator;
+
+ foreach ($paths as $path) {
+ if (is_dir($path)) {
+ $iterator->append(
+ new File_Iterator(
+ new RecursiveIteratorIterator(
+ new RecursiveDirectoryIterator($path)
+ ),
+ $suffixes,
+ $prefixes,
+ $exclude,
+ $path
+ )
+ );
+ }
+ }
+
+ return $iterator;
+ }
+}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/File_Iterator-1.3.0/File/Iterator.php new/File_Iterator-1.3.0/File/Iterator.php
--- old/File_Iterator-1.3.0/File/Iterator.php 1970-01-01 01:00:00.000000000 +0100
+++ new/File_Iterator-1.3.0/File/Iterator.php 2011-10-31 08:35:20.000000000 +0100
@@ -0,0 +1,196 @@
+<?php
+/**
+ * php-file-iterator
+ *
+ * Copyright (c) 2009-2011, Sebastian Bergmann <sb@sebastian-bergmann.de>.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * * 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 Sebastian Bergmann nor the names of his
+ * 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 File
+ * @author Sebastian Bergmann <sb@sebastian-bergmann.de>
+ * @copyright 2009-2011 Sebastian Bergmann <sb@sebastian-bergmann.de>
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @since File available since Release 1.0.0
+ */
+
+/**
+ * FilterIterator implementation that filters files based on prefix(es) and/or
+ * suffix(es). Hidden files and files from hidden directories are also filtered.
+ *
+ * @author Sebastian Bergmann <sb@sebastian-bergmann.de>
+ * @copyright 2009-2011 Sebastian Bergmann <sb@sebastian-bergmann.de>
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD License
+ * @version Release: 1.3.0
+ * @link http://github.com/sebastianbergmann/php-file-iterator/tree
+ * @since Class available since Release 1.0.0
+ */
+class File_Iterator extends FilterIterator
+{
+ const PREFIX = 0;
+ const SUFFIX = 1;
+
+ /**
+ * @var array
+ */
+ protected $suffixes = array();
+
+ /**
+ * @var array
+ */
+ protected $prefixes = array();
+
+ /**
+ * @var array
+ */
+ protected $exclude = array();
+
+ /**
+ * @var string
+ */
+ protected $basepath;
+
+ /**
+ * @param Iterator $iterator
+ * @param array $suffixes
+ * @param array $prefixes
+ * @param array $exclude
+ * @param string $basepath
+ */
+ public function __construct(Iterator $iterator, array $suffixes = array(), array $prefixes = array(), array $exclude = array(), $basepath = NULL)
+ {
+ $exclude = array_filter(array_map('realpath', $exclude));
+
+ if ($basepath !== NULL) {
+ $basepath = realpath($basepath);
+ }
+
+ if ($basepath === FALSE) {
+ $basepath = NULL;
+ } else {
+ foreach ($exclude as &$_exclude) {
+ $_exclude = str_replace($basepath, '', $_exclude);
+ }
+ }
+
+ $this->prefixes = $prefixes;
+ $this->suffixes = $suffixes;
+ $this->exclude = $exclude;
+ $this->basepath = $basepath;
+
+ parent::__construct($iterator);
+ }
+
+ /**
+ * @return boolean
+ */
+ public function accept()
+ {
+ $current = $this->getInnerIterator()->current();
+ $filename = $current->getFilename();
+ $realpath = $current->getRealPath();
+
+ if ($this->basepath !== NULL) {
+ $realpath = str_replace($this->basepath, '', $realpath);
+ }
+
+ // Filter files in hidden directories.
+ if (preg_match('=/\.[^/]*/=', $realpath)) {
+ return FALSE;
+ }
+
+ return $this->acceptPath($realpath) &&
+ $this->acceptPrefix($filename) &&
+ $this->acceptSuffix($filename);
+ }
+
+ /**
+ * @param string $path
+ * @return boolean
+ * @since Method available since Release 1.1.0
+ */
+ protected function acceptPath($path)
+ {
+ foreach ($this->exclude as $exclude) {
+ if (strpos($path, $exclude) === 0) {
+ return FALSE;
+ }
+ }
+
+ return TRUE;
+ }
+
+ /**
+ * @param string $filename
+ * @return boolean
+ * @since Method available since Release 1.1.0
+ */
+ protected function acceptPrefix($filename)
+ {
+ return $this->acceptSubString($filename, $this->prefixes, self::PREFIX);
+ }
+
+ /**
+ * @param string $filename
+ * @return boolean
+ * @since Method available since Release 1.1.0
+ */
+ protected function acceptSuffix($filename)
+ {
+ return $this->acceptSubString($filename, $this->suffixes, self::SUFFIX);
+ }
+
+ /**
+ * @param string $filename
+ * @param array $subString
+ * @param integer $type
+ * @return boolean
+ * @since Method available since Release 1.1.0
+ */
+ protected function acceptSubString($filename, array $subStrings, $type)
+ {
+ if (empty($subStrings)) {
+ return TRUE;
+ }
+
+ $matched = FALSE;
+
+ foreach ($subStrings as $string) {
+ if (($type == self::PREFIX && strpos($filename, $string) === 0) ||
+ ($type == self::SUFFIX &&
+ substr($filename, -1 * strlen($string)) == $string)) {
+ $matched = TRUE;
+ break;
+ }
+ }
+
+ return $matched;
+ }
+}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/File_Iterator-1.3.0/LICENSE new/File_Iterator-1.3.0/LICENSE
--- old/File_Iterator-1.3.0/LICENSE 1970-01-01 01:00:00.000000000 +0100
+++ new/File_Iterator-1.3.0/LICENSE 2011-10-31 08:35:20.000000000 +0100
@@ -0,0 +1,33 @@
+File_Iterator
+
+Copyright (c) 2009-2011, Sebastian Bergmann <sebastian@phpunit.de>.
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions
+are met:
+
+ * 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 Sebastian Bergmann nor the names of his
+ 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.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/File_Iterator-1.3.0/README.markdown new/File_Iterator-1.3.0/README.markdown
--- old/File_Iterator-1.3.0/README.markdown 1970-01-01 01:00:00.000000000 +0100
+++ new/File_Iterator-1.3.0/README.markdown 2011-10-31 08:35:20.000000000 +0100
@@ -0,0 +1,23 @@
+File_Iterator
+=============
+
+Installation
+------------
+
+File_Iterator should be installed using the [PEAR Installer](http://pear.php.net/). This installer is the backbone of PEAR, which provides a distribution system for PHP packages, and is shipped with every release of PHP since version 4.3.0.
+
+The PEAR channel (`pear.phpunit.de`) that is used to distribute File_Iterator needs to be registered with the local PEAR environment:
+
+ sb@ubuntu ~ % pear channel-discover pear.phpunit.de
+ Adding Channel "pear.phpunit.de" succeeded
+ Discovery of channel "pear.phpunit.de" succeeded
+
+This has to be done only once. Now the PEAR Installer can be used to install packages from the PHPUnit channel:
+
+ sb@vmware ~ % pear install phpunit/File_Iterator
+ downloading File_Iterator-1.1.1.tgz ...
+ Starting to download File_Iterator-1.1.1.tgz (3,173 bytes)
+ ....done: 3,173 bytes
+ install ok: channel://pear.phpunit.de/File_Iterator-1.1.1
+
+After the installation you can find the File_Iterator source files inside your local PEAR directory; the path is usually `/usr/lib/php/File`.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/package.sig new/package.sig
--- old/package.sig 2011-03-03 12:09:15.000000000 +0100
+++ new/package.sig 2011-10-31 08:35:26.000000000 +0100
@@ -1,7 +1,7 @@
-----BEGIN PGP SIGNATURE-----
-Version: GnuPG v1.4.10 (GNU/Linux)
+Version: GnuPG v1.4.11 (GNU/Linux)
-iEYEABECAAYFAk1vdtsACgkQaGfFFLhbXWnv5ACdGkjNKgna7FN5i1fartBwf7a5
-KuAAoJTYU+JgX55GCHOS3vNJGS/cCMv+
-=xFYJ
+iEYEABECAAYFAk6uT74ACgkQaGfFFLhbXWlC4gCfUizXzyBYaVDtmLbiSMplwtL9
+UjwAn3yn3JauEBw1CI/zXTMC4dQcibnm
+=V4o5
-----END PGP SIGNATURE-----
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/package.xml new/package.xml
--- old/package.xml 2011-03-03 12:09:06.000000000 +0100
+++ new/package.xml 2011-10-31 08:35:20.000000000 +0100
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
-<package packagerversion="1.9.2" version="2.0" xmlns="http://pear.php.net/dtd/package-2.0" xmlns:tasks="http://pear.php.net/dtd/tasks-1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://pear.php.net/dtd/tasks-1.0 http://pear.php.net/dtd/tasks-1.0.xsd http://pear.php.net/dtd/package-2.0 http://pear.php.net/dtd/package-2.0.xsd">
+<package packagerversion="1.9.4" version="2.0" xmlns="http://pear.php.net/dtd/package-2.0" xmlns:tasks="http://pear.php.net/dtd/tasks-1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://pear.php.net/dtd/tasks-1.0 http://pear.php.net/dtd/tasks-1.0.xsd http://pear.php.net/dtd/package-2.0 http://pear.php.net/dtd/package-2.0.xsd">
<name>File_Iterator</name>
<channel>pear.phpunit.de</channel>
<summary>FilterIterator implementation that filters files based on a list of suffixes.</summary>
@@ -10,11 +10,11 @@
<email>sb@sebastian-bergmann.de</email>
<active>yes</active>
</lead>
- <date>2011-03-03</date>
- <time>12:09:06</time>
+ <date>2011-10-31</date>
+ <time>07:35:20</time>
<version>
- <release>1.2.6</release>
- <api>1.2.0</api>
+ <release>1.3.0</release>
+ <api>1.3.0</api>
</version>
<stability>
<release>stable</release>
@@ -26,12 +26,21 @@
</notes>
<contents>
<dir name="/">
- <file baseinstalldir="/" md5sum="b94f61ba396a93cac79139385ea342f1" name="File/Iterator/Factory.php" role="php">
+ <file baseinstalldir="/" md5sum="c29a6f674e13239a00e06a1e0f430f51" name="File/Iterator/Autoload.php" role="php">