Вход Регистрация
Файл: vendor/laravel/framework/src/Illuminate/Foundation/Exceptions/Whoops/WhoopsHandler.php
Строк: 80
<?php

namespace IlluminateFoundationExceptionsWhoops;

use 
IlluminateFilesystemFilesystem;
use 
IlluminateSupportArr;
use 
WhoopsHandlerPrettyPageHandler;

class 
WhoopsHandler
{
    
/**
     * Create a new Whoops handler for debug mode.
     *
     * @return WhoopsHandlerPrettyPageHandler
     */
    
public function forDebug()
    {
        return 
tap(new PrettyPageHandler, function ($handler) {
            
$handler->handleUnconditionally(true);

            
$this->registerApplicationPaths($handler)
                ->
registerBlacklist($handler)
                ->
registerEditor($handler);
        });
    }

    
/**
     * Register the application paths with the handler.
     *
     * @param  WhoopsHandlerPrettyPageHandler  $handler
     * @return $this
     */
    
protected function registerApplicationPaths($handler)
    {
        
$handler->setApplicationPaths(
            
array_flip($this->directoriesExceptVendor())
        );

        return 
$this;
    }

    
/**
     * Get the application paths except for the "vendor" directory.
     *
     * @return array
     */
    
protected function directoriesExceptVendor()
    {
        return 
Arr::except(
            
array_flip((new Filesystem)->directories(base_path())),
            [
base_path('vendor')]
        );
    }

    
/**
     * Register the blacklist with the handler.
     *
     * @param  WhoopsHandlerPrettyPageHandler  $handler
     * @return $this
     */
    
protected function registerBlacklist($handler)
    {
        foreach (
config('app.debug_blacklist'config('app.debug_hide', [])) as $key => $secrets) {
            foreach (
$secrets as $secret) {
                
$handler->blacklist($key$secret);
            }
        }

        return 
$this;
    }

    
/**
     * Register the editor with the handler.
     *
     * @param  WhoopsHandlerPrettyPageHandler  $handler
     * @return $this
     */
    
protected function registerEditor($handler)
    {
        if (
config('app.editor'false)) {
            
$handler->setEditor(config('app.editor'));
        }

        return 
$this;
    }
}
Онлайн: 0
Реклама