-
-
Notifications
You must be signed in to change notification settings - Fork 10
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
Relative paths are not correct #4
Comments
Hi, Ross! Thanks for the heads up, I'll take a closer look at this tonight. Relative paths are indeed just that, relative, so it might be something that requires a code change or just improved documentation. This project is actually an isolation of the relevant code for the GG-CMS, you can see the AmericanBritishSpellings***.php files located here for it: https://github.com/HoldOffHunger/GreenGluonCMS/tree/master/classes/Language . It's possible that you're not using a This is also where the demo runs for it, https://www.revoltlib.com/spellchecker.php . GG-CMS is designed to keep apache-hosted domain directories and code directories separate (standard security protocol). Thanks again, I'll know more when I look closer tonight. |
Thanks for your quick response, I appreciate you looking into this. Just a thought: Are you perhaps setting the include path from the webserver? The path in my case is relative to the file itself (AmericanBritishSpellings.php) so it's attempting to load the file using the following path: The code is stored in a directory specifically for 3rd-party libraries and is being required using an absolute path. Many thanks! |
Hey, again, Ross: I spent some time thinking about this. TLDR: Your idea of using The DR part: The project that I isolated this from, well, it's imperfect. I have the dir setup as so...
So, when a user hit the But your method is perfect when it comes to making this project 100%-working-out-of-the-box, especially given how our code samples have worked. I just pushed improvements to use Will give this ticket some time before closing it, if all is good. |
Hi, Thanks again for spending time on this. I'm still having trouble with the filepaths and I'm a bit confused what the differences are between our setups. Judging from the documentation, From the new commit it looks as if In my project I'm using Drupal so I created some test code to check the framework wasn't doing anything I wasn't aware of. I created the following file structure:
This is the contents of index.php:
Unfortunately I still couldn't get the code to work, I have created a fork and this commit fixes the problems I'm facing: As I said, I'm a bit confused and not sure what I'm doing differently. If the code is working fine then I'll happily continue to use the fork. Many thanks! |
Oh, I looked at your forked project. I suspect maybe you moved the code in '/classes/Language/*' to just the base directory '/', and that's why your Hrm, your code without those extra directories is a bit cleaner -- I'll probably fix up this project, too, later tonight, to have the same dir structuring. Also (NOTE TO SELF), I should probably add some installation instructions to README.MD once the above is all said and done. Thanks again for testing, nameless-ross. That's usually above and beyond the call of duty, so I appreciate it! |
Hi, again, Ross, Sorry for the delay, been busy, etc.. (have added 2,000 to 3,000 new words to the codebase per newest release) I've moved all of the code into the https://github.com/HoldOffHunger/convert-british-to-american-spellings/tree/master/lib New release notes: https://github.com/HoldOffHunger/convert-british-to-american-spellings/releases/tag/1.02 |
Hi there, Sorry about my late response! The new structure is an improvement however, I still have problems getting this to work out of the box. The issue for me are the paths specified on these lines: In order to fix the issue I have to change the paths to a path relative to the file itself and not the project structure. The above lines in my fork have been changed to:
Would you mind testing those realtive paths at your end? Many thanks, |
Ah, you are right, sorry about that. Lines have been updated:
$word_directory = DIR . '/Words/AmericanBritish/'; Thanks for being patient with this! |
Hi, Sorry, once last change needed and then I think we are there! It needs to be require_once() rather than require() on both of those lines. If the code is used more than once it attempts to redeclare those classes and I get the error: Many thanks! |
Hey hey, Ah, good point! Updates have been added, for both the requires in AmericanBritishSpellings.php and AmercianBritishSpellings_Words.php. Let me know if all is good. |
Hi, Updates work great, I've created a pull request with a couple of fixes for new bugs introduced. Many thanks, |
Perfect, I love features! Thanks for your patience and contributions! |
Hi,
I have tried out the tool but after requiring AmericanBritishSpellings.php in my code I'm getting fatal errors that AmericanBritishSpellings_Words.php failed to open.
On closer inspection it looks as if the relative paths are incorrect for AmericanBritishSpellings_Words.php and AmericanBritishWords_[LETTER].php.
Everything works fine if I replace the relative path
../classes/Language
with__DIR__
Many thanks in advance!
Ross
The text was updated successfully, but these errors were encountered: