Edit. I just noticed that subject line get's truncated. The title should have been: How can PhpED debugger be used to debug script which uses
Doctrine
PhpED is configured where the root directory is /var/www/testapp, and within this directory, I have the typical public and src directory as well directory /var/www/testapp/var/doctrine/proxy which contains proxy files created by Doctrine. Within my application, I have the following method.
<?php
namespace Michael\Testapp\Api\Point;
class PointService
{
public function index(array $params=[]):array {
syslog(LOG_INFO, 'Before $account=$this->account');
$account=$this->account;
syslog(LOG_INFO, 'Before $points=$account->getPoints()');
$points=$account->getPoints();
syslog(LOG_INFO, 'Before $points->getValues()');
$pointValues=$points->getValues();
syslog(LOG_INFO, 'After $points->getValues()');
return $pointValues;
}
} |
When I run index.php which eventually calls this method from either Apache or using PhpED's Run, I get the below results.
Mar 13 16:39:53 Devserver PublicAPI[59900]: Before $account=$this->account
Mar 13 16:39:53 Devserver PublicAPI[59900]: Before $points=$account->getPoints()
Mar 13 16:39:53 Devserver PublicAPI[59900]: Before $points->getValues()
Mar 13 16:39:53 Devserver PublicAPI[59900]: After $points->getValues() |
But if I run the same index.php using PhpED's debugger, I witness:
Mar 13 16:46:50 Devserver PublicAPI[59900]: Before $account=$this->account
Mar 13 16:46:54 Devserver PublicAPI[59900]: Before $points=$account->getPoints() |
PhpED's local window shows $this->account as being: object(Proxy\__CG__\Michael\Testapp\Domain\Entity\Account\Account) and a partial copy is below. From this point on, all code is Doctrine and not mine. I am able to trace the code all the way to when it calls \Doctrine\ORM\Proxy\ProxyFactory::createInitializer() and it ends without errors.
<?php
namespace Proxy\__CG__\Michael\Testapp\Domain\Entity\Account;
/**
* DO NOT EDIT THIS FILE - IT WAS CREATED BY DOCTRINE'S PROXY GENERATOR
*/
class Account extends \Michael\Testapp\Domain\Entity\Account\Account implements \Doctrine\ORM\Proxy\Proxy
{
public function getPoints()
{
$this->__initializer__ && $this->__initializer__->__invoke($this, 'getPoints', []);
return parent::getPoints();
}
}
|
How can PhpED debugger be used to debug script which uses Doctrine?