LOL @ self
After writing the previous, I got to thinking: Ahmad has probably done this a zillion times and wouldn't steer us wrong. So... what else might have changed (ie, what did "I" do wrong?)
After browsing lib.php, I discovered it is what loads hooks/__global.php
Guess who has several things added in __global.php? Yeah, me. So I went to investigate there (even though all my __global.php stuff has been working flawlessly... until i started doing ajax stuff.)
Lessons for everyone:
1. If you're doing a lot with hooks... It's probably not AppGini that's the problem.
2. If you're using __global.php, don't use paths with a literal "hooks/..." in them.
From a normal AG page, the runtime directory will be the AG appdir, so hook files will be in "hooks/..." - relative to appdir.
From a custom page, such as a ajax provider, the runtime directory will be the directory where the script is found. In this case, hooks. In effect, appdir/hooks becomes the new appdir.
So, if you have, in __global.php, the line:
then in a normal AG page it will load. The file path is:
Life is good.
On the other hand, if you're calling a custom/ajax page in hooks, you're using the URL:
Code: Select all
http://domain.com/hooks/myfile.php
The runtime directory will not be appdir, but rather appdir/hooks (or some other path, if not putting custom pages in hooks.) So in __global.php your include path is expanded to become:
Which doesn't exist, and... crash!
SOLUTION
Code: Select all
include(dirname(__FILE__).'/myfile.php');