Skip to content
bugzbrown edited this page Mar 26, 2013 · 2 revisions

#Cloning the repo


Navigate


##Just a clean single time clone Clone this into your codeigniter app in the directory /application/libraries/facebook with the command:

git clone https://github.com/bugzbrown/codeigniter-facebook-lib.git facebook

This should create a directory facebook in your libraries.

##Adding it as a git submodule Git submodules are very handy for this kind of thing - It allows you to keep up to date with the lates versions of your favourite modules. There are some bewares, never the less, I tend to use this approach for my development. If your project is already using git, you can add the facebook library as a module. Go to the root of your code igniter app, type in the following:

git submodule add https://github.com/bugzbrown/codeigniter-facebook-lib.git application/libraries/facebook

You can, whenever ther is an update for this specific module, update it automatically by issuing the following git command:

git submodule update

#Configuring Best practices suggests that you create environment aware config files. These are all based off the "facebook.config.php" file located in the folder.

If you are using environemnt configs, copy this file to your development and production folders with as facebook.php

cp application/libraries/facebook/facebook.config.php application/config/development/facebook.php
cp application/libraries/facebook/facebook.config.php application/config/production/facebook.php

If you don't use env configs, just copy the file to your config folder:

cp application/libraries/facebook/facebook.config.php application/config/facebook.php

Edit the file according to your facebook app.

Have a look a what each of the things mean.

$config['fbAppId'] = 'APP_ID'; // <-- HERE GOES YOUR APP ID FROM FACEBOOK
$config['fbSecret'] = 'SECRET'; // <-- HERE YOU PLACE YOUR SECRET
$config['fbCanvas'] = 'https://apps.facebook.com/APP_ID/'; // <-- THIS IS THE FACEBOOK ADDRESS FOR YOUR APP
$config['fbScope'] = 'read_stream, email, friends_likes'; // <-- THE SCOPE
$config['fbDisplay'] = 'page'; // <-- You can replace for popup if you're handling things in a modal

You can load the library wherever you need it and it should just simply work.

Clone this wiki locally