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 |
ConfigDataCollector.php
001 <?php
002
003 /*
004 * This file is part of the Symfony package.
005 *
006 * (c) Fabien Potencier <fabien@symfony.com>
007 *
008 * For the full copyright and license information, please view the LICENSE
009 * file that was distributed with this source code.
010 */
011
012 namespace Symfony\Component\HttpKernel\DataCollector;
013
014 use Symfony\Component\HttpKernel\KernelInterface;
015 use Symfony\Component\HttpKernel\Kernel;
016 use Symfony\Component\HttpFoundation\Request;
017 use Symfony\Component\HttpFoundation\Response;
018
019 /**
020 * ConfigDataCollector.
021 *
022 * @author Fabien Potencier <fabien@symfony.com>
023 */
024 class ConfigDataCollector extends DataCollector
025 {
026 private $kernel;
027 private $name;
028 private $version;
029
030 /**
031 * Constructor.
032 *
033 * @param string $name The name of the application using the web profiler
034 * @param string $version The version of the application using the web profiler
035 */
036 public function __construct($name = null, $version = null)
037 {
038 $this->name = $name;
039 $this->version = $version;
040 }
041
042 /**
043 * Sets the Kernel associated with this Request.
044 *
045 * @param KernelInterface $kernel A KernelInterface instance
046 */
047 public function setKernel(KernelInterface $kernel = null)
048 {
049 $this->kernel = $kernel;
050 }
051
052 /**
053 * {@inheritdoc}
054 */
055 public function collect(Request $request, Response $response, \Exception $exception = null)
056 {
057 $this->data = array(
058 'app_name' => $this->name,
059 'app_version' => $this->version,
060 'token' => $response->headers->get('X-Debug-Token'),
061 'symfony_version' => Kernel::VERSION,
062 'name' => isset($this->kernel) ? $this->kernel->getName() : 'n/a',
063 'env' => isset($this->kernel) ? $this->kernel->getEnvironment() : 'n/a',
064 'debug' => isset($this->kernel) ? $this->kernel->isDebug() : 'n/a',
065 'php_version' => PHP_VERSION,
066 'xdebug_enabled' => extension_loaded('xdebug'),
067 'eaccel_enabled' => extension_loaded('eaccelerator') && ini_get('eaccelerator.enable'),
068 'apc_enabled' => extension_loaded('apc') && ini_get('apc.enabled'),
069 'xcache_enabled' => extension_loaded('xcache') && ini_get('xcache.cacher'),
070 'wincache_enabled' => extension_loaded('wincache') && ini_get('wincache.ocenabled'),
071 'zend_opcache_enabled' => extension_loaded('Zend OPcache') && ini_get('opcache.enable'),
072 'bundles' => array(),
073 'sapi_name' => php_sapi_name(),
074 );
075
076 if (isset($this->kernel)) {
077 foreach ($this->kernel->getBundles() as $name => $bundle) {
078 $this->data['bundles'][$name] = $bundle->getPath();
079 }
080 }
081 }
082
083 public function getApplicationName()
084 {
085 return $this->data['app_name'];
086 }
087
088 public function getApplicationVersion()
089 {
090 return $this->data['app_version'];
091 }
092
093 /**
094 * Gets the token.
095 *
096 * @return string The token
097 */
098 public function getToken()
099 {
100 return $this->data['token'];
101 }
102
103 /**
104 * Gets the Symfony version.
105 *
106 * @return string The Symfony version
107 */
108 public function getSymfonyVersion()
109 {
110 return $this->data['symfony_version'];
111 }
112
113 /**
114 * Gets the PHP version.
115 *
116 * @return string The PHP version
117 */
118 public function getPhpVersion()
119 {
120 return $this->data['php_version'];
121 }
122
123 /**
124 * Gets the application name.
125 *
126 * @return string The application name
127 */
128 public function getAppName()
129 {
130 return $this->data['name'];
131 }
132
133 /**
134 * Gets the environment.
135 *
136 * @return string The environment
137 */
138 public function getEnv()
139 {
140 return $this->data['env'];
141 }
142
143 /**
144 * Returns true if the debug is enabled.
145 *
146 * @return bool true if debug is enabled, false otherwise
147 */
148 public function isDebug()
149 {
150 return $this->data['debug'];
151 }
152
153 /**
154 * Returns true if the XDebug is enabled.
155 *
156 * @return bool true if XDebug is enabled, false otherwise
157 */
158 public function hasXDebug()
159 {
160 return $this->data['xdebug_enabled'];
161 }
162
163 /**
164 * Returns true if EAccelerator is enabled.
165 *
166 * @return bool true if EAccelerator is enabled, false otherwise
167 */
168 public function hasEAccelerator()
169 {
170 return $this->data['eaccel_enabled'];
171 }
172
173 /**
174 * Returns true if APC is enabled.
175 *
176 * @return bool true if APC is enabled, false otherwise
177 */
178 public function hasApc()
179 {
180 return $this->data['apc_enabled'];
181 }
182
183 /**
184 * Returns true if Zend OPcache is enabled
185 *
186 * @return bool true if Zend OPcache is enabled, false otherwise
187 */
188 public function hasZendOpcache()
189 {
190 return $this->data['zend_opcache_enabled'];
191 }
192
193 /**
194 * Returns true if XCache is enabled.
195 *
196 * @return bool true if XCache is enabled, false otherwise
197 */
198 public function hasXCache()
199 {
200 return $this->data['xcache_enabled'];
201 }
202
203 /**
204 * Returns true if WinCache is enabled.
205 *
206 * @return bool true if WinCache is enabled, false otherwise
207 */
208 public function hasWinCache()
209 {
210 return $this->data['wincache_enabled'];
211 }
212
213 /**
214 * Returns true if any accelerator is enabled.
215 *
216 * @return bool true if any accelerator is enabled, false otherwise
217 */
218 public function hasAccelerator()
219 {
220 return $this->hasApc() || $this->hasZendOpcache() || $this->hasEAccelerator() || $this->hasXCache() || $this->hasWinCache();
221 }
222
223 public function getBundles()
224 {
225 return $this->data['bundles'];
226 }
227
228 /**
229 * Gets the PHP SAPI name.
230 *
231 * @return string The environment
232 */
233 public function getSapiName()
234 {
235 return $this->data['sapi_name'];
236 }
237
238 /**
239 * {@inheritdoc}
240 */
241 public function getName()
242 {
243 return 'config';
244 }
245 }
246