How to load a 3rd party library -> scope problems?? |
[eluser]andjules[/eluser]
I'm having problems with the PHP library for the scribd api (follow the client libraries link). When I run commands against the library OUTSIDE of CI, it performs fine. When I try to incorporate it inside CI and call it from a controller, I get undefined variable and undefined index PHP errors (it's definitely finding the library, instantiating the class, etc. as the errors are dealing with the XML response from Scribd). I'm not sure how the scope changes inside CI, so I was wondering if anyone might be able to explain that to my not-so-smart brain ;-) [Interestingly, I was able to include some other Zend Framework libraries with no problems, using the 'lazy' method (create a helper that simply defines the base path, load the helper, then do a require once of the file)] my controller code looks something like: Code: function scribd() { the part of the Scribd library that deals with the response looks like this (note the author's comment... something's not quite right): Code: if($result['stat'] == "ok"){ and the convert_simplexml_to_array function from the Scribd library (the PHP errors trace to the "if($arr[$k]){" line): Code: public static function convert_simplexml_to_array($sxml) { |
Messages In This Thread |
How to load a 3rd party library -> scope problems?? - by El Forum - 04-22-2008, 10:01 AM
How to load a 3rd party library -> scope problems?? - by El Forum - 04-22-2008, 08:48 PM
How to load a 3rd party library -> scope problems?? - by El Forum - 04-22-2008, 10:41 PM
|