Skip to content
This repository
Browse code

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
Mark Story authored September 07, 2011

Showing 1 changed file with 20 additions and 0 deletions. Show diff stats Hide diff stats

  1. 20  cake/basics.php
20  cake/basics.php
@@ -32,6 +32,26 @@
32 32
 	define('YEAR', 31536000);
33 33
 
34 34
 /**
  35
+ * Patch old versions of PHP4.
  36
+ */
  37
+if (!defined('PHP_EOL')) {
  38
+	switch (strtoupper(substr(PHP_OS, 0, 3))) {
  39
+		case 'WIN':
  40
+			define('PHP_EOL', "\r\n");
  41
+			break;
  42
+		default:
  43
+			define('PHP_EOL', "\n");
  44
+	}
  45
+}
  46
+
  47
+/**
  48
+ * Patch PHP4 and PHP5.0
  49
+ */
  50
+if (!defined('DATE_RFC2822')) {
  51
+	define('DATE_RFC2822', 'D, d M Y H:i:s O');
  52
+}
  53
+
  54
+/**
35 55
  * Patch for PHP < 5.0
36 56
  */
37 57
 if (!function_exists('clone')) {

0 notes on commit 73a6ebe

Please sign in to comment.
Something went wrong with that request. Please try again.