Sigo na luta kkkkkk, estive lendo os fóruns, buscando soluções e consegui avançar um pouco. Mas ainda tenho um erro no meu código que agora é:
Fatal error: Uncaught Error: Undefined constant "doctrine" in C:\xampp\htdocs\PHP-Alura\I-Doctrine\vendor\doctrine\orm\bin\doctrine.php:28
Stack trace:
#0 C:\xampp\htdocs\PHP-Alura\I-Doctrine\vendor\doctrine\orm\bin\doctrine(4): include()
#1 C:\xampp\htdocs\PHP-Alura\I-Doctrine\vendor\bin\doctrine(120): include('C:\\xampp\\htdocs...')
#2 {main}
thrown in C:\xampp\htdocs\PHP-Alura\I-Doctrine\vendor\doctrine\orm\bin\doctrine.php on line 28
Seguem os includes que o erro referencia
#0 vendor\doctrine\orm\bin\doctrine
#!/usr/bin/env php
<?php
include __DIR__ . '/doctrine.php';
#2 vendor\doctrine\orm\bin\doctrine.php
<?php
use Symfony\Component\Console\Helper\HelperSet;
use Doctrine\ORM\Tools\Console\ConsoleRunner;
fwrite(
STDERR,
'[Warning] The use of this script is discouraged. See'
. ' https://www.doctrine-project.org/projects/doctrine-orm/en/current/reference/tools.html#doctrine-console'
. ' for instructions on bootstrapping the console runner.'
. PHP_EOL
);
echo PHP_EOL . PHP_EOL;
$autoloadFiles = [
__DIR__ . '/../vendor/autoload.php',
__DIR__ . '/../../../autoload.php'
];
foreach ($autoloadFiles as $autoloadFile) {
if (file_exists($autoloadFile)) {
require_once $autoloadFile;
break;
}
}
$directories = [getcwd(), doctrine . phpgetcwd() . 'config']; // Essa é a linha 28 que o erro referencia
$configFile = null;
foreach ($directories as $directory) {
$configFile = $directory . DIRECTORY_SEPARATOR . 'cli-config.php';
if (file_exists($configFile)) {
break;
}
}
if ( ! file_exists($configFile)) {
ConsoleRunner::printCliConfigTemplate();
exit(1);
}
if ( ! is_readable($configFile)) {
echo 'Configuration file [' . $configFile . '] does not have read permission.' . "\n";
exit(1);
}
$commands = [];
$helperSet = require $configFile;
if ( ! ($helperSet instanceof HelperSet)) {
foreach ($GLOBALS as $helperSetCandidate) {
if ($helperSetCandidate instanceof HelperSet) {
$helperSet = $helperSetCandidate;
break;
}
}
}
ConsoleRunner::run($helperSet, $commands);
#1 vendor\bin\doctrine
include __DIR__ . "/../doctrine/orm/bin/doctrine";