]> git.pld-linux.org Git - packages/php-symfony.git/blob - symfony1.4_php56.patch
- rel 2; make it work with php56, too (by pepe@agnat)
[packages/php-symfony.git] / symfony1.4_php56.patch
1 diff -Naurp symfony/lib/command/sfCommandManager.class.php symfony_php56/lib/command/sfCommandManager.class.php
2 --- symfony/lib/command/sfCommandManager.class.php      2009-09-11 14:06:21.000000000 +0200
3 +++ symfony_php56/lib/command/sfCommandManager.class.php        2015-11-22 12:30:53.082672339 +0100
4 @@ -108,7 +108,9 @@ class sfCommandManager
5      else if (!is_array($arguments))
6      {
7        // hack to split arguments with spaces : --test="with some spaces"
8 -      $arguments = preg_replace('/(\'|")(.+?)\\1/e', "str_replace(' ', '=PLACEHOLDER=', '\\2')", $arguments);
9 +      $arguments = preg_replace_callback('/(\'|")(.+?)\\1/', function($matches) {
10 +        return str_replace(' ', '=PLACEHOLDER=', $matches[2]);
11 +      }, $arguments);
12        $arguments = preg_split('/\s+/', $arguments);
13        $arguments = str_replace('=PLACEHOLDER=', ' ', $arguments);
14      }
15 diff -Naurp symfony/lib/form/addon/sfFormObject.class.php symfony_php56/lib/form/addon/sfFormObject.class.php
16 --- symfony/lib/form/addon/sfFormObject.class.php       2011-12-12 17:02:15.000000000 +0100
17 +++ symfony_php56/lib/form/addon/sfFormObject.class.php 2015-11-22 12:31:53.969940421 +0100
18 @@ -278,6 +278,6 @@ abstract class sfFormObject extends Base
19  
20    protected function camelize($text)
21    {
22 -    return preg_replace(array('#/(.?)#e', '/(^|_|-)+(.)/e'), array("'::'.strtoupper('\\1')", "strtoupper('\\2')"), $text);
23 +    return sfToolkit::camelize($text);
24    }
25  }
26 diff -Naurp symfony/lib/plugins/sfDoctrinePlugin/lib/form/sfFormFilterDoctrine.class.php symfony_php56/lib/plugins/sfDoctrinePlugin/lib/form/sfFormFilterDoctrine.class.php
27 --- symfony/lib/plugins/sfDoctrinePlugin/lib/form/sfFormFilterDoctrine.class.php        2011-10-24 09:57:16.000000000 +0200
28 +++ symfony_php56/lib/plugins/sfDoctrinePlugin/lib/form/sfFormFilterDoctrine.class.php  2015-11-22 12:32:59.483942091 +0100
29 @@ -323,7 +323,7 @@ abstract class sfFormFilterDoctrine exte
30  
31    protected function camelize($text)
32    {
33 -    return sfToolkit::pregtr($text, array('#/(.?)#e' => "'::'.strtoupper('\\1')", '/(^|_|-)+(.)/e' => "strtoupper('\\2')"));
34 +    return sfToolkit::camelize($text);
35    }
36  
37    protected function getTable()
38 diff -Naurp symfony/lib/plugins/sfPropelPlugin/lib/vendor/phing/system/io/FileSystem.php symfony_php56/lib/plugins/sfPropelPlugin/lib/vendor/phing/system/io/FileSystem.php
39 --- symfony/lib/plugins/sfPropelPlugin/lib/vendor/phing/system/io/FileSystem.php        2008-03-08 11:07:53.000000000 +0100
40 +++ symfony_php56/lib/plugins/sfPropelPlugin/lib/vendor/phing/system/io/FileSystem.php  2015-11-22 12:28:32.954707609 +0100
41 @@ -150,7 +150,7 @@ abstract class FileSystem {
42       * by the given abstract pathname, or zero if it does not exist or some
43       * other I/O error occurs.
44       */
45 -    function getBooleanAttributes($f) {
46 +    function getBooleanAttributes(&$f) {
47          throw new Exception("SYSTEM ERROR method getBooleanAttributes() not implemented by fs driver");
48      }
49  
50 diff -Naurp symfony/lib/plugins/sfPropelPlugin/lib/vendor/propel-generator/classes/propel/engine/platform/MysqlPlatform.php symfony_php56/lib/plugins/sfPropelPlugin/lib/vendor/propel-generator/classes/propel/engine/platform/MysqlPlatform.php
51 --- symfony/lib/plugins/sfPropelPlugin/lib/vendor/propel-generator/classes/propel/engine/platform/MysqlPlatform.php     2009-10-26 21:54:39.000000000 +0100
52 +++ symfony_php56/lib/plugins/sfPropelPlugin/lib/vendor/propel-generator/classes/propel/engine/platform/MysqlPlatform.php       2015-11-24 12:21:49.150937486 +0100
53 @@ -95,7 +95,7 @@ class MysqlPlatform extends DefaultPlatf
54         public function disconnectedEscapeText($text)
55         {
56                 if (function_exists('mysql_escape_string')) {
57 -                       return mysql_escape_string($text);
58 +                       return @mysql_escape_string($text);
59                 } else {
60                         return addslashes($text);
61                 }
62 diff -Naurp symfony/lib/plugins/sfPropelPlugin/lib/vendor/propel-generator/classes/propel/phing/AbstractPropelDataModelTask.php symfony_php56/lib/plugins/sfPropelPlugin/lib/vendor/propel-generator/classes/propel/phing/AbstractPropelDataModelTask.php
63 --- symfony/lib/plugins/sfPropelPlugin/lib/vendor/propel-generator/classes/propel/phing/AbstractPropelDataModelTask.php 2010-04-16 22:56:45.000000000 +0200
64 +++ symfony_php56/lib/plugins/sfPropelPlugin/lib/vendor/propel-generator/classes/propel/phing/AbstractPropelDataModelTask.php   2015-11-22 12:28:32.954707609 +0100
65 @@ -438,8 +438,10 @@ abstract class AbstractPropelDataModelTa
66                                                 $this->includeExternalSchemas($dom, $srcDir);
67                                                 // normalize the document using normalizer stylesheet
68  
69 +                                               $xslDom = new DomDocument();
70 +                                               $xslDom->load($this->xslFile->getAbsolutePath());
71                                                 $xsl = new XsltProcessor();
72 -                                               $xsl->importStyleSheet(DomDocument::load($this->xslFile->getAbsolutePath()));
73 +                                               $xsl->importStyleSheet($xslDom);
74                                                 $transformed = $xsl->transformToDoc($dom);
75                                                 $newXmlFilename = substr($xmlFile->getName(), 0, strrpos($xmlFile->getName(), '.')) . '-transformed.xml';
76  
77 diff -Naurp symfony/lib/response/sfWebResponse.class.php symfony_php56/lib/response/sfWebResponse.class.php
78 --- symfony/lib/response/sfWebResponse.class.php        2010-11-15 17:48:22.000000000 +0100
79 +++ symfony_php56/lib/response/sfWebResponse.class.php  2015-11-22 12:35:47.569073451 +0100
80 @@ -406,7 +406,10 @@ class sfWebResponse extends sfResponse
81     */
82    protected function normalizeHeaderName($name)
83    {
84 -    return preg_replace('/\-(.)/e', "'-'.strtoupper('\\1')", strtr(ucfirst(strtolower($name)), '_', '-'));
85 +    return preg_replace_callback('/\-(.)/', function ($matches) { 
86 +         return '-'.strtoupper($matches[1]); 
87 +       }, strtr(ucfirst(strtolower($name)), '_', '-')
88 +    );
89    }
90  
91    /**
92 diff -Naurp symfony/lib/util/sfInflector.class.php symfony_php56/lib/util/sfInflector.class.php
93 --- symfony/lib/util/sfInflector.class.php      2009-11-12 12:07:44.000000000 +0100
94 +++ symfony_php56/lib/util/sfInflector.class.php        2015-11-22 12:37:57.093857056 +0100
95 @@ -27,11 +27,7 @@ class sfInflector
96     */
97    public static function camelize($lower_case_and_underscored_word)
98    {
99 -    $tmp = $lower_case_and_underscored_word;
100 -    $tmp = sfToolkit::pregtr($tmp, array('#/(.?)#e'    => "'::'.strtoupper('\\1')",
101 -                                         '/(^|_|-)+(.)/e' => "strtoupper('\\2')"));
102 -
103 -    return $tmp;
104 +    return sfToolkit::camelize($lower_case_and_underscored_word);
105    }
106  
107    /**
108 diff -Naurp symfony/lib/util/sfToolkit.class.php symfony_php56/lib/util/sfToolkit.class.php
109 --- symfony/lib/util/sfToolkit.class.php        2010-05-19 15:01:43.000000000 +0200
110 +++ symfony_php56/lib/util/sfToolkit.class.php  2015-11-22 12:40:22.655537197 +0100
111 @@ -608,4 +608,17 @@ class sfToolkit
112  
113      return set_include_path(join(PATH_SEPARATOR, $paths));
114    }
115 +
116 +  public static function camelize($text)
117 +  {
118 +    if (preg_match('#/(.?)#', $text, $matches))
119 +    {
120 +      $text = str_replace($matches[0], '::'.strtoupper($matches[1]), $text);
121 +    }
122 +    if (preg_match('/(^|_|-)+(.)/', $text, $matches))
123 +    {
124 +      $text = str_replace($matches[0], strtoupper($matches[2]), $text);
125 +    }
126 +    return $text;
127 +  }
128  }
This page took 0.081582 seconds and 3 git commands to generate.