저는 wordpress-plugin에서 doctrine을 사용하고 있습니다. 그러나 명령 줄 도구가 올바르게 작동하지 않습니다. 모든 입력 또는 매개 변수를 무시한 것처럼 보이며 입력 한 내용에 상관없이 기본 도움말 텍스트를 계속 표시합니다.Doctrine 명령 줄에서 입력을 무시합니다.
PHP 버전은 7.0.7입니다.
(공급 업체/ORM/빈/설정에 앉아) 내 CLI-설정의 내용은 다음과 같습니다
<?php
use Doctrine\ORM\Tools\Console\ConsoleRunner;
require_once __DIR__ . '/../../../../../doctrine-bootstrap.php';
$spmm = new doctrineBootstrap();
$entityManager = $spmm->getEntityManager();
return ConsoleRunner::createHelperSet($entityManager);
?>
부트 스트 래퍼 자체의 내용 :
<?php
use Doctrine\ORM\Tools\Setup;
use Doctrine\ORM\EntityManager;
class doctrineBootstrap {
private $entityManager;
public function __construct() {
$this->initDoctrine();
}
private function initDoctrine() {
$paths = array("/model");
$isDevMode = false;
// the connection configuration
$dbParams = array(
'host' => 'XXXX',
'driver' => 'pdo_mysql',
'user' => 'XXXX',
'password' => 'XXXX',
'dbname' => 'XXXX',
);
$config = Setup::createAnnotationMetadataConfiguration($paths, $isDevMode);
$this->entityManager = EntityManager::create($dbParams, $config);
}
public function getEntityManager() {
return $this->entityManager;
}
}
명령 자체 콘솔에 오류를 출력하지 않지만 PHP 오류 로그에이 오류가 나타납니다.
[26-Aug-2016 11:17:26 Europe/Berlin] PHP Notice: Undefined index: argv in /html/wordpress/wp-content/plugins/wp-openimmo/vendor/symfony/console/Input/ArgvInput.php on line 55
[26-Aug-2016 11:17:26 Europe/Berlin] PHP Warning: array_shift() expects parameter 1 to be array, null given in /html/wordpress/wp-content/plugins/wp-openimmo/vendor/symfony/console/Input/ArgvInput.php on line 59
[26-Aug-2016 11:17:26 Europe/Berlin] PHP Warning: Invalid argument supplied for foreach() in /html/wordpress/wp-content/plugins/wp-openimmo/vendor/symfony/console/Input/ArgvInput.php on line 276
[26-Aug-2016 11:17:26 Europe/Berlin] PHP Warning: Invalid argument supplied for foreach() in /html/wordpress/wp-content/plugins/wp-openimmo/vendor/symfony/console/Input/ArgvInput.php on line 276
[26-Aug-2016 11:17:26 Europe/Berlin] PHP Warning: Invalid argument supplied for foreach() in /html/wordpress/wp-content/plugins/wp-openimmo/vendor/symfony/console/Input/ArgvInput.php on line 276
이것에 관한 문서가 이것에 대해 아주 명확하지 않기 때문에 나는 약간 혼란스러워합니다. 어떻게 작동 시키나요?