簡體   English   中英

Laravel找不到Composer倉庫git類

[英]Composer repository git class not found with Laravel

我已將存儲庫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"
    },

在此存儲庫中有一個Client類:

<?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:

您應該在composer.json嘗試:

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

並保持require部分不變,執行composer install ,僅此而已。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM