php - 运行 CakePHP shell 时 preg_replace_callback() 警告

标签 php cakephp-2.0 cakephp-2.1

我正在运行: Apache 2 PHP 5.3.3 CentOS

当我检查 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 在 cakephp bug 列表上具有 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

关于php - 运行 CakePHP shell 时 preg_replace_callback() 警告,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9038608/

相关文章:

PHP - 仅包含 ASCII 扩展字符的字符串

php - 如何使用 php 将从下拉列表中选择的日期插入到 mySQL 表中?

.htaccess - 自适应图像 CakePHP htaccess

sql-server - cakephp 2.0.5 Sqlserver 需要数据库连接

php - 在 CakePhp 中,如何只从我的数据库中检索一列?

php - 使用 PHP + Apache 高速即时生成 ZIP 文件?

PHP日期问题

cakephp - CakePHP 中所有图像 url 的全局设置

cakephp-2.1 - CakePHP 在 app/tmp/sessions 只有几个用户创建数百个 session 文件是正常行为吗?