PHP userland backwards compatibility layer that emulates PHP 5.5+ core functions.

⌈⌋ ⎇ branch:  upgrade.php


Check-in [c912a27a31]

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:moved as it lacks mutli-line comparisons
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: c912a27a3121ec5386d1653509cdec0f757c2489
User & Date: mario 2012-01-09 15:37:40
Context
2012-01-09
15:38
keeps history of versions now for easier comparisons against check-in: fc8dbed561 user: mario tags: trunk
15:37
moved as it lacks mutli-line comparisons check-in: c912a27a31 user: mario tags: trunk
2012-01-08
14:47
patched str_getcsv whitespace handling, added PHP 5.4.0 and mostly full $options support in json_encode and json_decode check-in: 090c7aecf1 user: mario tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

doc/devtools/ckavail.php became executable.

Name change from ext/mime.php to ext/unfinished/mime.php.

30
31
32
33
34
35
36










37
38
39
40
41
42
43
44
45
46
47
48
49
50
      }
      elseif (!file_exists($fn)) {
         return false;
      }
      else {
         return("application/octet-stream");   // give up
      }











      #-- use PECL::fileinfo when available
      if (function_exists("finfo_buffer")) {
         if (!isset($mime_magic_data)) {
            $mime_magic_data = finfo_open(MAGIC_MIME);
         }
         $type = finfo_buffer($bin);
         return($type);
      }
      
      #-- read in magic data, when called for the very first time
      if (!isset($mime_content_type)) {
      
         if ((file_exists($fn = ini_get("mime_magic.magicfile")))







>
>
>
>
>
>
>
>
>
>



<
|
<
|







30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49

50

51
52
53
54
55
56
57
58
      }
      elseif (!file_exists($fn)) {
         return false;
      }
      else {
         return("application/octet-stream");   // give up
      }
      
      #-- use the appropriate external tool
      /*
      if (function_exists("exec") && !ini_get("safe_mode")) {     
         $type = exec("file -iL " . escapeshellcmd($fn) . " 2>/dev/null");
         if ($type = trim(strtok(substr(strrchr($type, ":"), 1), ";"))) {
             return $type;
         }
      }
      */

      #-- use PECL::fileinfo when available
      if (function_exists("finfo_buffer")) {

         $fi = new finfo(FILEINFO_MIME_TYPE);

         $type = $fi->buffer($bin);
         return($type);
      }
      
      #-- read in magic data, when called for the very first time
      if (!isset($mime_content_type)) {
      
         if ((file_exists($fn = ini_get("mime_magic.magicfile")))
106
107
108
109
110
111
112

113
114
115
116
117
118
119
                  $len = strlen($magic);
                  if ($mask) { 
                     continue;
                  }
               }
               #-- numeric values
               else {


                  if ((ord($magic[0]) < 48) or (ord($magic[0]) > 57)) {
#echo "\nmagicnumspec=$line\n";
#var_dump($l);
                     continue;  #-- skip specials like  >, x, <, ^, &
                  }








>







114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
                  $len = strlen($magic);
                  if ($mask) { 
                     continue;
                  }
               }
               #-- numeric values
               else {
                  $mask or $mask = 0xFFFFFFFF;

                  if ((ord($magic[0]) < 48) or (ord($magic[0]) > 57)) {
#echo "\nmagicnumspec=$line\n";
#var_dump($l);
                     continue;  #-- skip specials like  >, x, <, ^, &
                  }