Hello community,
here is the log from the commit of package php5-pear-phpunit-File_Iterator for
openSUSE:Factory checked in at 2013-08-15 12:24:08
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
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"
Changes:
--------
---
/work/SRC/openSUSE:Factory/php5-pear-phpunit-File_Iterator/php5-pear-phpunit-File_Iterator.changes
2012-02-29 14:09:45.000000000 +0100
+++
/work/SRC/openSUSE:Factory/.php5-pear-phpunit-File_Iterator.new/php5-pear-phpunit-File_Iterator.changes
2013-08-15 12:24:09.000000000 +0200
@@ -1,0 +2,7 @@
+Sun Aug 4 21:33:22 UTC 2013 - [email protected]
+
+- Updated to version 1.3.3
+ * Fixed infinite loop in `File_Iterator_Facade::getCommonPath()`
+ for empty directories.
+
+-------------------------------------------------------------------
Old:
----
File_Iterator-1.3.0.tgz
New:
----
File_Iterator-1.3.3.tgz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ php5-pear-phpunit-File_Iterator.spec ++++++
--- /var/tmp/diff_new_pack.PunXB4/_old 2013-08-15 12:24:10.000000000 +0200
+++ /var/tmp/diff_new_pack.PunXB4/_new 2013-08-15 12:24:10.000000000 +0200
@@ -1,7 +1,7 @@
#
# spec file for package php5-pear-phpunit-File_Iterator
#
-# Copyright (c) 2012 SUSE LINUX Products GmbH, Nuernberg, Germany.
+# Copyright (c) 2013 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,15 +16,14 @@
#
-
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.3.3
+Release: 0
Source0: http://pear.phpunit.de/get/File_Iterator-%{version}.tgz
Url: http://pear.phpunit.de/
Requires: php5-pear-channel-phpunit
@@ -34,13 +33,14 @@
BuildArch: noarch
# Fix for renaming (package convention)
-Provides: php5-pear-%{pear_sname} = %{version}
-Provides: php-pear-%{pear_sname} = %{version}
-Provides: php-pear-%{pear_name} pear-%{pear_name}
+Provides: pear-%{pear_name}
Provides: pear-%{pear_sname} = %{version}
-Obsoletes: php5-pear-%{pear_sname} < %{version}
-Obsoletes: php-pear-%{pear_sname} < %{version}
+Provides: php-pear-%{pear_name}
+Provides: php-pear-%{pear_sname} = %{version}
+Provides: php5-pear-%{pear_sname} = %{version}
Obsoletes: pear-%{pear_sname} < %{version}
+Obsoletes: php-pear-%{pear_sname} < %{version}
+Obsoletes: php5-pear-%{pear_sname} < %{version}
%description
FilterIterator implementation that filters files based on a list of suffixes.
++++++ File_Iterator-1.3.0.tgz -> File_Iterator-1.3.3.tgz ++++++
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 2011-10-31 08:35:20.000000000
+0100
+++ new/File_Iterator-1.3.0/ChangeLog.markdown 1970-01-01 01:00:00.000000000
+0100
@@ -1,11 +0,0 @@
-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 2011-10-31
08:35:20.000000000 +0100
+++ new/File_Iterator-1.3.0/File/Iterator/Autoload.php 1970-01-01
01:00:00.000000000 +0100
@@ -1,75 +0,0 @@
-<?php
-/**
- * php-file-iterator
- *
- * Copyright (c) 2009-2011, Sebastian Bergmann <[email protected]>.
- * 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 <[email protected]>
- * @copyright 2009-2011 Sebastian Bergmann <[email protected]>
- * @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 2011-10-31
08:35:20.000000000 +0100
+++ new/File_Iterator-1.3.0/File/Iterator/Facade.php 1970-01-01
01:00:00.000000000 +0100
@@ -1,157 +0,0 @@
-<?php
-/**
- * php-file-iterator
- *
- * Copyright (c) 2009-2011, Sebastian Bergmann <[email protected]>.
- * 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 <[email protected]>
- * @copyright 2009-2011 Sebastian Bergmann <[email protected]>
- * @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 <[email protected]>
- * @copyright 2009-2011 Sebastian Bergmann <[email protected]>
- * @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 2011-10-31
08:35:20.000000000 +0100
+++ new/File_Iterator-1.3.0/File/Iterator/Factory.php 1970-01-01
01:00:00.000000000 +0100
@@ -1,120 +0,0 @@
-<?php
-/**
- * php-file-iterator
- *
- * Copyright (c) 2009-2011, Sebastian Bergmann <[email protected]>.
- * 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 <[email protected]>
- * @copyright 2009-2011 Sebastian Bergmann <[email protected]>
- * @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 <[email protected]>
- * @copyright 2009-2011 Sebastian Bergmann <[email protected]>
- * @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 2011-10-31 08:35:20.000000000
+0100
+++ new/File_Iterator-1.3.0/File/Iterator.php 1970-01-01 01:00:00.000000000
+0100
@@ -1,196 +0,0 @@
-<?php
-/**
- * php-file-iterator
- *
- * Copyright (c) 2009-2011, Sebastian Bergmann <[email protected]>.
- * 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 <[email protected]>
- * @copyright 2009-2011 Sebastian Bergmann <[email protected]>
- * @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 <[email protected]>
- * @copyright 2009-2011 Sebastian Bergmann <[email protected]>
- * @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 2011-10-31 08:35:20.000000000 +0100
+++ new/File_Iterator-1.3.0/LICENSE 1970-01-01 01:00:00.000000000 +0100
@@ -1,33 +0,0 @@
-File_Iterator
-
-Copyright (c) 2009-2011, Sebastian Bergmann <[email protected]>.
-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 2011-10-31 08:35:20.000000000
+0100
+++ new/File_Iterator-1.3.0/README.markdown 1970-01-01 01:00:00.000000000
+0100
@@ -1,23 +0,0 @@
-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/File_Iterator-1.3.3/ChangeLog.markdown
new/File_Iterator-1.3.3/ChangeLog.markdown
--- old/File_Iterator-1.3.3/ChangeLog.markdown 1970-01-01 01:00:00.000000000
+0100
+++ new/File_Iterator-1.3.3/ChangeLog.markdown 2012-10-11 12:49:58.000000000
+0200
@@ -0,0 +1,26 @@
+File_Iterator 1.3
+=================
+
+This is the list of changes for the File_Iterator 1.3 release series.
+
+File_Iterator 1.3.3
+-------------------
+
+* No changes.
+
+File_Iterator 1.3.2
+-------------------
+
+* No changes.
+
+File_Iterator 1.3.1
+-------------------
+
+* Fixed infinite loop in `File_Iterator_Facade::getCommonPath()` for empty
directories.
+
+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.3/File/Iterator/Autoload.php
new/File_Iterator-1.3.3/File/Iterator/Autoload.php
--- old/File_Iterator-1.3.3/File/Iterator/Autoload.php 1970-01-01
01:00:00.000000000 +0100
+++ new/File_Iterator-1.3.3/File/Iterator/Autoload.php 2012-10-11
12:49:58.000000000 +0200
@@ -0,0 +1,66 @@
+<?php
+/**
+ * php-file-iterator
+ *
+ * Copyright (c) 2009-2012, Sebastian Bergmann <[email protected]>.
+ * 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 <[email protected]>
+ * @copyright 2009-2012 Sebastian Bergmann <[email protected]>
+ * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD
3-Clause License
+ * @since File available since Release 1.3.0
+ */
+
+spl_autoload_register(
+ function ($class)
+ {
+ 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__));
+ }
+
+ $cn = strtolower($class);
+
+ if (isset($classes[$cn])) {
+ require $path . $classes[$cn];
+ }
+ }
+);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/File_Iterator-1.3.3/File/Iterator/Facade.php
new/File_Iterator-1.3.3/File/Iterator/Facade.php
--- old/File_Iterator-1.3.3/File/Iterator/Facade.php 1970-01-01
01:00:00.000000000 +0100
+++ new/File_Iterator-1.3.3/File/Iterator/Facade.php 2012-10-11
12:49:58.000000000 +0200
@@ -0,0 +1,161 @@
+<?php
+/**
+ * php-file-iterator
+ *
+ * Copyright (c) 2009-2012, Sebastian Bergmann <[email protected]>.
+ * 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 <[email protected]>
+ * @copyright 2009-2012 Sebastian Bergmann <[email protected]>
+ * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD
3-Clause 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 <[email protected]>
+ * @copyright 2009-2012 Sebastian Bergmann <[email protected]>
+ * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD
3-Clause License
+ * @version Release: 1.3.3
+ * @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 == 0) {
+ return '';
+ }
+
+ 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 DIRECTORY_SEPARATOR . $common;
+ }
+}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/File_Iterator-1.3.3/File/Iterator/Factory.php
new/File_Iterator-1.3.3/File/Iterator/Factory.php
--- old/File_Iterator-1.3.3/File/Iterator/Factory.php 1970-01-01
01:00:00.000000000 +0100
+++ new/File_Iterator-1.3.3/File/Iterator/Factory.php 2012-10-11
12:49:58.000000000 +0200
@@ -0,0 +1,120 @@
+<?php
+/**
+ * php-file-iterator
+ *
+ * Copyright (c) 2009-2012, Sebastian Bergmann <[email protected]>.
+ * 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 <[email protected]>
+ * @copyright 2009-2012 Sebastian Bergmann <[email protected]>
+ * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD
3-Clause 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 <[email protected]>
+ * @copyright 2009-2012 Sebastian Bergmann <[email protected]>
+ * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD
3-Clause License
+ * @version Release: 1.3.3
+ * @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.3/File/Iterator.php
new/File_Iterator-1.3.3/File/Iterator.php
--- old/File_Iterator-1.3.3/File/Iterator.php 1970-01-01 01:00:00.000000000
+0100
+++ new/File_Iterator-1.3.3/File/Iterator.php 2012-10-11 12:49:58.000000000
+0200
@@ -0,0 +1,196 @@
+<?php
+/**
+ * php-file-iterator
+ *
+ * Copyright (c) 2009-2012, Sebastian Bergmann <[email protected]>.
+ * 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 <[email protected]>
+ * @copyright 2009-2012 Sebastian Bergmann <[email protected]>
+ * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD
3-Clause 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 <[email protected]>
+ * @copyright 2009-2012 Sebastian Bergmann <[email protected]>
+ * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD
3-Clause License
+ * @version Release: 1.3.3
+ * @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.3/LICENSE
new/File_Iterator-1.3.3/LICENSE
--- old/File_Iterator-1.3.3/LICENSE 1970-01-01 01:00:00.000000000 +0100
+++ new/File_Iterator-1.3.3/LICENSE 2012-10-11 12:49:58.000000000 +0200
@@ -0,0 +1,33 @@
+File_Iterator
+
+Copyright (c) 2009-2012, Sebastian Bergmann <[email protected]>.
+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.3/README.markdown
new/File_Iterator-1.3.3/README.markdown
--- old/File_Iterator-1.3.3/README.markdown 1970-01-01 01:00:00.000000000
+0100
+++ new/File_Iterator-1.3.3/README.markdown 2012-10-11 12:49:58.000000000
+0200
@@ -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-10-31 08:35:26.000000000 +0100
+++ new/package.sig 2012-10-11 12:50:07.000000000 +0200
@@ -1,7 +1,7 @@
-----BEGIN PGP SIGNATURE-----
-Version: GnuPG v1.4.11 (GNU/Linux)
+Version: GnuPG v1.4.12 (GNU/Linux)
-iEYEABECAAYFAk6uT74ACgkQaGfFFLhbXWlC4gCfUizXzyBYaVDtmLbiSMplwtL9
-UjwAn3yn3JauEBw1CI/zXTMC4dQcibnm
-=V4o5
+iEYEABECAAYFAlB2pF8ACgkQaGfFFLhbXWlvpACeM+BNlYVlypQ40Z3PibtRD2Tv
+ZHMAn2ozJbGmMR5546BK1nCeOKjG9ATC
+=W371
-----END PGP SIGNATURE-----
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/package.xml new/package.xml
--- old/package.xml 2011-10-31 08:35:20.000000000 +0100
+++ new/package.xml 2012-10-11 12:49:58.000000000 +0200
@@ -10,46 +10,46 @@
<email>[email protected]</email>
<active>yes</active>
</lead>
- <date>2011-10-31</date>
- <time>07:35:20</time>
+ <date>2012-10-11</date>
+ <time>10:49:58</time>
<version>
- <release>1.3.0</release>
+ <release>1.3.3</release>
<api>1.3.0</api>
</version>
<stability>
<release>stable</release>
<api>stable</api>
</stability>
- <license>BSD License</license>
+ <license>The BSD 3-Clause License</license>
<notes>
http://github.com/sebastianbergmann/php-file-iterator/tree
</notes>
<contents>
<dir name="/">
- <file baseinstalldir="/" md5sum="c29a6f674e13239a00e06a1e0f430f51"
name="File/Iterator/Autoload.php" role="php">
+ <file baseinstalldir="/" md5sum="d20cbe32d7404fffe67d5cf5b21f804a"
name="File/Iterator/Autoload.php" role="php">
<tasks:replace from="@package_version@" to="version" type="package-info" />
</file>
- <file baseinstalldir="/" md5sum="9d41185dfdf864314f115833016b9cbd"
name="File/Iterator/Facade.php" role="php">
+ <file baseinstalldir="/" md5sum="23f34516b3d3c20d7e34e99e5889956d"
name="File/Iterator/Facade.php" role="php">
<tasks:replace from="@package_version@" to="version" type="package-info" />
</file>
- <file baseinstalldir="/" md5sum="50afc594ba86e47c301d6479c8eb9d8c"
name="File/Iterator/Factory.php" role="php">
+ <file baseinstalldir="/" md5sum="68dd7e75ddb743c6e1560c9ac3478f17"
name="File/Iterator/Factory.php" role="php">
<tasks:replace from="@package_version@" to="version" type="package-info" />
</file>
- <file baseinstalldir="/" md5sum="145c4c9879405574527a85d7493a02b6"
name="File/Iterator.php" role="php">
+ <file baseinstalldir="/" md5sum="af57abf4b6738d4ae981e32b0b9a2f78"
name="File/Iterator.php" role="php">
<tasks:replace from="@package_version@" to="version" type="package-info" />
</file>
- <file baseinstalldir="/" md5sum="afdc0b086464c741eee235b891522e84"
name="ChangeLog.markdown" role="doc" />
- <file baseinstalldir="/" md5sum="967973d16b0a888f75df537da1374266"
name="LICENSE" role="doc" />
+ <file baseinstalldir="/" md5sum="df92f50d82da8baec1a43781d77d0989"
name="ChangeLog.markdown" role="doc" />
+ <file baseinstalldir="/" md5sum="6a1be571d67b189405c7770a588b5ece"
name="LICENSE" role="doc" />
<file baseinstalldir="/" md5sum="9b631fc7945bad76a8f367e7bb7504cf"
name="README.markdown" role="doc" />
</dir>
</contents>
<dependencies>
<required>
<php>
- <min>5.2.7</min>
+ <min>5.3.3</min>
</php>
<pearinstaller>
- <min>1.9.2</min>
+ <min>1.9.4</min>
</pearinstaller>
</required>
</dependencies>
--
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]