[英]SonataAdmin memory on random files
我已经配置了SonataAdmin捆绑包,但是当我打算加载admin / dashboard时,出现了随机内存问题,
这是我的2个包含Sonata CRUD的实体:
namespace Jade\ReveBundle\Admin;
use Doctrine\Common\Collections\Collection;
use Jade\ReveBundle\Entity\Thematique;
use Sonata\AdminBundle\Admin\Admin;
use Sonata\AdminBundle\Datagrid\ListMapper;
use Sonata\AdminBundle\Datagrid\DatagridMapper;
use Sonata\AdminBundle\Validator\ErrorElement;
use Sonata\AdminBundle\Form\FormMapper;
class ProduitAdmin extends Admin
{
protected function configureFormFields(FormMapper $formMapper)
{
$formMapper
->add('titre')
->add('description')
;
}
protected function configureDatagridFilters(DatagridMapper $datagridMapper)
{
$datagridMapper
->add('titre')
->add('description')
;
}
protected function configureListFields(ListMapper $listMapper)
{
$listMapper
->addIdentifier('id')
->add('titre')
->add('description')
;
}
public function validate(ErrorElement $errorElement, $object)
{
$errorElement
->with('titre')
->assertMaxLength(array('limit' => 32))
->end()
;
}
}
namespace Jade\ReveBundle\Admin;
use Sonata\AdminBundle\Admin\Admin;
use Sonata\AdminBundle\Datagrid\ListMapper;
use Sonata\AdminBundle\Datagrid\DatagridMapper;
use Sonata\AdminBundle\Validator\ErrorElement;
use Sonata\AdminBundle\Form\FormMapper;
class ThematiqueAdmin extends Admin
{
protected function configureFormFields(FormMapper $formMapper)
{
$formMapper
->add('titre')
->add('description')
;
}
protected function configureDatagridFilters(DatagridMapper $datagridMapper)
{
$datagridMapper
->add('titre')
->add('description')
;
}
protected function configureListFields(ListMapper $listMapper)
{
$listMapper
->addIdentifier('id')
->add('titre')
->add('description')
;
}
public function validate(ErrorElement $errorElement, $object)
{
$errorElement
->with('titre')
->assertMaxLength(array('limit' => 32))
->end()
;
}
}
有人知道这个问题吗? 谢谢你的回答
如果错误是“ PHP致命错误:允许的xxxx字节内存大小用尽... ”,则尝试增加PHP内存限制。 奏鸣曲使用的是教义ORM,实体可能会占用大量内存。 在dev模式下,许多信息也存储在事件探查器的内存中。
文件web / app_dev.php和web / app.php:
<?php
ini_set('memory_limit','128M'); //or some other reasonable value
...
或在php.ini中:
memory_limit = 128M
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.