【发布时间】: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