{"push_id":577722251,"size":6,"distinct_size":6,"ref":"refs/heads/master","head":"bc736f28cc22f792ec69b043d4e191746ba89738","before":"853a71ad0d6c87ebf2ada3ab28e799a9640f9f91","commits":[{"sha":"846ed144d2c888b68884b6ac9a6c8b0e74d87073","author":{"email":"b8009eb33fc705f91ee6a2ad1919b4550e8cc125@gmail.com","name":"Ramiro Castro"},"message":"Fix timestamp from FTP adapter\n\nWhat does this Pull Request Do?\n-------------------------------\nThe way the timestamp is calculated\n```php\n$timestamp = strtotime($month.' '.$day.' '.$time);\n```\n\nforgets that the FTP server don't show the year if the date is +-6 months. So, was calculating a wrong timestamp somethimes.\n\nWhat I did was ask for the timestamp to the FTP server using\n```php\n$timestamp = ftp_mdtm($this->getConnection(), $name);\n```\nThis solves the problem. Now you can do things like get the last file in a `listContents()` safely.\n\nHow should this be manually tested?\n-----------------------------------\nI added test to this.\n\nAny background context?\n-----------------------\nI need for a project to search for the last file in many FTP accounts. This week I started using the library(which is awesome, thanks!!) and started to have issues about the files I was downloading and processing. Finally saw the issue, the `timestamp`, and here one way I propose to fix it.\n\nAny extra info?\n---------------\nThis fix has a performance issue if the directory have lots of files, becouse, instead of using only one LIST, we'll be adding one MODTIME call to the server for each file. So, we'll end with `N` roundtrips more (`N` number of files in the directory).\n\nOptions:\nAnother option would be to check the date and see if it's +-6 month, and fix it if necessary. It's easy if we get the current date of the server we are running, but to do it properly we should use the date of the FTP server we are in. We can do this by writing a file to check the FTP server's date, but (1) we could be breaking read-only implementa and (2) if we do it do it in the `normalizeObject()` method is as bad for performance (3) if we do it before normalizing, we have to carry the date with us, changing the parameters we actually have for all the other methods until we get to `normalizeObject()`.\n\nHope you find this useful! ;)","distinct":true,"url":"https://api.github.com/repos/thephpleague/flysystem/commits/846ed144d2c888b68884b6ac9a6c8b0e74d87073"},{"sha":"833ad5c9de96887e2055baaedc89237ce07a3113","author":{"email":"b8009eb33fc705f91ee6a2ad1919b4550e8cc125@gmail.com","name":"Ramiro Castro"},"message":"update getTimestamp to use ftp_mdtm","distinct":true,"url":"https://api.github.com/repos/thephpleague/flysystem/commits/833ad5c9de96887e2055baaedc89237ce07a3113"},{"sha":"0ded1dd6873509aa228eba98b78075d7890eda38","author":{"email":"b8009eb33fc705f91ee6a2ad1919b4550e8cc125@gmail.com","name":"Ramiro Castro"},"message":"updated test to get last file using timestamp and check timestamp is not in the listing","distinct":true,"url":"https://api.github.com/repos/thephpleague/flysystem/commits/0ded1dd6873509aa228eba98b78075d7890eda38"},{"sha":"e4b9c126487bbfdb6edfcc509e9f44e7263eaa1a","author":{"email":"b8009eb33fc705f91ee6a2ad1919b4550e8cc125@gmail.com","name":"Ramiro Castro"},"message":"added test dependency","distinct":true,"url":"https://api.github.com/repos/thephpleague/flysystem/commits/e4b9c126487bbfdb6edfcc509e9f44e7263eaa1a"},{"sha":"74b10c50c5cd52011970730ac2d386cd1f02fc48","author":{"email":"b8009eb33fc705f91ee6a2ad1919b4550e8cc125@gmail.com","name":"Ramiro Castro"},"message":"comment some variables","distinct":true,"url":"https://api.github.com/repos/thephpleague/flysystem/commits/74b10c50c5cd52011970730ac2d386cd1f02fc48"},{"sha":"bc736f28cc22f792ec69b043d4e191746ba89738","author":{"email":"59bd0a3ff43b32849b319e645d4798d8a5d1e889@frenky.net","name":"frankdejonge"},"message":"Fixed tests for SynologyFtp","distinct":true,"url":"https://api.github.com/repos/thephpleague/flysystem/commits/bc736f28cc22f792ec69b043d4e191746ba89738"}]}