-
Incident report
-
Resolution: Fixed
-
Minor
-
1.9.9 (beta)
-
None
When attempting to use the Zabbix classes from another project, this is currently not possible because the includes are relative.
A possible workaround would be to chdir() to the zabbix root directory, but this is not a clean method.
There are several methods:
- Rewrite the require/includes using _DIR_ (or dirname(_FILE_) for backwards compatibility) - not nice, but it would work. Drawback is that one would need to change all the occurences in case of a chance
- Add a dedicated require/include method which automatically uses _DIR_ to find out the absolute path, something like this (untested):
function zbx_require_once ($file)
{ // Additional checks if the include really exists would need to go here // Also, the following line would need to be adjusted whereever the zbx_require_once function lives require_once(dirname(__FILE__) . $file); }I'm open for discussion for a possible bugfix, which I could eventually write.