Skip to content

Commit

Permalink
Add cross version constants.
Browse files Browse the repository at this point in the history
Add constants for older versions of PHP which may be missing them.
Fixes #1975
  • Loading branch information
markstory committed Sep 8, 2011
1 parent 5e7509b commit 73a6ebe
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions cake/basics.php
Expand Up @@ -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
*/
Expand Down

0 comments on commit 73a6ebe

Please sign in to comment.