运行CakePHP shell时发出preg_replace_callback()警告


preg_replace_callback() warning when running a CakePHP shell

我正在运行:Apache 2PHP 5.3.3CentOS

当我检查pcre时,我看到:

pcretest-C

PCRE version 6.6 06-Feb-2006
Compiled with
  UTF-8 support
  Unicode properties support
  Newline character is LF
  Internal link size = 2
  POSIX malloc threshold = 10
  Default match limit = 10000000
  Default recursion depth limit = 10000000
  Match recursion uses stack

然而,当尝试运行shell时,我会得到以下结果:

Warning: preg_replace_callback(): Compilation failed: unrecognized character after (?< at offset 4 in /var/CakePHP/cakephp_2.0.5/lib/Cake/Console/ConsoleOutput.php on line 186

我已经阅读了所有关于PHP版本的通知,确保pcre是最新的,并确保pcre在cakepp错误列表中支持unicode。有什么想法可以解决这个问题,这样我就可以在CakePHP 2.0.5中运行控制台命令了吗?

更新:

对不起,这是第185行的代码:

return preg_replace_callback(
   '/<(?<tag>[a-z0-9-_]+)>(?<text>.*?)<'/('1)>/ims', array($this, '_replaceTags'), $text
);

还要注意的是,这目前在其他地方有效(即在我的MacBook Pro上运行)

对此有一个简单的单行修复。查看差异:

https://github.com/cakephp/cakephp/pull/681/files

看起来需要升级到pcre。