I have several constants in a PHP application I'm developing. I've defined a Constants class and the defined the constants as const VAR_NAME = value; in this class. I would like to share these constants between my JavaScript and PHP code. Is there a DRY (Don't Repeat Yourself) mechanism to share them?
class Constants {
const RESOURCE_TYPE_REGSITER = 2;
const RESOURCE_TYPE_INFO = 1;
}