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. |
|
(Beispiel Datei-Icons)
|
Auf das Icon klicken um den Quellcode anzuzeigen |
DataCollector.php
01 <?php
02
03 /*
04 * This file is part of the Symfony package.
05 *
06 * (c) Fabien Potencier <fabien@symfony.com>
07 *
08 * For the full copyright and license information, please view the LICENSE
09 * file that was distributed with this source code.
10 */
11
12 namespace Symfony\Component\HttpKernel\DataCollector;
13
14 /**
15 * DataCollector.
16 *
17 * Children of this class must store the collected data in the data property.
18 *
19 * @author Fabien Potencier <fabien@symfony.com>
20 */
21 abstract class DataCollector implements DataCollectorInterface, \Serializable
22 {
23 protected $data;
24
25 public function serialize()
26 {
27 return serialize($this->data);
28 }
29
30 public function unserialize($data)
31 {
32 $this->data = unserialize($data);
33 }
34
35 /**
36 * Converts a PHP variable to a string.
37 *
38 * @param mixed $var A PHP variable
39 *
40 * @return string The string representation of the variable
41 */
42 protected function varToString($var)
43 {
44 if (is_object($var)) {
45 return sprintf('Object(%s)', get_class($var));
46 }
47
48 if (is_array($var)) {
49 $a = array();
50 foreach ($var as $k => $v) {
51 $a[] = sprintf('%s => %s', $k, $this->varToString($v));
52 }
53
54 return sprintf("Array(%s)", implode(', ', $a));
55 }
56
57 if (is_resource($var)) {
58 return sprintf('Resource(%s#%d)', get_resource_type($var), $var);
59 }
60
61 if (null === $var) {
62 return 'null';
63 }
64
65 if (false === $var) {
66 return 'false';
67 }
68
69 if (true === $var) {
70 return 'true';
71 }
72
73 return (string) $var;
74 }
75 }
76