3 namespace Drupal\Console\Command\Debug;
5 use Symfony\Component\Console\Input\InputInterface;
6 use Symfony\Component\Console\Output\OutputInterface;
7 use Drupal\Console\Core\Command\Command;
8 use Symfony\Component\Filesystem\Filesystem;
9 use Drupal\Console\Core\Utils\DrupalFinder;
14 * @package Drupal\Console\Command\Debug
16 class DotenvCommand extends Command
21 protected $drupalFinder;
24 * InitCommand constructor.
26 * @param DrupalFinder $drupalFinder
28 public function __construct(
29 DrupalFinder $drupalFinder
31 $this->drupalFinder = $drupalFinder;
32 parent::__construct();
35 protected function configure()
37 $this->setName('debug:dotenv')
38 ->setDescription('Debug Dotenv debug values.');
44 protected function execute(InputInterface $input, OutputInterface $output)
46 $fs = new Filesystem();
47 $envFile = $this->drupalFinder->getComposerRoot() . '/.env';
48 if (!$fs->exists($envFile)) {
49 $this->getIo()->warning('File '. $envFile . ' not found.');
54 $fileContent = file_get_contents($envFile);
55 $this->getIo()->writeln($fileContent);