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?
The
PREVIEW_COOKIE
constant in the Api.php file is in thePrismic
namespace but not within theApi
class. So it's available atPrismic\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 thePrismic\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?