khorsa/ispmanager-api

访问 ISPManager API 的服务

0.3.2 2024-01-04 13:11 UTC

This package is auto-updated.

Last update: 2024-09-04 14:27:13 UTC


README

ISPManager 6 的 API

开发中,当前版本 - 0.3.0 (2023年12月5日)

当前已实现的函数列表

  • user.suspend - 禁用用户 - IspUser::suspend($username)
  • user.resume - 启用用户 - IspUser::resume($username)
  • user.delete - 删除用户 - IspUser::delete($username)
  • webdomain - 获取网页域名列表 - IspWebDomain::list($username)

使用方法

class Manage()
{
    public function __construct(
        private readonly IspUser $ispUser,
    ){
        $this->ispUser->setAccessData(new IspAccessData(
            'https',
            'fake-site.com',
            1500,
            'login',
            'password',
        ));
    }

    public function turnOff(string $username): void
    {
        try {
            $this->ispUser->suspend($username);
        } catch(IspException $ex) {
            print $ex->getMessage();
        }
    }
}