Verzeichnisstruktur phpBB-3.1.0


Veröffentlicht
27.10.2014

So funktioniert es


Auf das letzte Element klicken. Dies geht jeweils ein Schritt zurück

Auf das Icon klicken, dies öffnet das Verzeichnis. Nochmal klicken schließt das Verzeichnis.
Auf den Verzeichnisnamen klicken, dies zeigt nur das Verzeichnis mit Inhalt an

(Beispiel Datei-Icons)

Auf das Icon klicken um den Quellcode anzuzeigen

console_migrator_output_handler.php

Zuletzt modifiziert: 09.10.2024, 12:55 - Dateigröße: 1.48 KiB


01  <?php
02  /**
03  *
04  * This file is part of the phpBB Forum Software package.
05  *
06  * @copyright (c) phpBB Limited <https://www.phpbb.com>
07  * @license GNU General Public License, version 2 (GPL-2.0)
08  *
09  * For full copyright and license information, please see
10  * the docs/CREDITS.txt file.
11  *
12  */
13   
14  namespace phpbb\console\command\db;
15   
16  use phpbb\user;
17  use phpbb\db\migrator_output_handler_interface;
18  use Symfony\Component\Console\Output\OutputInterface;
19   
20  class console_migrator_output_handler implements migrator_output_handler_interface
21  {
22      /**
23       * User object.
24       *
25       * @var user
26       */
27      private $user;
28   
29      /**
30       * Console output object.
31       *
32       * @var OutputInterface
33       */
34      private $output;
35   
36      /**
37       * Constructor
38       *
39       * @param user                $user    User object
40       * @param OutputInterface    $output    Console output object
41       */
42      public function __construct(user $user, OutputInterface $output)
43      {
44          $this->user = $user;
45          $this->output = $output;
46      }
47   
48      /**
49       * {@inheritdoc}
50       */
51      public function write($message, $verbosity)
52      {
53          if ($verbosity <= $this->output->getVerbosity())
54          {
55              $translated_message = call_user_func_array(array($this->user, 'lang'), $message);
56   
57              if ($verbosity === migrator_output_handler_interface::VERBOSITY_NORMAL)
58              {
59                  $translated_message = '<info>' . $translated_message . '</info>';
60              }
61              else if ($verbosity === migrator_output_handler_interface::VERBOSITY_VERBOSE)
62              {
63                  $translated_message = '<comment>' . $translated_message . '</comment>';
64              }
65   
66              $this->output->writeln($translated_message);
67          }
68      }
69  }
70