New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added autoloader for those poor non-composer peeps #135

Merged
merged 1 commit into from Jun 27, 2014

Conversation

Projects
None yet
2 participants
@SammyK
Collaborator

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

This comment has been minimized.

Contributor

gfosco commented Jun 27, 2014

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

gfosco added a commit that referenced this pull request Jun 27, 2014

Merge pull request #135 from SammyK/autoloader-for-non-composer-peeps
Added autoloader for those poor non-composer peeps

@gfosco gfosco merged commit a20dc24 into facebook:master Jun 27, 2014

@SammyK

This comment has been minimized.

Collaborator

SammyK commented Jun 27, 2014

Do you ever sleep? :)

@SammyK SammyK deleted the SammyK:autoloader-for-non-composer-peeps branch Jun 27, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment