comparison vendor/symfony/http-kernel/Profiler/FileProfilerStorage.php @ 14:1fec387a4317

Update Drupal core to 8.5.2 via Composer
author Chris Cannam
date Mon, 23 Apr 2018 09:46:53 +0100
parents 4c8ae668cc8c
children 129ea1e6d783
comparison
equal deleted inserted replaced
13:5fb285c0d0e3 14:1fec387a4317
140 if (!is_dir($dir) && false === @mkdir($dir, 0777, true) && !is_dir($dir)) { 140 if (!is_dir($dir) && false === @mkdir($dir, 0777, true) && !is_dir($dir)) {
141 throw new \RuntimeException(sprintf('Unable to create the storage directory (%s).', $dir)); 141 throw new \RuntimeException(sprintf('Unable to create the storage directory (%s).', $dir));
142 } 142 }
143 } 143 }
144 144
145 $profileToken = $profile->getToken();
146 // when there are errors in sub-requests, the parent and/or children tokens
147 // may equal the profile token, resulting in infinite loops
148 $parentToken = $profile->getParentToken() !== $profileToken ? $profile->getParentToken() : null;
149 $childrenToken = array_filter(array_map(function ($p) use ($profileToken) {
150 return $profileToken !== $p->getToken() ? $p->getToken() : null;
151 }, $profile->getChildren()));
152
145 // Store profile 153 // Store profile
146 $data = array( 154 $data = array(
147 'token' => $profile->getToken(), 155 'token' => $profileToken,
148 'parent' => $profile->getParentToken(), 156 'parent' => $parentToken,
149 'children' => array_map(function ($p) { return $p->getToken(); }, $profile->getChildren()), 157 'children' => $childrenToken,
150 'data' => $profile->getCollectors(), 158 'data' => $profile->getCollectors(),
151 'ip' => $profile->getIp(), 159 'ip' => $profile->getIp(),
152 'method' => $profile->getMethod(), 160 'method' => $profile->getMethod(),
153 'url' => $profile->getUrl(), 161 'url' => $profile->getUrl(),
154 'time' => $profile->getTime(), 162 'time' => $profile->getTime(),