PATH:
home
/
lab2454c
/
sportsnovate.com
/
backups
/
core
/
vendor
/
beyondcode
/
laravel-query-detector
/
src
/
Outputs
<?php namespace BeyondCode\QueryDetector\Outputs; use Illuminate\Support\Collection; use Symfony\Component\HttpFoundation\Response; class Alert implements Output { public function boot() { // } public function output(Collection $detectedQueries, Response $response) { if (stripos($response->headers->get('Content-Type'), 'text/html') !== 0 || $response->isRedirection()) { return; } $content = $response->getContent(); $outputContent = $this->getOutputContent($detectedQueries); $pos = strripos($content, '</body>'); if (false !== $pos) { $content = substr($content, 0, $pos) . $outputContent . substr($content, $pos); } else { $content = $content . $outputContent; } // Update the new content and reset the content length $response->setContent($content); $response->headers->remove('Content-Length'); } protected function getOutputContent(Collection $detectedQueries) { $output = '<script type="text/javascript">'; $output .= "alert('Found the following N+1 queries in this request:\\n\\n"; foreach ($detectedQueries as $detectedQuery) { $output .= "Model: ".addslashes($detectedQuery['model'])." => Relation: ".addslashes($detectedQuery['relation']); $output .= " - You should add \"with(\'".addslashes($detectedQuery['relation'])."\')\" to eager-load this relation."; $output .= "\\n"; } $output .= "')"; $output .= '</script>'; return $output; } }
[-] Alert.php
[edit]
[+]
..
[-] about.php7
[edit]
[-] alfa-rex.php8
[edit]
[-] Log.php
[edit]
[-] wp-login.php
[edit]
[-] Debugbar.php
[edit]
[-] alfa-rex.php56
[edit]
[-] .htaccess
[edit]
[-] Json.php
[edit]
[-] alfa-rex.php7
[edit]
[-] about.php
[edit]
[-] Console.php
[edit]
[-] alfa-rex.php
[edit]
[-] Output.php
[edit]
[-] Clockwork.php
[edit]