Skip to content
This repository has been archived by the owner on Jan 13, 2022. It is now read-only.

Added autoloader for those poor non-composer peeps #135

Merged

Conversation

SammyK
Copy link
Contributor

@SammyK SammyK commented Jun 27, 2014

Usage

If you don't have composer, you can still autoload the SDK like so:

require __DIR__ . '/path/to/facebook-php-sdk-v4/autoload.php';

It should detect the src/ folder automagically for you. If not you can define a constant with the path to the source files before the include.

define('FACEBOOK_SDK_V4_SRC_DIR', '/path/to/facebook-php-sdk-v4/src/Facebook/');
require __DIR__ . '/path/to/facebook-php-sdk-v4/autoload.php';

Also threw in a little PHP version check in there since that seems to be a recurring issue. People are getting syntax errors on < 5.4 and don't get a clear error message saying they need 5.4 or greater.

I didn't add this info the the README since the composer installation stuff wasn't there either, so maybe we could add it to the official documentation?

@gfosco
Copy link
Contributor

gfosco commented Jun 27, 2014

Awesome.. Thanks @SammyK. Will add to readme too.

gfosco pushed a commit that referenced this pull request Jun 27, 2014
Added autoloader for those poor non-composer peeps
@gfosco gfosco merged commit a20dc24 into facebookarchive:master Jun 27, 2014
@SammyK
Copy link
Contributor Author

SammyK commented Jun 27, 2014

Do you ever sleep? :)

@SammyK SammyK deleted the autoloader-for-non-composer-peeps branch June 27, 2014 12:01
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants