Incompatibilidad con PHP
Versión 1 (Guillermo Zdanowicz, 14/04/2016 09:14)
1 | 1 | Guillermo Zdanowicz | h1. Incompatibilidad con PHP |
---|---|---|---|
2 | 1 | Guillermo Zdanowicz | |
3 | 1 | Guillermo Zdanowicz | en settings.yml : |
4 | 1 | Guillermo Zdanowicz | |
5 | 1 | Guillermo Zdanowicz | <pre> |
6 | 1 | Guillermo Zdanowicz | dev: |
7 | 1 | Guillermo Zdanowicz | .settings: |
8 | 1 | Guillermo Zdanowicz | error_reporting: <?php echo ((E_ALL | E_STRICT) ^ E_DEPRECATED)."\n" ?> |
9 | 1 | Guillermo Zdanowicz | </pre> |
10 | 1 | Guillermo Zdanowicz | |
11 | 1 | Guillermo Zdanowicz | |
12 | 1 | Guillermo Zdanowicz | en lib/vendor/symfony/lib/response/sfWebResponse.class.php on line 409 |
13 | 1 | Guillermo Zdanowicz | |
14 | 1 | Guillermo Zdanowicz | <pre> |
15 | 1 | Guillermo Zdanowicz | protected function normalizeHeaderName($name) |
16 | 1 | Guillermo Zdanowicz | { |
17 | 1 | Guillermo Zdanowicz | // return preg_replace('/\-(.)/e', "'-'.strtoupper('\\1')", strtr(ucfirst(strtolower($name)), '_', '-')); |
18 | 1 | Guillermo Zdanowicz | |
19 | 1 | Guillermo Zdanowicz | return preg_replace_callback( |
20 | 1 | Guillermo Zdanowicz | '/\-(.)/', |
21 | 1 | Guillermo Zdanowicz | function ($matches) { |
22 | 1 | Guillermo Zdanowicz | return '-'.strtoupper($matches[1]); |
23 | 1 | Guillermo Zdanowicz | }, |
24 | 1 | Guillermo Zdanowicz | strtr(ucfirst(strtolower($name)), '_', '-') |
25 | 1 | Guillermo Zdanowicz | ); |
26 | 1 | Guillermo Zdanowicz | } |
27 | 1 | Guillermo Zdanowicz | </pre> |
28 | 1 | Guillermo Zdanowicz | |
29 | 1 | Guillermo Zdanowicz | |
30 | 1 | Guillermo Zdanowicz | en /lib/vendor/symfony/lib/util/sfToolkit.class.php on line 360 |
31 | 1 | Guillermo Zdanowicz | |
32 | 1 | Guillermo Zdanowicz | <pre> |
33 | 1 | Guillermo Zdanowicz | public static function pregtr($search, $replacePairs){ |
34 | 1 | Guillermo Zdanowicz | // return preg_replace(array_keys($replacePairs), array_values($replacePairs), $search); |
35 | 1 | Guillermo Zdanowicz | foreach($replacePairs as $pattern => $replacement) |
36 | 1 | Guillermo Zdanowicz | { |
37 | 1 | Guillermo Zdanowicz | if (preg_match('/(.*)e$/', $pattern, $matches)) |
38 | 1 | Guillermo Zdanowicz | { |
39 | 1 | Guillermo Zdanowicz | $pattern = $matches[1]; |
40 | 1 | Guillermo Zdanowicz | $search = preg_replace_callback($pattern, function ($matches) use ($replacement) { |
41 | 1 | Guillermo Zdanowicz | preg_match("/('::'\.)?([a-z]*)\('\\\\([0-9]{1})'\)/", $replacement, $match); |
42 | 1 | Guillermo Zdanowicz | return ($match[1]==''?'':'::').call_user_func($match[2], $matches[$match[3]]); |
43 | 1 | Guillermo Zdanowicz | }, $search); |
44 | 1 | Guillermo Zdanowicz | } |
45 | 1 | Guillermo Zdanowicz | else |
46 | 1 | Guillermo Zdanowicz | { |
47 | 1 | Guillermo Zdanowicz | $search = preg_replace($pattern, $replacement, $search); |
48 | 1 | Guillermo Zdanowicz | } |
49 | 1 | Guillermo Zdanowicz | } |
50 | 1 | Guillermo Zdanowicz | return $search; |
51 | 1 | Guillermo Zdanowicz | } |
52 | 1 | Guillermo Zdanowicz | </pre> |