我有index.php文件和内容(剪辑):
define('SMS_DIR', dirname(__FILE__) . '/sms_ru_master/');
require_once(ENGINE_DIR . 'main/registry.php');
require_once(SMS_DIR . 'Api.php');
$registry = new Registry();
$sms = new \Zelenin\SmsRu\Api(new \Zelenin\SmsRu\Auth\ApiIdAuth($apiId));
$registry->sms = $sms;
我使用Api.php来使用API一些代码:
<?php
namespace Zelenin\SmsRu;
use Zelenin\SmsRu\Auth\AuthInterface;
use Zelenin\SmsRu\Client\Client;
use Zelenin\SmsRu\Client\ClientInterface;
use Zelenin\SmsRu\Entity\AbstractSms;
use Zelenin\SmsRu\Entity\Sms;
use Zelenin\SmsRu\Entity\SmsPool;
use Zelenin\SmsRu\Entity\StoplistPhone;
use Zelenin\SmsRu\Exception\Exception;
use Zelenin\SmsRu\Response\AuthCheckResponse;
use Zelenin\SmsRu\Response\MyBalanceResponse;
use Zelenin\SmsRu\Response\MyLimitResponse;
use Zelenin\SmsRu\Response\MySendersResponse;
use Zelenin\SmsRu\Response\SmsCostResponse;
use Zelenin\SmsRu\Response\SmsResponse;
use Zelenin\SmsRu\Response\SmsStatusResponse;
use Zelenin\SmsRu\Response\StoplistAddResponse;
use Zelenin\SmsRu\Response\StoplistDelResponse;
use Zelenin\SmsRu\Response\StoplistGetResponse;
class Api
{
/**
* @var AuthInterface
*/
private $auth;
/**
* @var ClientInterface
*/
private $client;
/**
* @param AuthInterface $auth
*/
public function __construct(AuthInterface $auth)
{
$this->auth = $auth;
$this->auth->setContext($this);
}
但是当我使用
时$sms = new \Zelenin\SmsRu\Api(new \Zelenin\SmsRu\Auth\ApiIdAuth($apiId));
我收到错误:致命错误:Class&#39; Zelenin \ SmsRu \ Auth \ ApiIdAuth&#39;在第43行的C:\ OpenServer \ domains \ sowords.com \ index.php中找不到
我该怎么办?
上课