CodeIgniter Forums
[SOLVED] problem including files in a library - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forum-20.html)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forum-23.html)
+--- Thread: [SOLVED] problem including files in a library (/thread-37669.html)



[SOLVED] problem including files in a library - El Forum - 01-17-2011

[eluser]mikegioia[/eluser]
hi guys -

i'm trying to set up the Dropbox PHP API in codeigniter and I'm running into issues with including the classes.

The structure is set up to be a folder called 'dropbox' in my libraries folder and a bunch of classes within them. all it says to include (which i do in the dropbox library file i made) this file called autoload.php.

Autoload.php just does this:

Code:
function Dropbox_autoload($className) {

    if(strpos($className,'Dropbox_')===0) {

        include dirname(__FILE__) . '/' . str_replace('_','/',substr($className,8)) . '.php';

    }

}

spl_autoload_register('Dropbox_autoload');


what does this do? when I try to load dropbox classes like in the examples i get Exceptions thrown saying classes not found: 'The OAuth class could not be found! Did you install and enable the oauth extension?' I've tried just including all of the class files directly in the constructor of the library I made.

Any help on this would be greatly appreciated!
Mike

***
Edit: Solved, this was an issue with not having oauth installed on the machine. Just for reference, if anyone has a similar problem please see here: http://djpate.com/2010/10/07/how-to-install-oauth-support-for-php-on-ubuntu/

and if anyone would like the dropbox library I'm setting up, please comment below and I can make it available.


[SOLVED] problem including files in a library - El Forum - 03-10-2011

[eluser]Unknown[/eluser]
I would like to see your dropbox library Smile


[SOLVED] problem including files in a library - El Forum - 07-15-2011

[eluser]Unknown[/eluser]
Can I see your library as well.

Thanks in advance!


[SOLVED] problem including files in a library - El Forum - 07-15-2011

[eluser]mikegioia[/eluser]
hey guys -

my fault for not posting this. i know how irritating it is to not get code from posts like these. I'm just gonna post my files to a public repo and you'll have to figure out what's going on until I get to documenting everything.

https://github.com/ParticleBits/CI_Dropbox

THIS IS UNTESTED. I put these files up as a base and ill be testing it in a CI install soon. i'll update this post when i do and maybe ill make another post too. its using 2.0.2 FYI but please email me with any issues you find.

feel free to PM me, post here or email me at mikegioia [at] gmail [dot] com if you have any questions or need anything else.

mike