Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
#1 2006-09-06 13:49:16
- spudz
- Member
- Registered: 2005-12-09
- Posts: 28
Includes
Hi,
I’m creating a plugin and I’m having difficulty including a file. I was just wondering if there is anything in TXP that stops a plugin from including or requiring another file.
I’m including the nusoap library to use an API and I keep getting this error on two seperate installations, however it works on the third installation I have running.
The Error:
Fatal error: Class 'soapclient' not found in C:\Program Files\Apache Group\Apache2\htdocs\txp\textpattern\lib\txplib_misc.php(459) : eval()'d code on line 49
Any advice you can give is greatly appreciated.
Cheers,
Spudz
(Edit: updated thread subject to something more clear. -Mary)
Last edited by Mary (2007-01-02 15:28:49)
Offline
Re: Includes
Are you require()’ing the file? From the error code, it would seem that if you are indeed require()’ing the file, it’s not actually getting it. Maybe you’re using the wrong path?
Are your test installations on different server types (*nix as opposed to Windows)? I know that TXP has a constant defined for the directory separator (DS, I believe) that should be used if you are require()’ing an external file, to make sure that the path is correct. In any event, the code clearly isn’t finding the correct class.
You could remedy this (and make it an easier plugin to use by removing dependencies on other files) by just including the class at the bottom of the plugin, assuming that it’s in the license of the nusoap API that such use is allowed, which I would assume it would be.
Offline
#3 2006-09-06 16:44:01
- spudz
- Member
- Registered: 2005-12-09
- Posts: 28
Re: Includes
Yeah I am requiring the file, the path is correct aswell, I’m certain about that, but thats also why I’m so confused about it not working, the strange thing is I have another set up on my localhost and the plugin works fine on that. I’m not doing anything different on either setup. Its very strange.
Does Txp not allow some scripts to be accessed by other scripts if they are in the files directory. (ie if I had require('files/nusoap.php');, would Txp disallow access to it).
You could remedy this (and make it an easier plugin to use by removing dependencies on other files) by just including the class at the bottom of the plugin, assuming that it’s in the license of the nusoap API that such use is allowed, which I would assume it would be.
I would remove dependencies on other files but the nusoap library has over 6000 lines of code so its easier to include it outside of the plugin. I’ll look into the TXP constant for Directory Seperator and see what I can do, thanks for that, in the meantime if you think of any other reason this might be happening, dont hesitate to reply.
Cheers,
Spudz
Offline