Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Add cross version constants.

Add constants for older versions of PHP which may be missing them.
Fixes #1975
  • Loading branch information...
commit 73a6ebea8d109e34c9218abb88983f78bce75830 1 parent 5e7509b
@markstory markstory authored
Showing with 20 additions and 0 deletions.
  1. +20 −0 cake/basics.php
View
20 cake/basics.php
@@ -32,6 +32,26 @@
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
*/
if (!function_exists('clone')) {
Please sign in to comment.
Something went wrong with that request. Please try again.