contao / manager-bundle

[READ-ONLY] Contao Manager Bundle
GNU Lesser General Public License v3.0
17 stars 10 forks source link

kernel.projectDir must be set when initializing the kernel #29

Closed aschempp closed 7 years ago

aschempp commented 7 years ago

fixes #28

ausi commented 7 years ago

Couldn’t we just use dirname(dirname(dirname(dirname(dirname(__DIR__))))) in getProjectDir() and not inject the path? Symfony itself also doesn’t inject the project dir but searches for the nearest composer.json file.

aschempp commented 7 years ago

What if classes are combined for caching etc?

ausi commented 7 years ago

I think since PHP 7 there is no need for caching PHP files by combining them. But even then, the caching script should handle the __DIR__ constants correctly.

aschempp commented 7 years ago

I have fixed the remaining uses of ContaoKernel::setProjectDir. Regarding BC break, afaik the constructor is not a BC promise.

Toflar commented 7 years ago

Regarding BC break, afaik the constructor is not a BC promise.

Of course it is. You can only add arguments that are optional.

leofeyer commented 7 years ago

I have updated the PR so it is backwards compatible. Please review again.