Skip to content

Conversation

@arrilot
Copy link
Contributor

@arrilot arrilot commented Mar 21, 2015

During package development I got into the situation where I wanted to determine the base application namespace (can be changed with app:name command) in a package service provider (equals "on every request")

The only way I've found is AppNamespaceDetectorTrait (correct me if I'm wrong pls)

However loading and parsing composer.json on every request is kinda slow.

That's why I propose to parse the kernel object instead.

microtime() shows it is ~10 times faster on fresh L5 install.

In my opinion it's cleaner too.

@taylorotwell taylorotwell merged commit 8f49e00 into laravel:master Mar 22, 2015
@arrilot arrilot deleted the patch-2 branch March 22, 2015 09:21
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

Successfully merging this pull request may close these issues.

2 participants