繁体   English   中英

PHP将Facebook SDK添加到作曲家

[英]php add facebook sdk to the composer

我正在阅读此官方Facebook https://developers.facebook.com/docs/php/gettingstarted/4.0.0页面。

我想将Facebook SDK添加到我的项目中

我试图做到这一点: composer require facebook/php-sdk在我的项目的根目录中composer require facebook/php-sdk ,我得到了

Warning: This development build of composer is over 30 days old. It is recommend
ed to update it by running "C:\ProgramData\ComposerSetup\bin\composer.phar self-
update" to get the latest version.
Please provide a version constraint for the facebook/php-sdk requirement: **4**

如您所见,我选择了4,然后收到此错误消息:

./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - The requested package facebook/php-sdk could not be found in any version,
there may be a typo in the package name.

Potential causes:
 - A typo in the package name
 - The package is not available in a stable-enough version according to your min
imum-stability setting
   see <https://groups.google.com/d/topic/composer-dev/_g3ASeIFlrc/discussion> f
or more details.

Read <http://getcomposer.org/doc/articles/troubleshooting.md> for further common
 problems.

Installation failed, reverting ./composer.json to its original content.

为什么要这样? 请注意,我没有向composer.json添加任何内容。

我打开composer.json并发现以下行:

"require": {
        "laravel/framework": "4.2.*"
    },

所以我应该将其更改为:

"require": {
        "laravel/framework": "4.2.*",
          "facebook/php-sdk-v4" : "4.0.*" 
    },

还是应该保留它并添加一个新的require实体,如下所示:

"require" : {
    "facebook/php-sdk-v4" : "4.0.*"
  }

只需尝试将facebook/php-sdk-4到现有的require哈希中,然后运行composer update

"require": {
    "laravel/framework": "4.2.*",
    "facebook/php-sdk-v4" : "4.0.*" 
}

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM