T
T
TANK_IST2017-08-07 00:22:08
symfony
TANK_IST, 2017-08-07 00:22:08

Why doesn't cli-config.php for doctrine work, but everything is ok on the site with the same configuration?

Can you tell me why when I update the schema from the console, I get this:

[Doctrine\Common\Annotations\AnnotationException]                                                                                                                    
  [Semantical Error] The annotation "@Symfony\Component\Validator\Constraints\Length" in property Model\CityModel::$name does not exist, or could not be auto-loaded.

cli-config.php:
<?php
require_once __DIR__."/conf/conf.php";
require_once __DIR__."/vendor/autoload.php";
$loader = new \Composer\Autoload\ClassLoader();
$loader->add('Symfony\Component\Validator\Constraints', APP_ROOT."/vendor/symfony/validator/Constraints");
$loader->register();
require_once __DIR__.'/conf/services.php';

return Doctrine\ORM\Tools\Console\ConsoleRunner::createHelperSet($entityManager);

It should work because it includes the same configs as the site itself, but I get an error.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question