From 73a6ebea8d109e34c9218abb88983f78bce75830 Mon Sep 17 00:00:00 2001 From: mark_story Date: Wed, 7 Sep 2011 20:12:22 -0400 Subject: [PATCH] Add cross version constants. Add constants for older versions of PHP which may be missing them. Fixes #1975 --- cake/basics.php | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/cake/basics.php b/cake/basics.php index dc4f4461d..907dd2717 100644 --- a/cake/basics.php +++ b/cake/basics.php @@ -31,6 +31,26 @@ define('MONTH', 2592000); define('YEAR', 31536000); +/** + * Patch old versions of PHP4. + */ +if (!defined('PHP_EOL')) { + switch (strtoupper(substr(PHP_OS, 0, 3))) { + case 'WIN': + define('PHP_EOL', "\r\n"); + break; + default: + define('PHP_EOL', "\n"); + } +} + +/** + * Patch PHP4 and PHP5.0 + */ +if (!defined('DATE_RFC2822')) { + define('DATE_RFC2822', 'D, d M Y H:i:s O'); +} + /** * Patch for PHP < 5.0 */