Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

added composer.json #12

Merged
merged 1 commit into from
@lsmith77

This PR add a composer.json manifest file.

Composer is a new packager manager that is seeing significant adoption in the PHP scene by the likes of Symfony, Doctrine, FuelPHP .. see http://philsturgeon.co.uk/blog/2012/03/packages-the-way-forward-for-php

Even Drupal is looking into adopting it http://drupal.org/node/1398772).

Do note that its still under development.

For more information see http://getcomposer.org/
The index of currently available packages is here http://packagist.org/

Note once the composer.json is added the git repo also needs to be registered on packagist.org. As you are already tagging releases no additional steps are necessary in the future, as the site will automatically will pickup new releases based on the tags.

/cc @scottmac @seldaek

@lsmith77

I should add that I have not signed the CLA, but since this is not a code contribution I figure its not necessary.

@cordoval

+1

I do think this is a code contribution but of different type. Maybe someone else that had signed the CLA can copy your code and do the PR for you to avoid problems.

@jmikola

@lsmith77: Does "autoload": {"classmap": ["src"]} allow Composer's autoloader to properly handle facebook.php and base_facebook.php? I know we've had trouble autoloading those classes in the past, since they don't mesh with PSR-0.

I know this is getting Symfony2-specific, but isn't that why FOSFacebookBundle relies on the file attribute of the service definition to manually load the dependency?

I'll also ping @oyvindkinsey here, since he was the last FB dev to merge a PR two months ago :)

@lsmith77

Indeed classmap deals with libs that are not PSR-0 compliant:


<?php

// autoload_classmap.php generated by Composer

$vendorDir = dirname(__DIR__);
$baseDir = dirname($vendorDir);

return array(
    'FacebookApiException' => $baseDir . '/vendor/facebook/php-sdk/src/base_facebook.php',
    'BaseFacebook' => $baseDir . '/vendor/facebook/php-sdk/src/base_facebook.php',
    'Facebook' => $baseDir . '/vendor/facebook/php-sdk/src/facebook.php',
);
<?php

// autoload.php generated by Composer
if (!class_exists('Composer\\Autoload\\ClassLoader', false)) {
    require __DIR__.'/ClassLoader.php';
}

return call_user_func(function() {
    $loader = new \Composer\Autoload\ClassLoader();

    $map = require __DIR__.'/autoload_namespaces.php';

    foreach ($map as $namespace => $path) {
        $loader->add($namespace, $path);
    }

    $classMap = require __DIR__.'/autoload_classmap.php';
    if ($classMap) {
        $loader->addClassMap($classMap);
    }

    $loader->register();

    return $loader;
});
@maoueh

Nice move, this would allow me to avoid using custom repositories within my composer.json file. Big +1 on this one.

@jclaros

+1 it should be an standard to use composer in all projects related with php

@dmitrybelyakov

Yes, please merge that.

@scottmac scottmac merged commit aba1cc4 into facebookarchive:master
@scottmac

After discussion around the CLA, we can merge this without one as Lukas has agreed to submit it under the Apache 2.0 license.

@naderman

Cool! Thanks :)

@ebuildy

Sound like Php is becoming a messy merge of Java and Ruby On Rails ;-)

@Ocramius

@ebuildy actually, this is just package management...

@philsturgeon
@ebuildy

@Ocramius yes and its a very good thing for Php developper (what I am...), just said composer its just a copy of "gem" from RoR (same thing for Symfony2 which is a copy of Java concepts ....), but yes its a really cool tool !

@mhughes

Please don't feed the trolls

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Mar 11, 2012
  1. @lsmith77

    added composer.json

    lsmith77 authored
This page is out of date. Refresh to see the latest.
Showing with 22 additions and 0 deletions.
  1. +22 −0 composer.json
View
22 composer.json
@@ -0,0 +1,22 @@
+{
+ "name": "facebook/php-sdk",
+ "description": "Facebook PHP SDK",
+ "keywords": ["facebook", "sdk"],
+ "type": "library",
+ "homepage": "https://github.com/facebook/facebook-php-sdk",
+ "license": "Apache2",
+ "authors": [
+ {
+ "name": "Facebook",
+ "homepage": "https://github.com/facebook/facebook-php-sdk/contributors"
+ }
+ ],
+ "require": {
+ "php": ">=5.2.0",
+ "ext-curl": "*",
+ "ext-json": "*"
+ },
+ "autoload": {
+ "classmap": ["src"]
+ }
+}
Something went wrong with that request. Please try again.