[TASK] Re-work/simplify copyright header in PHP files - Part 2
[Packages/TYPO3.CMS.git] / typo3 / sysext / core / Classes / ExtDirect / ExtDirectDebug.php
1 <?php
2 namespace TYPO3\CMS\Core\ExtDirect;
3
4 /**
5 * This file is part of the TYPO3 CMS project.
6 *
7 * It is free software; you can redistribute it and/or modify it under
8 * the terms of the GNU General Public License, either version 2
9 * of the License, or any later version.
10 *
11 * For the full copyright and license information, please read the
12 * LICENSE.txt file that was distributed with this source code.
13 *
14 * The TYPO3 project - inspiring people to share!
15 */
16 /**
17 * Ext Direct Debug
18 *
19 * @author Stefan Galinski <stefan.galinski@gmail.com>
20 */
21 class ExtDirectDebug {
22
23 /**
24 * Internal debug message array
25 *
26 * @var array
27 */
28 protected $debugMessages = array();
29
30 /**
31 * destructor
32 *
33 * Currently empty, but automatically registered and called during
34 * ExtDirect shutdown.
35 *
36 * @see http://forge.typo3.org/issues/25278
37 */
38 public function __destruct() {
39
40 }
41
42 /**
43 * Adds a new message of any data type to the internal debug message array.
44 *
45 * @param mixed $message
46 * @return void
47 */
48 public function debug($message) {
49 $this->debugMessages[] = $message;
50 }
51
52 /**
53 * Returns the internal debug messages as a string.
54 *
55 * @return string
56 */
57 public function toString() {
58 $messagesAsString = '';
59 if (count($this->debugMessages)) {
60 $messagesAsString = \TYPO3\CMS\Core\Utility\DebugUtility::viewArray($this->debugMessages);
61 }
62 return $messagesAsString;
63 }
64
65 }