-
Notifications
You must be signed in to change notification settings - Fork 9
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
adding file creation and modified date support + more debugging output #47
base: master
Are you sure you want to change the base?
Conversation
Cool, thank you for your Pull Request. Please change the variables to Camel Case. For example, For a complete list of all failed checks see: https://travis-ci.org/TheFox/flickr-cli/jobs/451572044 |
@TheFox clean build. Let me know if need more tweaks. |
SimpleXMLElement $photo, | ||
string $destinationPath, | ||
string $basename = null, | ||
string $debugInfo |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Setting a default value in the 3rd argument and then setting no default argument in the 4th should be avoided. This is in general not best practice. Either setting also a default value for $debugInfo
or switch: ... string $debugInfo, string $basename = null)
. Since $destinationPath
and $basename
are both path related I would prefer to also set a default value for $debugInfo
.
You see, this line
$photo = $this->downloadPhoto($photo, $destinationPath, $id, "");
doesn't look very nice. Because the empty string ""
can be avoided.
Having a default value and a caller like this,
$photo = $this->downloadPhoto($photo, $destinationPath, $id);
also looks nicer.
|
||
// update the timstamps of the file | ||
$update_date = (int) $photo->dates['lastupdate']; | ||
$taken_date = strtotime((string) $photo->dates['taken']); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use
strval($photo->dates['taken'])
instead of
(string) $photo->dates['taken']
here. The same goes for (int)
. Use intval()
instead.
created files were having "now()" to their creation and modified timestamps. used flickr photo meta data to update after file creation on the fs.
added photo number, total photos in that page and page indicators aside of the album/photoset currently downloading for better understanding to the progress of the download. Example: