我正在尝试安装此lib:https://packagist.org/packages/clxcommunications/sdk-xms
首先运行此命令: composer require clxcommunications/sdk-xms
然后使用此代码创建一个文件:
<?php
require 'vendor/autoload.php';
$client = ClxXmsClient('myserviceplan', 'mytoken');
var_dump($client);
die();
但我收到以下消息:
( ! ) Fatal error: Call to undefined function ClxXmsClient() in C:wampwwwclxcommunicationsindex.php on line 7
这是我的composer.json
{
"require": {
"clxcommunications/sdk-xms": "^1.1"
}
}
这是我的autoload_psr4.php:
<?php
// autoload_psr4.php @generated by Composer
$vendorDir = dirname(dirname(__FILE__));
$baseDir = dirname($vendorDir);
return array(
'Psr\Log\' => array($vendorDir . '/psr/log/Psr/Log'),
'Clx\Xms\' => array($vendorDir . '/clxcommunications/sdk-xms/src'),
);
我想念什么?
预先感谢。
您缺少PHP new
关键字
$client = new ClxXmsClient('myserviceplan', 'mytoken');