Bebo and Codeignitor Error |
[eluser]damon311[/eluser]
All, I am new to CodeIgniter (I'm making the switch from Rails and Java) so this may be user error. I'm getting a "api key is invalid" error when running the code below. I've copied the Bebo PHP library (http://developer.bebo.com/downloads/exam...bs-php.php [renamed to Bebo.php]) to $home/system/application/libraries/Bebo.php. The library is being loaded properly but it complains about the API key (I copied and pasted both the api and secret key from Bebo). Any ideas? Thanks Code: class Test extends Controller {
[eluser]Seppo[/eluser]
are you really using an object to store the config? try echoing $apikey and $apisecret to check out if the valures are correctly passed.
[eluser]damon311[/eluser]
Thanks for your reply. I ran the code below and the apikey and apisecret are correctly displayed, but I'm still getting "api key is invalid" message. Code: class Test extends Controller {
[eluser]Seppo[/eluser]
Well... on this point I think you are having a problem with Bebo, and it has nothing to do with CI... Try aislating this issue: create a new empty file, load the library and try using it there... Alos make sure you have no white-space on your api key/api secret. I can't realize why else you can have this issue...
[eluser]damon311[/eluser]
I tried that last night and you are correct. To get things working, I realized that I needed to add Code: ini_set('arg_separator.output', '&'); Now this is a CodeIgniter question. I read the documentation on how to automatically pass parameters to the constructors of classes placed in the libraries directory. Again, I'm new and probably did something wrong. Essentially, do I have to initialize my Bebo class in every controller? This is what I'm doing now. Code: function Test() {
[eluser]Michael Wales[/eluser]
Quote:Essentially, do I have to initialize my Bebo class in every controller?Yes - within every controller you intend to use the Bebo API. If you are going to be using it a lot (as in everywhere) you could just make the class initialize itself. Look at any of the CI libraries for an example of how to do so.
[eluser]Seppo[/eluser]
To keep it simple I would rename bebo class (for example I call it bebo_app) and I create an own bebo class that extends the real bebo class (bebo_app) and I make it do the repetitive work... something like this Code: class Bebo extends Bebo_app |
Welcome Guest, Not a member yet? Register Sign In |