prismicio-community / php-kit

Community maintained development kit for Prismic and the PHP language
https://prismic.io
Other
108 stars 82 forks source link

PREVIEW_COOKIE constant is not autoload-friendly #104

Closed tremby closed 9 years ago

tremby commented 9 years ago

The PREVIEW_COOKIE constant in the Api.php file is in the Prismic namespace but not within the Api class. So it's available at Prismic\PREVIEW_COOKIE, but only if the api.php file has been loaded, which in some cases is only if the autoloader has tried to find the Prismic\Api class.

So in some cases I'm getting an "undefined constant" error.

Perhaps it would could live inside the Api class instead, or somewhere else which can be autoloaded, like a class just meant as a container for constants?

erwan commented 9 years ago

Hi Bart,

You're correct, I just moved it. I kept the original const (deprecated) for compatibility.