【问题标题】:Connecting to ActiveCollab by SDK throws an error通过 SDK 连接到 ActiveCollab 会引发错误
【发布时间】:2021-01-12 12:48:55
【问题描述】:

我正在尝试连接到我们的云帐户,但出现以下错误:

致命错误:未捕获的错误:在 /www/htdocs/asdf/asdf.org/example-cloud.php:13 中找不到类“ActiveCollab\SDK\Authenticator\Cloud”:13 堆栈跟踪:#0 {main} 抛出/www/htdocs/asf/asdf.org/example-cloud.php 第 13 行

    require_once('https://app.activecollab.com/xxxxxx/autoload.php');

// Provide name of your company, name of the app that you are developing, your email address and password.
$authenticator = new \ActiveCollab\SDK\Authenticator\Cloud('xxx', 'My Awesome Application', 'vvv@ghf.de', '123qwe123*');

// Show all Active Collab 5 and up account that this user has access to.
print_r($authenticator->getAccounts());

// Show user details (first name, last name and avatar URL).
print_r($authenticator->getUser());

// Issue a token for account #123456789.
$token = $authenticator->issueToken('123456789');

// Did we get it?
if ($token instanceof \ActiveCollab\SDK\TokenInterface) {
    print $token->getUrl() . "\n";
    print $token->getToken() . "\n";
} else {
    print "Invalid response\n";
    die();
}

我做错了什么?

【问题讨论】:

    标签: php api sdk activecollab


    【解决方案1】:

    您的代码示例中的第一行不好。在继续之前,您应该查看有关Composer 基本用法的文章:https://getcomposer.org/doc/01-basic-usage.md

    在您的开发环境中正确设置 Composer、所需的 ActiveCollab SDK 和更新的依赖项后,您的第一行很可能如下所示:

    require __DIR__ . '/vendor/autoload.php';
    

    【讨论】:

      【解决方案2】:

      但是你说: 安装 如果您选择使用 Composer 安装此应用程序而不是拉下 git 存储库,则需要将 composer.json 文件添加到您希望将存储库拉到特色的位置:

      所以我试图拉下存储库 - 还是我错了...... https://github.com/activecollab/activecollab-feather-sdk

      【讨论】:

        猜你喜欢
        • 2015-09-15
        • 1970-01-01
        • 2016-03-19
        • 1970-01-01
        • 2019-10-24
        • 2021-09-22
        • 1970-01-01
        • 2022-07-02
        • 2020-12-17
        相关资源
        最近更新 更多