I'm building a new module. I wanted to reuse some code that I picked up within my module. THe code is built with two class instances. But, if I try and use a "require_once()" statement to include them, when I execute a member function in the class, I get:
Fatal error: Call to a member function on a non-object in
/drupal/modules/cloak/antispam/anti-spam.class.php on line 74
If I copy the classes into my .module file, and then instantiate and call them, I get an error, very similar, like:
Fatal error: Call to a member function on a non-object in
/drupal/modules/cloak/cloak.module on line 521
In both cases, the "offending" code is:
$crypt->HTML_Crypt($this->antispamemail, 1);
The HTML_Crypt class is included and works. If I call all of this outside of drupal from a separate PHP code file, it all works fine.
Are there any issues I'm running into with calling Class functions, etc. from within Drupal? If so, is there some way around this so I can utilize these classes?
TIA.