Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Anbu::disable() does not work #27

Open
gabarba opened this issue Oct 1, 2014 · 1 comment
Open

Anbu::disable() does not work #27

gabarba opened this issue Oct 1, 2014 · 1 comment

Comments

@gabarba
Copy link
Contributor

gabarba commented Oct 1, 2014

I had a need to disable the Anbu for a particular request while testing and I was presented with the following error

Undefined index: disable
…/­vendor/­daylerees/­anbu/­src/­Profiler.php:338

I figured it was an issue in the Facade class itself so I was able to fix it with the following.

<?php

namespace Anbu\Facades;

use App;

class Anbu
{
    /**
     * Proxy static method calls to module instances.
     *
     * @param  string $method
     * @param  mixed  $args
     * @return mixed
     */
    public static function __callStatic($method, $args)
    {
        // Resolve profiler from container.
        $profiler = App::make('Anbu\\Profiler');

       if($method == 'disable')
        {
           return $profiler->disable();
        }

        if($method == 'hide')
        {
           return $profiler->hide();
        }


        // Return the module instance by method name.
        return $profiler->getModule($method);
    }
}

Im sure that you may have a better solution to this issue than this one but I just wanted to give you a heads up.

@toonevdb
Copy link

I have the same issue.

    //Anbu::hide(); // does not work

    $anbu = App::make('Anbu\\Profiler');
    $anbu->hide();

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants