2014-10-02 75 views
3

学说ORM似乎需要PHP5.3和下一个。Doctrine/DBAL是否与PHP5.6兼容?

没有关于Doctrine DBAL的信息我想使用。我认为ORM基于DBAL,所以它应该是PHP5.3 +,但有没有任何细分可以使它在最新的PHP版本(5.6)中起作用。

+1

这个类的元数据补丁似乎足以让现在运行它:HTTP://www.snip2code。 com/Snippet/87237/Doctrine - 2-3-6-on-PHP ---- 5-6-%28vendor-do/ – phoops 2014-11-19 18:13:07

+1

否则你需要使用2.5 ORM(主分支)。 – phoops 2014-11-19 18:13:24

回答

2

你有两个选择:

  1. 使用原则ORM 2.5的代码库(目前掌握的分支,还不稳定)。

  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/