guys, I am trying to use this new Facebook SDK for PHP to allow users to use their profiles on Facebook to login on my website
My website is using CodeIgniter, the PHP framework, but I couldn't make the FacebookSession class to load.
Am following this http://metah.ch/blog/2014/05/facebook-sdk-4-0-0-for-php-a-working-sample-to-get-started/ and this https://developers.facebook.com/docs/php/gettingstarted/4.0.0 tutorials
It keeps saying Fatal error: Class 'FacebookSession' not found and then I tried to move this code out of Code Igniter and yet I can't make it work
I started trying to use 'require_once' to import the class, but it also fails! This is all I have in one simple php file (2 lines):
require_once('src/Facebook/FacebookSession.php');
FacebookSession::setDefaultApplication('YOUR_APP_ID', 'YOUR_APP_SECRET');
It finds the file, presumably imports it (I put some 'echo' inside it and it prints the messages) but fails on the second line
I tried with the autoload.php that comes with the SDK, but it returns in the middle of the script in this condition:
// does the class use the namespace prefix?
$len = strlen($prefix);
if (strncmp($prefix, $class, $len) !== 0) {
// no, move to the next registered autoloader
return;
}
Why can't I import this file? It probably has something to do with namespaces, alias etc, right? So can you help me?