gpt4 book ai didi

cakephp websocket Ratchet 安装错误

转载 作者:行者123 更新时间:2023-12-04 16:13:52 27 4
gpt4 key购买 nike

我正在尝试安装 Cakephp Ratchet Plugin在现有项目中。
我的 CakePHP 版本是 2.4.3。
说要关注this link它有以下步骤:

 $ cd myproject/app/
$ curl -s https://getcomposer.org/installer | php
$ php composer.phar require --no-update opauth/opauth:dev-wip/1.0 opauth/twitter:dev- wip/1.0
$ php composer.phar config vendor-dir Vendor
$ php composer.phar install

我对 Composer 不是很熟悉,当我做最后一步时,它显示以下错误....
Your requirements could not be resolved to an installable set of packages.

Problem 1
- The requested package opauth/opauth could not be found in any version, there may be a typo in the package name.
Problem 2
- The requested package opauth/twitter 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 minimum-stability setting

编辑:
Composer.json 是这样的
    {
"require": {
"opauth/opauth": "dev-wip/1.0",
"opauth/twitter": "dev-wip/1.0"
},
"config": {
"vendor-dir": "Vendor"
}
}

最佳答案

正如我在评论中已经提到的,Ratchet 插件与 Opauth 无关。 ,链接文章在 ceeram.github.io应该仅作为如何配置 Composer 和 CakePHP bootstrap 的示例。

但是,对于 CakePHP 中的 Composer 自动加载,我建议您引用 CakePHP 食谱,即使您没有通过 Composer 包含 CakePHP 本身:

http://book.cakephp.org/2.0/en/installation/advanced-installation.html

长话短说,插件文档的“ 入门/2. Composer ”部分要您做的是需要 Ratchet 插件,以确保供应商目录指向/app/Vendor/ ,并在您的 bootstrap.php 中包含 Composer 自动加载器.

composer.json (假设它放在 /app 中)

{
"require": {
"wyrihaximus/ratchet": "dev-master"
},
"config": {
"vendor-dir": "Vendor"
}
}

bootstrap.php (根据食谱)
// Load Composer autoload.
require APP . '/Vendor/autoload.php';

// Remove and re-prepend CakePHP's autoloader as Composer thinks it is the
// most important.
// See: http://goo.gl/kKVJO7
spl_autoload_unregister(array('App', 'load'));
spl_autoload_register(array('App', 'load'), true, true);

运行 composer installcomposer update你应该很好。

关于cakephp websocket Ratchet 安装错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22862375/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com