601f9d4d27085ea2e3020faefd45608f339e74e6
[yaffs-website] / vendor / drush / drush / src / Commands / generate / Helper / OutputHandler.php
1 <?php
2
3 namespace Drush\Commands\generate\Helper;
4
5 use DrupalCodeGenerator\Helper\OutputHandler as BaseOutputHandler;
6 use Symfony\Component\Console\Output\OutputInterface;
7 use Webmozart\PathUtil\Path;
8
9 /**
10  * Output printer form generators.
11  */
12 class OutputHandler extends BaseOutputHandler
13 {
14
15     /**
16      * {@inheritdoc}
17      */
18     public function printSummary(OutputInterface $output, array $dumped_files)
19     {
20         /** @var \DrupalCodeGenerator\Command\GeneratorInterface $command */
21         $command = $this->getHelperSet()->getCommand();
22         $directory = $command->getDirectory();
23
24         // Make the paths relative to Drupal root directory.
25         foreach ($dumped_files as &$file) {
26             $file = Path::join($directory, $file);
27         }
28
29         // @todo fix this.
30         if (false && defined('DRUPAL_ROOT') && $dumped_files) {
31             // @todo Below code is forking new process well but current process is not shutting down fully.
32             $exec = drush_get_editor();
33             $exec = str_replace('%s', drush_escapeshellarg(Path::makeAbsolute($dumped_files[0], DRUPAL_ROOT)), $exec);
34             $pipes = [];
35             proc_close(proc_open($exec . ' 2> ' . drush_bit_bucket() . ' &', [], $pipes));
36         }
37         parent::printSummary($output, $dumped_files);
38     }
39 }