Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[2.1][Component][Finder] $this->current() fix #4335

Merged
merged 1 commit into from
Jun 19, 2012
Merged

[2.1][Component][Finder] $this->current() fix #4335

merged 1 commit into from
Jun 19, 2012

Conversation

gajdaw
Copy link
Contributor

@gajdaw gajdaw commented May 19, 2012

Bug fix: yes
Feature addition: no
Backwards compatibility break: no
Symfony2 tests pass: Build Status
Fixes the following tickets: -
Todo: -
License of the code: MIT

One method to resolve ->in("ftp://...") problem is to create RecursiveDirectoryFtpIterator.
(Details: issue 3585)

I think that all filters should access the information about current item calling current() or getInnerIterator(). Otherwise it will not work if we replace RecursiveDirectoryIterator with ftp iterator inside Finder.

I'm not sure if that should go to 2.0 or 2.1 branch.

@travisbot
Copy link

This pull request passes (merged 9f247921 into 58b9245).

@gajdaw
Copy link
Contributor Author

gajdaw commented May 19, 2012

Probably it should go to master branch, because it improves commit done to master:

f2fea97

$iterator = new FilecontentFilterIterator($inner, array('file r+'), array());
$array = iterator_to_array($iterator);
}

}

class ContentInnerNameIterator extends \ArrayIterator
class FauxFile extends \SplFileInfo
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FauxFile ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Faux => not real. MockFile will be better? Maybe MockSplFileInfo?

@travisbot
Copy link

This pull request passes (merged f9d1db8c into 58b9245).

@travisbot
Copy link

This pull request fails (merged f1b4b4f7 into 58b9245).

@travisbot
Copy link

This pull request passes (merged b6d073da into 58b9245).

*
* @return string the contents of the file
*/
public function fileGetContents()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why not getContents() ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed.

@travisbot
Copy link

This pull request passes (merged fd144c96 into 58b9245).

@travisbot
Copy link

This pull request passes (merged 89a8d851 into 58b9245).

$error = error_get_last();
throw new \RuntimeException($error['message']);
}
return $content;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

missing empty line before the return statement

@travisbot
Copy link

This pull request passes (merged 0d5b8322 into 58b9245).

@travisbot
Copy link

This pull request passes (merged 3eb67fc into 1407f11).

@stof
Copy link
Member

stof commented Jun 9, 2012

seems good

fabpot added a commit that referenced this pull request Jun 19, 2012
Commits
-------

3eb67fc [2.1][Component][Finder] $this->current() fix

Discussion
----------

[2.1][Component][Finder] $this->current() fix

Bug fix: yes
Feature addition: no
Backwards compatibility break: no
Symfony2 tests pass: [![Build Status](https://secure.travis-ci.org/gajdaw/symfony.png?branch=master)](http://travis-ci.org/gajdaw/symfony)
Fixes the following tickets: -
Todo: -
License of the code: MIT

One method to resolve `->in("ftp://...")` problem is to create `RecursiveDirectoryFtpIterator`.
(Details: [issue 3585](#3585))

I think that all filters should access the information about current item calling `current()` or `getInnerIterator()`. Otherwise it will not work if we replace `RecursiveDirectoryIterator` with ftp iterator inside `Finder`.

I'm not sure if that should go to 2.0 or 2.1 branch.

---------------------------------------------------------------------------

by travisbot at 2012-05-19T09:20:19Z

This pull request [passes](http://travis-ci.org/symfony/symfony/builds/1373361) (merged 9f247921 into 58b9245).

---------------------------------------------------------------------------

by gajdaw at 2012-05-19T10:51:10Z

Probably it should go to master branch, because it improves commit done to master:

f2fea97

---------------------------------------------------------------------------

by travisbot at 2012-05-19T11:26:14Z

This pull request [passes](http://travis-ci.org/symfony/symfony/builds/1373982) (merged f9d1db8c into 58b9245).

---------------------------------------------------------------------------

by travisbot at 2012-05-19T11:51:25Z

This pull request [fails](http://travis-ci.org/symfony/symfony/builds/1374031) (merged f1b4b4f7 into 58b9245).

---------------------------------------------------------------------------

by travisbot at 2012-05-19T12:48:17Z

This pull request [passes](http://travis-ci.org/symfony/symfony/builds/1374303) (merged b6d073da into 58b9245).

---------------------------------------------------------------------------

by travisbot at 2012-05-19T13:28:18Z

This pull request [passes](http://travis-ci.org/symfony/symfony/builds/1374568) (merged fd144c96 into 58b9245).

---------------------------------------------------------------------------

by travisbot at 2012-05-19T13:35:38Z

This pull request [passes](http://travis-ci.org/symfony/symfony/builds/1374609) (merged 89a8d851 into 58b9245).

---------------------------------------------------------------------------

by travisbot at 2012-05-21T04:31:46Z

This pull request [passes](http://travis-ci.org/symfony/symfony/builds/1385764) (merged 0d5b8322 into 58b9245).

---------------------------------------------------------------------------

by travisbot at 2012-05-21T07:21:56Z

This pull request [passes](http://travis-ci.org/symfony/symfony/builds/1386545) (merged 3eb67fc into 1407f11).

---------------------------------------------------------------------------

by stof at 2012-06-09T13:24:14Z

seems good
@fabpot fabpot merged commit 3eb67fc into symfony:master Jun 19, 2012
public function getContents()
{
$level = error_reporting(0);
$content = file_get_contents($this->getRealpath());
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use openFile and SplFileObject::fpassthu

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@housebolt
Copy link

As of the latest pull, using an FTP stream wrapper still respond with a warning: "PHP Warning: FilesystemIterator::rewind(): stream does not support seeking", and misses the first file in every folder

@stof
Copy link
Member

stof commented Oct 4, 2012

@housebolt Please open a ticket instead of commenting on a PR merged 4 months ago (as this would be lost)

@housebolt
Copy link

@stof, am in the process of putting together a ticket, just making it known for those who run into the same issue and come across this thread, thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants