3

Doctrine ORM 似乎需要 PHP5.3 和下一个。

没有关于我想使用的 Doctrine DBAL 的信息。我认为 ORM 是基于 DBAL 的,所以它应该是 PHP5.3+,但是是否有任何故障可以使它与上一个 PHP 版本(5.6)一起工作。

4

1 回答 1

2

你有两个选择:

  1. 使用 Doctrine ORM 2.5 代码库(目前是 master 分支,还不稳定)。

  2. 将此补丁应用于 ClassMetadataInfo 类:

--- ClassMetadataInfo.php 2014-07-07 08:46:51.658104373 -0400 +++ ClassMetadataInfo.patch.php 2014-07-07 08:38:05.442127032 -0400 @@ -827,7 +827,7 @@ public function newInstance() { if ($this->_prototype === null) { - if (PHP_VERSION_ID === 50429 || PHP_VERSION_ID === 50513) { + if (PHP_VERSION_ID === 50429 || PHP_VERSION_ID === 50513 || PHP_VERSION_ID === 50600) { $this->_prototype = $this->reflClass->newInstanceWithoutConstructor(); } else { $this->_prototype = unserialize(sprintf('O:%d:"%s":0:{}', strlen($this->name), $this->name));

来源:http ://www.snip2code.com/Snippet/87237/Doctrine--2-3-6-on-PHP----5-6-%28vendor-do/

于 2014-11-19T18:18:11.183 回答