Skip to content
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

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 gfosco commented Jun 27, 2014

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

gfosco added a commit that referenced this issue 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 SammyK commented Jun 27, 2014

Do you ever sleep? :)

@SammyK SammyK deleted the 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
Labels
None yet
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants