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

[STICKY / IMPROVEMENT] Corrected relative paths #823

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

graulund
Copy link

I'm using Huge as a part of a larger setup, and in my setup, these relative path includes did not work for me — they're relative to the including file, not the included file. I fixed the file paths to be relative to the included file, and thus work no matter what the setup.

@panique
Copy link
Owner

panique commented Sep 19, 2016

Sorry but this breaks the project :/

Currently there's an auto-installer etc. that will setup everything it will run fine. So I think you are running an own config / apache/nginx setup somehow ? Can you please go into detail what's different in your setup compared to the one from autoinstaller ? Thanks! :)

@graulund
Copy link
Author

Oh — Can you elaborate on how exactly it breaks the project? I'll try to fix that.

The point of the commit is that PHP resolves relative paths relative to the entry file, even within included files, which is why you in your include paths have to write ../application/config/ in a file that's in the application/core folder, which doesn't make sense, because there's no application/application/config folder.

It works because the entry point in your demo project is in the public folder, whereas in my own setup, I have the entry point in the root folder, and then it doesn't work because of some hard coded string deep in the project, which is a little bit unfortunate. It prevents flexibility in the project setup.

I'm not trying to undo your settings, I'm only trying to make it more flexible, so the entry point can be anywhere. Using the __DIR__ magic constant makes it work because it's always the value of the directory of the included file, not the entry file. :)

@panique
Copy link
Owner

panique commented Sep 19, 2016

He @graulund , thats the thing, in HUGE the entry point in always the index.php inside /public folder, which is the recommended way in web applications, so everything that should not be public is really not public. If I understand you correctly, then you've changed that behaviour and moved the index.php, which is a deep change, so please don't get me wrong here, but changing something such essential in your personal installation does not really "justify" a total change of the projects logic! The current logic makes PSR4 possible, makes it work on nginx/apache without lots of configs and it works perfectly even when inside a subfolder, and there have been thousands of installations that run fine, also this project has reached end of life a year ago (so no code changes anymore), in the end I would totally recommend to leave the project like it is, as my experience is that deeper logic changes will make problems when not tested properly. I totally think that your solution is actually the better one, but touching this end-of-life project again for such a change ... hmm, might be too risky compared to the actual result.

Thanks for the commit, I think it would be cool to simply leave this ticket always open so people might find this solution for their own projects!

@panique panique changed the title Corrected relative paths [STICKY / IMPROVEMENT] Corrected relative paths Sep 19, 2016
@graulund
Copy link
Author

Alright, that's a totally fair decision. As long as you know that this code would totally work fine with the default case (index.php in the public folder). It wouldn't break anything.

@panique
Copy link
Owner

panique commented Apr 15, 2017

TODO

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.

None yet

2 participants