Skip to content
This repository has been archived by the owner on Jul 22, 2021. It is now read-only.

Cleanup global namespace #61

Open
ctrahey opened this issue Feb 2, 2014 · 0 comments
Open

Cleanup global namespace #61

ctrahey opened this issue Feb 2, 2014 · 0 comments

Comments

@ctrahey
Copy link

ctrahey commented Feb 2, 2014

sdk.class.php issues a call to unset() at the bottom of the file, and unsets several variables. At the surface, this is good housekeeping. However, these are all in the global namespace and therefore conflict with the calling scope.

A concrete example: I'm using the SDK in Drupal, and their library loading mechanism uses a variable called $path in the vary part of the code that requires this file, and it's in a loop (loading several of the files in this sdk). After including sdk.class.php, the $path variable is no longer present and subsequent file paths can no longer be created.

My suggestion is to use 'aws' namespaced variables (and not necessarily the PHP Namespace feature, though that would be great), but at least things like $aws_config_path instead of simply $path if you must use a global scope.

Cheers!

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

No branches or pull requests

1 participant