3

Doctrine ORM seems to need PHP5.3 and next one's.

There is no information about Doctrine DBAL I want to use. I think the ORM is based on DBAL, so it should be PHP5.3+, but is there any breakdown to make it work with last PHP release (5.6).

Fractaliste
  • 5,777
  • 11
  • 42
  • 86
  • 1
    This class metadata patch seems enough for now to run it: http://www.snip2code.com/Snippet/87237/Doctrine--2-3-6-on-PHP----5-6-%28vendor-do/ – ek9 Nov 19 '14 at 18:13
  • 1
    Otherwise you need to use 2.5 ORM (master branch). – ek9 Nov 19 '14 at 18:13

1 Answers1

2

You have two options:

  1. Use Doctrine ORM 2.5 codebase (currently master branch, not yet stable).

  2. Apply this patch to ClassMetadataInfo class:

--- 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));

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

ek9
  • 3,392
  • 5
  • 23
  • 34