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

Fix listContents() when includes a directory #3

Merged

Conversation

cramiro
Copy link

@cramiro cramiro commented Feb 19, 2015

What does this Pull Request Do?

  • Modified the normalizeListingObject() method. Identify the type of the object to normalize. If it's a 'file' the method will still return the same as before, if it's a 'dir' we take out visibility and size from the returned array.

How should this be manually tested?

A test was included with a similar output you can get in a server, which doesn't include the 'size'.

The test is mostly the same as testListContents. I can fix that test to reflect the situation where the server doesn't return the 'size' and remove the last test I created, if you think it's best.

Any background context you want to provide?

Currently there's a php Notice when trying to list the content of a directory with sub-directories.

What are the relevant tickets?

Any extra info?

This is a minor bug. Please, give it a try and let me know.

What does this Pull Request Do?
-------------------------------
* Modified the `normalizeListingObject()` method. Identify the type of the object to normalize. If it's a 'file' the method will still return the same as before, if it's a 'dir' we take out `visibility` and `size` from the returned array.

How should this be manually tested?
-----------------------------------
A test was included with a similar output you can get in a server, which doesn't include the 'size'.

Any background context you want to provide?
-------------------------------------------
Currently there's a php `Notice` when trying to list the content of a directory with sub-directories.

What are the relevant tickets?
------------------------------
* [Undefined index: size when trying to get the listing of a directories with subdirectories · Issue thephpleague#2 · thephpleague/flysystem-sftp](thephpleague#2)

Any extra info?
---------------
This is a minor bug. Please, give it a try and let me know.
@cramiro
Copy link
Author

cramiro commented Feb 23, 2015

@frankdejonge any feedback here?

frankdejonge added a commit that referenced this pull request Feb 23, 2015
Fix listContents() when includes a directory
@frankdejonge frankdejonge merged commit df8f545 into thephpleague:master Feb 23, 2015
@cramiro cramiro deleted the rcastro_fixNormalizeObject branch February 24, 2015 12:35
@torian257x torian257x mentioned this pull request Aug 18, 2018
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.

2 participants