【问题标题】:Composer repository git class not found with LaravelLaravel 找不到 Composer 存储库 git 类
【发布时间】:2018-01-02 01:24:27
【问题描述】:

我已将存储库 git 作为我的项目的作曲家依赖项添加。

"repositories": [
        {
            "type":"package",
            "package": {
                "name": "Neabfi/SDK-PHP",
                "version":"3.1.2",
                "source": {
                    "url": "https://github.com/Neabfi/SDK-PHP.git",
                    "type": "git",
                    "reference":"master"
                }
            }
        }
    ],
    "require": {
        "Neabfi/SDK-PHP": "3.1.2"
    },

在这个存储库中有一个客户端类:

<?php

namespace RecastAI;

/**
 * Class Client
 * @package RecastAI
 */
class Client { ... }

当我尝试使用它时。

<?php

use RecastAI\Client;

[...]

$client = new Client(env('RECAST_REQUEST_TOKEN'), env('RECAST_LANGUAGE'));

[...]

他好像找不到:

[2017-07-26 15:30:50] local.ERROR: Symfony\Component\Debug\Exception\FatalThrowableError: Class 'RecastAI\Client' not found in /Users/fabien/Sites/abote/app/Recast.php:20
Stack trace:

【问题讨论】:

    标签: php laravel git composer-php sap-conversational-ai


    【解决方案1】:

    你应该在你的composer.json中试试这个:

    "repositories": [
        {
          "type": "git",
          "url": "https://github.com/Neabfi/SDK-PHP.git"
        }
      ],
    

    并保持所需部分不变,执行composer install,就是这样。

    【讨论】:

    • 这不会改变任何事情
    猜你喜欢
    • 1970-01-01
    • 2017-01-04
    • 2016-08-27
    • 2012-08-11
    • 2021-06-18
    • 2016-10-15
    • 2018-12-09
    • 1970-01-01
    • 2023-04-01
    相关资源
    最近更新 更多