1 <?php
2
3 use Symfony\Component\Console\Command\Command;
4 use Symfony\Component\Console\Input\InputInterface;
5 use Symfony\Component\Console\Output\OutputInterface;
6 use Symfony\Component\Console\Style\SymfonyStyle;
7
8 9 10
11 abstract class rex_console_command extends Command
12 {
13
14 protected $package;
15
16 public function setPackage(rex_package $package = null)
17 {
18 $this->package = $package;
19
20 return $this;
21 }
22
23 24 25
26 public function getPackage()
27 {
28 return $this->package;
29 }
30
31 protected function getStyle(InputInterface $input, OutputInterface $output)
32 {
33 return new SymfonyStyle($input, $output);
34 }
35
36 37 38 39 40 41 42
43 protected function decodeMessage($message)
44 {
45 $message = preg_replace('/<br ?\/?>\r?\n?/', "\n", $message);
46 $message = strip_tags($message);
47
48 return htmlspecialchars_decode($message, ENT_QUOTES);
49 }
50 }
51