rcrowe / TwigBridge

Give the power of Twig to Laravel
MIT License
894 stars 168 forks source link

Laravel 5 SP support #165

Closed mikevrind closed 9 years ago

mikevrind commented 9 years ago

I know I know... L5 is still in development. But maybe it would be usefull to add a little fallback in the SP for L5 support just as @barryvdh did with his debugbar?

    /**
     * Register configuration files, with L5 fallback
     */
    protected function registerConfiguration()
    {
        // Is it possible to register the config?
        if (method_exists($this->app['config'], 'package')) {
            $this->app['config']->package('barryvdh/laravel-debugbar', __DIR__ . '/config');
        } else {
            // Load the config for now..
            $config = $this->app['files']->getRequire(__DIR__ .'/config/config.php');
            $this->app['config']->set('laravel-debugbar::config', $config);
        }
    }

The current SP isn't compatible with L5.

barryvdh commented 9 years ago

Hmm could be. But I'm not really super happy by having to add that to all packages.. Taylor said he was going to look at it soon.

RyanThompson commented 9 years ago

Is this how Laravel 5 is handling config namespaces now? I haven't had much luck in my investigations. Seems like a large step down from the addNamespace method.

RyanThompson commented 9 years ago

@barryvdh @rcrowe This is about as good as it gets. Loading onto the resolved config repository is entirely the developers responsibility now. My buddy confirmed it at a meetup with Taylor last night as well.

I would say merge 'er up and let's get this package updated! VCS's in composer make me itchy ^_^

barryvdh commented 9 years ago

Okay, I'll guess we'll continue on a 0.7x branch with L5 support only? Instead of fallbacks etc.

rcrowe commented 9 years ago

Sounds like a sensible decision

barryvdh commented 9 years ago

Started in #166 / 0.7 branch but the tests need a lot more work. Closing this in favor of the PR.

RyanThompson commented 9 years ago

I can dig it