CodeIgniter-Dropbox-API-Library icon indicating copy to clipboard operation
CodeIgniter-Dropbox-API-Library copied to clipboard

allow empty metadata()

Open byjpr opened this issue 10 years ago • 3 comments

Fixed issue where function metadata threw and error because of it being empty if you wanted to read the root directory

byjpr avatar Nov 04 '15 02:11 byjpr

Wouldn't you just pass a slash for the root directory?

$lib->metadata('/');

jimdoescode avatar Nov 04 '15 02:11 jimdoescode

I'm trying to figure out if there is a difference between passing a string with a slash vs not passing anything.

$lib->metadata('/');
$lib->metadata();

If these two calls are indeed functionally equivalent with your change then I'd argue that the first is more expressive than the second.

What are your thoughts @byjord? I don't have a CI env set up to test these anymore do you know if the call with the slash works? I remember it working when I tested this awhile back, but Dropbox could have changed the API since then.

jimdoescode avatar Nov 04 '15 20:11 jimdoescode

To me, programming the Library to just assume null when empty instead of absolutely requiring a path be declaired seems like a nicer way to stay sain during a development. I will double check and get back to you about the slash.

byjpr avatar Nov 14 '15 00:11 byjpr