【问题标题】:Include library PHP Codeigniter包含库 PHP Codeigniter
【发布时间】:2017-01-26 12:14:43
【问题描述】:

我想在我的 Codeigniter 项目中包含 Threema 库,但我在执行时遇到了麻烦。 This is the library. 我按照说明操作,使用 composer 创建了一个自动加载,但我不知道如何使它工作。我有一个看起来像这样的助手:

require_once APPPATH . "libraries/Threema/vendor/autoload.php";

    //define your connection settings
    $settings = new ConnectionSettings(
    '*xxxxx',
    'xxxxxx'
    );

    $publicKeyStore = new Threema\MsgApi\PublicKeyStores\File("pathTo/threema_key.php");
    $connector = new Connection($settings, $publicKeyStore);

我有错误:

找不到类“ConnectionSettings”

我尝试使用关键字“use”作为指南,但这也不起作用:

use Threema\MsgApi\Connection;
use Threema\MsgApi\ConnectionSettings;
use Threema\MsgApi\Receiver;

在 CodeIgniter 环境中安装这个库的简单方法是什么?

【问题讨论】:

  • 您是否尝试过new Threema\MsgApi\Connection() 而不仅仅是new Connection?与ConnectionSettings 相同

标签: php codeigniter


【解决方案1】:

尝试改变这一行

require $SERVER['DOCUMENT_ROOT'] ./'libraries/Threema/vendor/autoload.php';

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-06-04
    • 2011-01-21
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多