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 |
FileLoaderLoadException.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\Config\Exception;
13
14 /**
15 * Exception class for when a resource cannot be loaded or imported.
16 *
17 * @author Ryan Weaver <ryan@thatsquality.com>
18 */
19 class FileLoaderLoadException extends \Exception
20 {
21 /**
22 * @param string $resource The resource that could not be imported
23 * @param string $sourceResource The original resource importing the new resource
24 * @param int $code The error code
25 * @param \Exception $previous A previous exception
26 */
27 public function __construct($resource, $sourceResource = null, $code = null, $previous = null)
28 {
29 if (null === $sourceResource) {
30 $message = sprintf('Cannot load resource "%s".', $this->varToString($resource));
31 } else {
32 $message = sprintf('Cannot import resource "%s" from "%s".', $this->varToString($resource), $this->varToString($sourceResource));
33 }
34
35 // Is the resource located inside a bundle?
36 if ('@' === $resource[0]) {
37 $parts = explode(DIRECTORY_SEPARATOR, $resource);
38 $bundle = substr($parts[0], 1);
39 $message .= ' '.sprintf('Make sure the "%s" bundle is correctly registered and loaded in the application kernel class.', $bundle);
40 } elseif ($previous) {
41 // include the previous exception, to help the user see what might be the underlying cause
42 $message .= ' '.sprintf('(%s)', $previous->getMessage());
43 }
44
45 parent::__construct($message, $code, $previous);
46 }
47
48 protected function varToString($var)
49 {
50 if (is_object($var)) {
51 return sprintf('Object(%s)', get_class($var));
52 }
53
54 if (is_array($var)) {
55 $a = array();
56 foreach ($var as $k => $v) {
57 $a[] = sprintf('%s => %s', $k, $this->varToString($v));
58 }
59
60 return sprintf("Array(%s)", implode(', ', $a));
61 }
62
63 if (is_resource($var)) {
64 return sprintf('Resource(%s)', get_resource_type($var));
65 }
66
67 if (null === $var) {
68 return 'null';
69 }
70
71 if (false === $var) {
72 return 'false';
73 }
74
75 if (true === $var) {
76 return 'true';
77 }
78
79 return (string) $var;
80 }
81 }
82