├── .gitignore ├── .travis.yml ├── README.md ├── composer.json ├── composer.lock ├── phpunit.xml.dist ├── src ├── Entity │ ├── Account.php │ ├── Domain.php │ ├── DomainUser.php │ ├── SuspendedAccount.php │ └── UserPrivilege.php ├── Exceptions │ └── ClientExceptions.php ├── WHM │ └── Accounts.php └── WHMClient.php └── tests └── WHMClientTest.php /.gitignore: -------------------------------------------------------------------------------- 1 | .idea/* 2 | .git/* 3 | vendor/* 4 | build/* 5 | phpunit.xml -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: php 2 | 3 | sudo: false 4 | 5 | php: 6 | - 5.5 7 | - 5.6 8 | - 7.0 9 | - 7.1 10 | - hhvm 11 | 12 | matrix: 13 | include: 14 | - php: 5.5 15 | env: 'COMPOSER_FLAGS="--prefer-stable --prefer-lowest"' 16 | 17 | before_script: 18 | - travis_retry composer self-update 19 | - travis_retry composer install --no-interaction --prefer-source --dev 20 | - travis_retry phpenv rehash 21 | 22 | script: 23 | - ./vendor/bin/phpunit --configuration ./phpunit.xml.dist 24 | 25 | after_script: 26 | - wget https://scrutinizer-ci.com/ocular.phar 27 | - php ocular.phar code-coverage:upload --format=php-clover ./build/coverage/log/coverage.xml -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ## cPanel/WHM API PHP 2 | Manage your WHM/cPanel server with this PHP library. Simple to use. With this PHP library, you can manage your cPanel/WHM server. 3 | 4 | [![License](https://img.shields.io/packagist/l/previewtechs/cpanel-whm-api.svg)](https://github.com/PreviewTechnologies/cpanel-whm-api/blob/master/LICENSE) 5 | [![Build Status](https://api.travis-ci.org/PreviewTechnologies/cpanel-whm-api.svg?branch=master)](https://travis-ci.org/PreviewTechnologies/cpanel-whm-api) 6 | [![Code Coverage](https://scrutinizer-ci.com/g/PreviewTechnologies/cpanel-whm-api/badges/coverage.png?b=master)](https://scrutinizer-ci.com/g/PreviewTechnologies/cpanel-whm-api/?branch=master) 7 | [![Code Quality](https://scrutinizer-ci.com/g/PreviewTechnologies/cpanel-whm-api/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/PreviewTechnologies/cpanel-whm-api/?branch=master) 8 | [![Code Quality](https://scrutinizer-ci.com/g/PreviewTechnologies/cpanel-whm-api/badges/code-intelligence.svg?b=master)](https://scrutinizer-ci.com/g/PreviewTechnologies/cpanel-whm-api/?branch=master) 9 | 10 | ### Installation 11 | 12 | You can install this library with composer. 13 | 14 | ```bash 15 | composer require previewtechs/cpanel-whm-api:dev-master 16 | ``` 17 | 18 | ### Usage 19 | ```php 20 | searchAccounts()); 32 | ``` 33 | 34 | #### WHM Client 35 | 36 | To access and use WHM related functionality you must need to build WHM client with configuration 37 | and credentials. 38 | 39 | To configure your WHM client, you must provide your WHM username (you use to login into your WHM panel) and API Token. 40 | 41 | If you have an API token you can use that if proper permissions are configured, otherwise 42 | you can create a new API token from your WHM. 43 | 44 | Create API token from https://your-whm-server:2087/cpsessxxxxxx/scripts7/apitokens/home 45 | 46 | Learn more about WHM API Token from [https://documentation.cpanel.net/display/64Docs/Manage+API+Tokens](https://documentation.cpanel.net/display/64Docs/Manage+API+Tokens) 47 | ```php 48 | =5.5", 14 | "ext-curl": "*", 15 | "guzzlehttp/psr7": "^1.4", 16 | "php-http/client-implementation": "^1.0", 17 | "php-http/guzzle6-adapter": "^1.1" 18 | }, 19 | "autoload": { 20 | "psr-4": { 21 | "PreviewTechs\\cPanelWHM\\": "src" 22 | } 23 | }, 24 | "autoload-dev": { 25 | "psr-4": { 26 | "PreviewTechs\\cPanelWHM\\Tests\\": "tests" 27 | } 28 | }, 29 | "require-dev": { 30 | "mockery/mockery": "^0.9.9", 31 | "phpunit/phpunit": "^4.8", 32 | "php-http/mock-client": "^1.1", 33 | "squizlabs/php_codesniffer": "^3.3" 34 | }, 35 | "scripts":{ 36 | "phpcs": "vendor/bin/phpcs --standard=psr2 src/", 37 | "phpunit": "vendor/bin/phpunit" 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /composer.lock: -------------------------------------------------------------------------------- 1 | { 2 | "_readme": [ 3 | "This file locks the dependencies of your project to a known state", 4 | "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", 5 | "This file is @generated automatically" 6 | ], 7 | "content-hash": "1c43906efd6427d3613c813cb399eb92", 8 | "packages": [ 9 | { 10 | "name": "guzzlehttp/guzzle", 11 | "version": "6.3.3", 12 | "source": { 13 | "type": "git", 14 | "url": "https://github.com/guzzle/guzzle.git", 15 | "reference": "407b0cb880ace85c9b63c5f9551db498cb2d50ba" 16 | }, 17 | "dist": { 18 | "type": "zip", 19 | "url": "https://api.github.com/repos/guzzle/guzzle/zipball/407b0cb880ace85c9b63c5f9551db498cb2d50ba", 20 | "reference": "407b0cb880ace85c9b63c5f9551db498cb2d50ba", 21 | "shasum": "" 22 | }, 23 | "require": { 24 | "guzzlehttp/promises": "^1.0", 25 | "guzzlehttp/psr7": "^1.4", 26 | "php": ">=5.5" 27 | }, 28 | "require-dev": { 29 | "ext-curl": "*", 30 | "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.4 || ^7.0", 31 | "psr/log": "^1.0" 32 | }, 33 | "suggest": { 34 | "psr/log": "Required for using the Log middleware" 35 | }, 36 | "type": "library", 37 | "extra": { 38 | "branch-alias": { 39 | "dev-master": "6.3-dev" 40 | } 41 | }, 42 | "autoload": { 43 | "files": [ 44 | "src/functions_include.php" 45 | ], 46 | "psr-4": { 47 | "GuzzleHttp\\": "src/" 48 | } 49 | }, 50 | "notification-url": "https://packagist.org/downloads/", 51 | "license": [ 52 | "MIT" 53 | ], 54 | "authors": [ 55 | { 56 | "name": "Michael Dowling", 57 | "email": "mtdowling@gmail.com", 58 | "homepage": "https://github.com/mtdowling" 59 | } 60 | ], 61 | "description": "Guzzle is a PHP HTTP client library", 62 | "homepage": "http://guzzlephp.org/", 63 | "keywords": [ 64 | "client", 65 | "curl", 66 | "framework", 67 | "http", 68 | "http client", 69 | "rest", 70 | "web service" 71 | ], 72 | "time": "2018-04-22T15:46:56+00:00" 73 | }, 74 | { 75 | "name": "guzzlehttp/promises", 76 | "version": "v1.3.1", 77 | "source": { 78 | "type": "git", 79 | "url": "https://github.com/guzzle/promises.git", 80 | "reference": "a59da6cf61d80060647ff4d3eb2c03a2bc694646" 81 | }, 82 | "dist": { 83 | "type": "zip", 84 | "url": "https://api.github.com/repos/guzzle/promises/zipball/a59da6cf61d80060647ff4d3eb2c03a2bc694646", 85 | "reference": "a59da6cf61d80060647ff4d3eb2c03a2bc694646", 86 | "shasum": "" 87 | }, 88 | "require": { 89 | "php": ">=5.5.0" 90 | }, 91 | "require-dev": { 92 | "phpunit/phpunit": "^4.0" 93 | }, 94 | "type": "library", 95 | "extra": { 96 | "branch-alias": { 97 | "dev-master": "1.4-dev" 98 | } 99 | }, 100 | "autoload": { 101 | "psr-4": { 102 | "GuzzleHttp\\Promise\\": "src/" 103 | }, 104 | "files": [ 105 | "src/functions_include.php" 106 | ] 107 | }, 108 | "notification-url": "https://packagist.org/downloads/", 109 | "license": [ 110 | "MIT" 111 | ], 112 | "authors": [ 113 | { 114 | "name": "Michael Dowling", 115 | "email": "mtdowling@gmail.com", 116 | "homepage": "https://github.com/mtdowling" 117 | } 118 | ], 119 | "description": "Guzzle promises library", 120 | "keywords": [ 121 | "promise" 122 | ], 123 | "time": "2016-12-20T10:07:11+00:00" 124 | }, 125 | { 126 | "name": "guzzlehttp/psr7", 127 | "version": "1.4.2", 128 | "source": { 129 | "type": "git", 130 | "url": "https://github.com/guzzle/psr7.git", 131 | "reference": "f5b8a8512e2b58b0071a7280e39f14f72e05d87c" 132 | }, 133 | "dist": { 134 | "type": "zip", 135 | "url": "https://api.github.com/repos/guzzle/psr7/zipball/f5b8a8512e2b58b0071a7280e39f14f72e05d87c", 136 | "reference": "f5b8a8512e2b58b0071a7280e39f14f72e05d87c", 137 | "shasum": "" 138 | }, 139 | "require": { 140 | "php": ">=5.4.0", 141 | "psr/http-message": "~1.0" 142 | }, 143 | "provide": { 144 | "psr/http-message-implementation": "1.0" 145 | }, 146 | "require-dev": { 147 | "phpunit/phpunit": "~4.0" 148 | }, 149 | "type": "library", 150 | "extra": { 151 | "branch-alias": { 152 | "dev-master": "1.4-dev" 153 | } 154 | }, 155 | "autoload": { 156 | "psr-4": { 157 | "GuzzleHttp\\Psr7\\": "src/" 158 | }, 159 | "files": [ 160 | "src/functions_include.php" 161 | ] 162 | }, 163 | "notification-url": "https://packagist.org/downloads/", 164 | "license": [ 165 | "MIT" 166 | ], 167 | "authors": [ 168 | { 169 | "name": "Michael Dowling", 170 | "email": "mtdowling@gmail.com", 171 | "homepage": "https://github.com/mtdowling" 172 | }, 173 | { 174 | "name": "Tobias Schultze", 175 | "homepage": "https://github.com/Tobion" 176 | } 177 | ], 178 | "description": "PSR-7 message implementation that also provides common utility methods", 179 | "keywords": [ 180 | "http", 181 | "message", 182 | "request", 183 | "response", 184 | "stream", 185 | "uri", 186 | "url" 187 | ], 188 | "time": "2017-03-20T17:10:46+00:00" 189 | }, 190 | { 191 | "name": "php-http/guzzle6-adapter", 192 | "version": "v1.1.1", 193 | "source": { 194 | "type": "git", 195 | "url": "https://github.com/php-http/guzzle6-adapter.git", 196 | "reference": "a56941f9dc6110409cfcddc91546ee97039277ab" 197 | }, 198 | "dist": { 199 | "type": "zip", 200 | "url": "https://api.github.com/repos/php-http/guzzle6-adapter/zipball/a56941f9dc6110409cfcddc91546ee97039277ab", 201 | "reference": "a56941f9dc6110409cfcddc91546ee97039277ab", 202 | "shasum": "" 203 | }, 204 | "require": { 205 | "guzzlehttp/guzzle": "^6.0", 206 | "php": ">=5.5.0", 207 | "php-http/httplug": "^1.0" 208 | }, 209 | "provide": { 210 | "php-http/async-client-implementation": "1.0", 211 | "php-http/client-implementation": "1.0" 212 | }, 213 | "require-dev": { 214 | "ext-curl": "*", 215 | "php-http/adapter-integration-tests": "^0.4" 216 | }, 217 | "type": "library", 218 | "extra": { 219 | "branch-alias": { 220 | "dev-master": "1.2-dev" 221 | } 222 | }, 223 | "autoload": { 224 | "psr-4": { 225 | "Http\\Adapter\\Guzzle6\\": "src/" 226 | } 227 | }, 228 | "notification-url": "https://packagist.org/downloads/", 229 | "license": [ 230 | "MIT" 231 | ], 232 | "authors": [ 233 | { 234 | "name": "Márk Sági-Kazár", 235 | "email": "mark.sagikazar@gmail.com" 236 | }, 237 | { 238 | "name": "David de Boer", 239 | "email": "david@ddeboer.nl" 240 | } 241 | ], 242 | "description": "Guzzle 6 HTTP Adapter", 243 | "homepage": "http://httplug.io", 244 | "keywords": [ 245 | "Guzzle", 246 | "http" 247 | ], 248 | "time": "2016-05-10T06:13:32+00:00" 249 | }, 250 | { 251 | "name": "php-http/httplug", 252 | "version": "v1.1.0", 253 | "source": { 254 | "type": "git", 255 | "url": "https://github.com/php-http/httplug.git", 256 | "reference": "1c6381726c18579c4ca2ef1ec1498fdae8bdf018" 257 | }, 258 | "dist": { 259 | "type": "zip", 260 | "url": "https://api.github.com/repos/php-http/httplug/zipball/1c6381726c18579c4ca2ef1ec1498fdae8bdf018", 261 | "reference": "1c6381726c18579c4ca2ef1ec1498fdae8bdf018", 262 | "shasum": "" 263 | }, 264 | "require": { 265 | "php": ">=5.4", 266 | "php-http/promise": "^1.0", 267 | "psr/http-message": "^1.0" 268 | }, 269 | "require-dev": { 270 | "henrikbjorn/phpspec-code-coverage": "^1.0", 271 | "phpspec/phpspec": "^2.4" 272 | }, 273 | "type": "library", 274 | "extra": { 275 | "branch-alias": { 276 | "dev-master": "1.1-dev" 277 | } 278 | }, 279 | "autoload": { 280 | "psr-4": { 281 | "Http\\Client\\": "src/" 282 | } 283 | }, 284 | "notification-url": "https://packagist.org/downloads/", 285 | "license": [ 286 | "MIT" 287 | ], 288 | "authors": [ 289 | { 290 | "name": "Eric GELOEN", 291 | "email": "geloen.eric@gmail.com" 292 | }, 293 | { 294 | "name": "Márk Sági-Kazár", 295 | "email": "mark.sagikazar@gmail.com" 296 | } 297 | ], 298 | "description": "HTTPlug, the HTTP client abstraction for PHP", 299 | "homepage": "http://httplug.io", 300 | "keywords": [ 301 | "client", 302 | "http" 303 | ], 304 | "time": "2016-08-31T08:30:17+00:00" 305 | }, 306 | { 307 | "name": "php-http/promise", 308 | "version": "v1.0.0", 309 | "source": { 310 | "type": "git", 311 | "url": "https://github.com/php-http/promise.git", 312 | "reference": "dc494cdc9d7160b9a09bd5573272195242ce7980" 313 | }, 314 | "dist": { 315 | "type": "zip", 316 | "url": "https://api.github.com/repos/php-http/promise/zipball/dc494cdc9d7160b9a09bd5573272195242ce7980", 317 | "reference": "dc494cdc9d7160b9a09bd5573272195242ce7980", 318 | "shasum": "" 319 | }, 320 | "require-dev": { 321 | "henrikbjorn/phpspec-code-coverage": "^1.0", 322 | "phpspec/phpspec": "^2.4" 323 | }, 324 | "type": "library", 325 | "extra": { 326 | "branch-alias": { 327 | "dev-master": "1.1-dev" 328 | } 329 | }, 330 | "autoload": { 331 | "psr-4": { 332 | "Http\\Promise\\": "src/" 333 | } 334 | }, 335 | "notification-url": "https://packagist.org/downloads/", 336 | "license": [ 337 | "MIT" 338 | ], 339 | "authors": [ 340 | { 341 | "name": "Márk Sági-Kazár", 342 | "email": "mark.sagikazar@gmail.com" 343 | }, 344 | { 345 | "name": "Joel Wurtz", 346 | "email": "joel.wurtz@gmail.com" 347 | } 348 | ], 349 | "description": "Promise used for asynchronous HTTP requests", 350 | "homepage": "http://httplug.io", 351 | "keywords": [ 352 | "promise" 353 | ], 354 | "time": "2016-01-26T13:27:02+00:00" 355 | }, 356 | { 357 | "name": "psr/http-message", 358 | "version": "1.0.1", 359 | "source": { 360 | "type": "git", 361 | "url": "https://github.com/php-fig/http-message.git", 362 | "reference": "f6561bf28d520154e4b0ec72be95418abe6d9363" 363 | }, 364 | "dist": { 365 | "type": "zip", 366 | "url": "https://api.github.com/repos/php-fig/http-message/zipball/f6561bf28d520154e4b0ec72be95418abe6d9363", 367 | "reference": "f6561bf28d520154e4b0ec72be95418abe6d9363", 368 | "shasum": "" 369 | }, 370 | "require": { 371 | "php": ">=5.3.0" 372 | }, 373 | "type": "library", 374 | "extra": { 375 | "branch-alias": { 376 | "dev-master": "1.0.x-dev" 377 | } 378 | }, 379 | "autoload": { 380 | "psr-4": { 381 | "Psr\\Http\\Message\\": "src/" 382 | } 383 | }, 384 | "notification-url": "https://packagist.org/downloads/", 385 | "license": [ 386 | "MIT" 387 | ], 388 | "authors": [ 389 | { 390 | "name": "PHP-FIG", 391 | "homepage": "http://www.php-fig.org/" 392 | } 393 | ], 394 | "description": "Common interface for HTTP messages", 395 | "homepage": "https://github.com/php-fig/http-message", 396 | "keywords": [ 397 | "http", 398 | "http-message", 399 | "psr", 400 | "psr-7", 401 | "request", 402 | "response" 403 | ], 404 | "time": "2016-08-06T14:39:51+00:00" 405 | } 406 | ], 407 | "packages-dev": [ 408 | { 409 | "name": "clue/stream-filter", 410 | "version": "v1.4.0", 411 | "source": { 412 | "type": "git", 413 | "url": "https://github.com/clue/php-stream-filter.git", 414 | "reference": "d80fdee9b3a7e0d16fc330a22f41f3ad0eeb09d0" 415 | }, 416 | "dist": { 417 | "type": "zip", 418 | "url": "https://api.github.com/repos/clue/php-stream-filter/zipball/d80fdee9b3a7e0d16fc330a22f41f3ad0eeb09d0", 419 | "reference": "d80fdee9b3a7e0d16fc330a22f41f3ad0eeb09d0", 420 | "shasum": "" 421 | }, 422 | "require": { 423 | "php": ">=5.3" 424 | }, 425 | "require-dev": { 426 | "phpunit/phpunit": "^5.0 || ^4.8" 427 | }, 428 | "type": "library", 429 | "autoload": { 430 | "psr-4": { 431 | "Clue\\StreamFilter\\": "src/" 432 | }, 433 | "files": [ 434 | "src/functions.php" 435 | ] 436 | }, 437 | "notification-url": "https://packagist.org/downloads/", 438 | "license": [ 439 | "MIT" 440 | ], 441 | "authors": [ 442 | { 443 | "name": "Christian Lück", 444 | "email": "christian@lueck.tv" 445 | } 446 | ], 447 | "description": "A simple and modern approach to stream filtering in PHP", 448 | "homepage": "https://github.com/clue/php-stream-filter", 449 | "keywords": [ 450 | "bucket brigade", 451 | "callback", 452 | "filter", 453 | "php_user_filter", 454 | "stream", 455 | "stream_filter_append", 456 | "stream_filter_register" 457 | ], 458 | "time": "2017-08-18T09:54:01+00:00" 459 | }, 460 | { 461 | "name": "doctrine/instantiator", 462 | "version": "1.0.5", 463 | "source": { 464 | "type": "git", 465 | "url": "https://github.com/doctrine/instantiator.git", 466 | "reference": "8e884e78f9f0eb1329e445619e04456e64d8051d" 467 | }, 468 | "dist": { 469 | "type": "zip", 470 | "url": "https://api.github.com/repos/doctrine/instantiator/zipball/8e884e78f9f0eb1329e445619e04456e64d8051d", 471 | "reference": "8e884e78f9f0eb1329e445619e04456e64d8051d", 472 | "shasum": "" 473 | }, 474 | "require": { 475 | "php": ">=5.3,<8.0-DEV" 476 | }, 477 | "require-dev": { 478 | "athletic/athletic": "~0.1.8", 479 | "ext-pdo": "*", 480 | "ext-phar": "*", 481 | "phpunit/phpunit": "~4.0", 482 | "squizlabs/php_codesniffer": "~2.0" 483 | }, 484 | "type": "library", 485 | "extra": { 486 | "branch-alias": { 487 | "dev-master": "1.0.x-dev" 488 | } 489 | }, 490 | "autoload": { 491 | "psr-4": { 492 | "Doctrine\\Instantiator\\": "src/Doctrine/Instantiator/" 493 | } 494 | }, 495 | "notification-url": "https://packagist.org/downloads/", 496 | "license": [ 497 | "MIT" 498 | ], 499 | "authors": [ 500 | { 501 | "name": "Marco Pivetta", 502 | "email": "ocramius@gmail.com", 503 | "homepage": "http://ocramius.github.com/" 504 | } 505 | ], 506 | "description": "A small, lightweight utility to instantiate objects in PHP without invoking their constructors", 507 | "homepage": "https://github.com/doctrine/instantiator", 508 | "keywords": [ 509 | "constructor", 510 | "instantiate" 511 | ], 512 | "time": "2015-06-14T21:17:01+00:00" 513 | }, 514 | { 515 | "name": "hamcrest/hamcrest-php", 516 | "version": "v1.2.2", 517 | "source": { 518 | "type": "git", 519 | "url": "https://github.com/hamcrest/hamcrest-php.git", 520 | "reference": "b37020aa976fa52d3de9aa904aa2522dc518f79c" 521 | }, 522 | "dist": { 523 | "type": "zip", 524 | "url": "https://api.github.com/repos/hamcrest/hamcrest-php/zipball/b37020aa976fa52d3de9aa904aa2522dc518f79c", 525 | "reference": "b37020aa976fa52d3de9aa904aa2522dc518f79c", 526 | "shasum": "" 527 | }, 528 | "require": { 529 | "php": ">=5.3.2" 530 | }, 531 | "replace": { 532 | "cordoval/hamcrest-php": "*", 533 | "davedevelopment/hamcrest-php": "*", 534 | "kodova/hamcrest-php": "*" 535 | }, 536 | "require-dev": { 537 | "phpunit/php-file-iterator": "1.3.3", 538 | "satooshi/php-coveralls": "dev-master" 539 | }, 540 | "type": "library", 541 | "autoload": { 542 | "classmap": [ 543 | "hamcrest" 544 | ], 545 | "files": [ 546 | "hamcrest/Hamcrest.php" 547 | ] 548 | }, 549 | "notification-url": "https://packagist.org/downloads/", 550 | "license": [ 551 | "BSD" 552 | ], 553 | "description": "This is the PHP port of Hamcrest Matchers", 554 | "keywords": [ 555 | "test" 556 | ], 557 | "time": "2015-05-11T14:41:42+00:00" 558 | }, 559 | { 560 | "name": "mockery/mockery", 561 | "version": "0.9.9", 562 | "source": { 563 | "type": "git", 564 | "url": "https://github.com/mockery/mockery.git", 565 | "reference": "6fdb61243844dc924071d3404bb23994ea0b6856" 566 | }, 567 | "dist": { 568 | "type": "zip", 569 | "url": "https://api.github.com/repos/mockery/mockery/zipball/6fdb61243844dc924071d3404bb23994ea0b6856", 570 | "reference": "6fdb61243844dc924071d3404bb23994ea0b6856", 571 | "shasum": "" 572 | }, 573 | "require": { 574 | "hamcrest/hamcrest-php": "~1.1", 575 | "lib-pcre": ">=7.0", 576 | "php": ">=5.3.2" 577 | }, 578 | "require-dev": { 579 | "phpunit/phpunit": "~4.0" 580 | }, 581 | "type": "library", 582 | "extra": { 583 | "branch-alias": { 584 | "dev-master": "0.9.x-dev" 585 | } 586 | }, 587 | "autoload": { 588 | "psr-0": { 589 | "Mockery": "library/" 590 | } 591 | }, 592 | "notification-url": "https://packagist.org/downloads/", 593 | "license": [ 594 | "BSD-3-Clause" 595 | ], 596 | "authors": [ 597 | { 598 | "name": "Pádraic Brady", 599 | "email": "padraic.brady@gmail.com", 600 | "homepage": "http://blog.astrumfutura.com" 601 | }, 602 | { 603 | "name": "Dave Marshall", 604 | "email": "dave.marshall@atstsolutions.co.uk", 605 | "homepage": "http://davedevelopment.co.uk" 606 | } 607 | ], 608 | "description": "Mockery is a simple yet flexible PHP mock object framework for use in unit testing with PHPUnit, PHPSpec or any other testing framework. Its core goal is to offer a test double framework with a succinct API capable of clearly defining all possible object operations and interactions using a human readable Domain Specific Language (DSL). Designed as a drop in alternative to PHPUnit's phpunit-mock-objects library, Mockery is easy to integrate with PHPUnit and can operate alongside phpunit-mock-objects without the World ending.", 609 | "homepage": "http://github.com/padraic/mockery", 610 | "keywords": [ 611 | "BDD", 612 | "TDD", 613 | "library", 614 | "mock", 615 | "mock objects", 616 | "mockery", 617 | "stub", 618 | "test", 619 | "test double", 620 | "testing" 621 | ], 622 | "time": "2017-02-28T12:52:32+00:00" 623 | }, 624 | { 625 | "name": "php-http/client-common", 626 | "version": "1.7.0", 627 | "source": { 628 | "type": "git", 629 | "url": "https://github.com/php-http/client-common.git", 630 | "reference": "9accb4a082eb06403747c0ffd444112eda41a0fd" 631 | }, 632 | "dist": { 633 | "type": "zip", 634 | "url": "https://api.github.com/repos/php-http/client-common/zipball/9accb4a082eb06403747c0ffd444112eda41a0fd", 635 | "reference": "9accb4a082eb06403747c0ffd444112eda41a0fd", 636 | "shasum": "" 637 | }, 638 | "require": { 639 | "php": "^5.4 || ^7.0", 640 | "php-http/httplug": "^1.1", 641 | "php-http/message": "^1.6", 642 | "php-http/message-factory": "^1.0", 643 | "symfony/options-resolver": "^2.6 || ^3.0 || ^4.0" 644 | }, 645 | "require-dev": { 646 | "guzzlehttp/psr7": "^1.4", 647 | "phpspec/phpspec": "^2.5 || ^3.4 || ^4.2" 648 | }, 649 | "suggest": { 650 | "php-http/cache-plugin": "PSR-6 Cache plugin", 651 | "php-http/logger-plugin": "PSR-3 Logger plugin", 652 | "php-http/stopwatch-plugin": "Symfony Stopwatch plugin" 653 | }, 654 | "type": "library", 655 | "extra": { 656 | "branch-alias": { 657 | "dev-master": "1.7-dev" 658 | } 659 | }, 660 | "autoload": { 661 | "psr-4": { 662 | "Http\\Client\\Common\\": "src/" 663 | } 664 | }, 665 | "notification-url": "https://packagist.org/downloads/", 666 | "license": [ 667 | "MIT" 668 | ], 669 | "authors": [ 670 | { 671 | "name": "Márk Sági-Kazár", 672 | "email": "mark.sagikazar@gmail.com" 673 | } 674 | ], 675 | "description": "Common HTTP Client implementations and tools for HTTPlug", 676 | "homepage": "http://httplug.io", 677 | "keywords": [ 678 | "client", 679 | "common", 680 | "http", 681 | "httplug" 682 | ], 683 | "time": "2017-11-30T11:06:59+00:00" 684 | }, 685 | { 686 | "name": "php-http/discovery", 687 | "version": "1.4.0", 688 | "source": { 689 | "type": "git", 690 | "url": "https://github.com/php-http/discovery.git", 691 | "reference": "9a6cb24de552bfe1aa9d7d1569e2d49c5b169a33" 692 | }, 693 | "dist": { 694 | "type": "zip", 695 | "url": "https://api.github.com/repos/php-http/discovery/zipball/9a6cb24de552bfe1aa9d7d1569e2d49c5b169a33", 696 | "reference": "9a6cb24de552bfe1aa9d7d1569e2d49c5b169a33", 697 | "shasum": "" 698 | }, 699 | "require": { 700 | "php": "^5.5 || ^7.0" 701 | }, 702 | "require-dev": { 703 | "henrikbjorn/phpspec-code-coverage": "^2.0.2", 704 | "php-http/httplug": "^1.0", 705 | "php-http/message-factory": "^1.0", 706 | "phpspec/phpspec": "^2.4", 707 | "puli/composer-plugin": "1.0.0-beta10" 708 | }, 709 | "suggest": { 710 | "php-http/message": "Allow to use Guzzle, Diactoros or Slim Framework factories", 711 | "puli/composer-plugin": "Sets up Puli which is recommended for Discovery to work. Check http://docs.php-http.org/en/latest/discovery.html for more details." 712 | }, 713 | "type": "library", 714 | "extra": { 715 | "branch-alias": { 716 | "dev-master": "1.3-dev" 717 | } 718 | }, 719 | "autoload": { 720 | "psr-4": { 721 | "Http\\Discovery\\": "src/" 722 | } 723 | }, 724 | "notification-url": "https://packagist.org/downloads/", 725 | "license": [ 726 | "MIT" 727 | ], 728 | "authors": [ 729 | { 730 | "name": "Márk Sági-Kazár", 731 | "email": "mark.sagikazar@gmail.com" 732 | } 733 | ], 734 | "description": "Finds installed HTTPlug implementations and PSR-7 message factories", 735 | "homepage": "http://php-http.org", 736 | "keywords": [ 737 | "adapter", 738 | "client", 739 | "discovery", 740 | "factory", 741 | "http", 742 | "message", 743 | "psr7" 744 | ], 745 | "time": "2018-02-06T10:55:24+00:00" 746 | }, 747 | { 748 | "name": "php-http/message", 749 | "version": "1.6.0", 750 | "source": { 751 | "type": "git", 752 | "url": "https://github.com/php-http/message.git", 753 | "reference": "2edd63bae5f52f79363c5f18904b05ce3a4b7253" 754 | }, 755 | "dist": { 756 | "type": "zip", 757 | "url": "https://api.github.com/repos/php-http/message/zipball/2edd63bae5f52f79363c5f18904b05ce3a4b7253", 758 | "reference": "2edd63bae5f52f79363c5f18904b05ce3a4b7253", 759 | "shasum": "" 760 | }, 761 | "require": { 762 | "clue/stream-filter": "^1.3", 763 | "php": ">=5.4", 764 | "php-http/message-factory": "^1.0.2", 765 | "psr/http-message": "^1.0" 766 | }, 767 | "provide": { 768 | "php-http/message-factory-implementation": "1.0" 769 | }, 770 | "require-dev": { 771 | "akeneo/phpspec-skip-example-extension": "^1.0", 772 | "coduo/phpspec-data-provider-extension": "^1.0", 773 | "ext-zlib": "*", 774 | "guzzlehttp/psr7": "^1.0", 775 | "henrikbjorn/phpspec-code-coverage": "^1.0", 776 | "phpspec/phpspec": "^2.4", 777 | "slim/slim": "^3.0", 778 | "zendframework/zend-diactoros": "^1.0" 779 | }, 780 | "suggest": { 781 | "ext-zlib": "Used with compressor/decompressor streams", 782 | "guzzlehttp/psr7": "Used with Guzzle PSR-7 Factories", 783 | "slim/slim": "Used with Slim Framework PSR-7 implementation", 784 | "zendframework/zend-diactoros": "Used with Diactoros Factories" 785 | }, 786 | "type": "library", 787 | "extra": { 788 | "branch-alias": { 789 | "dev-master": "1.6-dev" 790 | } 791 | }, 792 | "autoload": { 793 | "psr-4": { 794 | "Http\\Message\\": "src/" 795 | }, 796 | "files": [ 797 | "src/filters.php" 798 | ] 799 | }, 800 | "notification-url": "https://packagist.org/downloads/", 801 | "license": [ 802 | "MIT" 803 | ], 804 | "authors": [ 805 | { 806 | "name": "Márk Sági-Kazár", 807 | "email": "mark.sagikazar@gmail.com" 808 | } 809 | ], 810 | "description": "HTTP Message related tools", 811 | "homepage": "http://php-http.org", 812 | "keywords": [ 813 | "http", 814 | "message", 815 | "psr-7" 816 | ], 817 | "time": "2017-07-05T06:40:53+00:00" 818 | }, 819 | { 820 | "name": "php-http/message-factory", 821 | "version": "v1.0.2", 822 | "source": { 823 | "type": "git", 824 | "url": "https://github.com/php-http/message-factory.git", 825 | "reference": "a478cb11f66a6ac48d8954216cfed9aa06a501a1" 826 | }, 827 | "dist": { 828 | "type": "zip", 829 | "url": "https://api.github.com/repos/php-http/message-factory/zipball/a478cb11f66a6ac48d8954216cfed9aa06a501a1", 830 | "reference": "a478cb11f66a6ac48d8954216cfed9aa06a501a1", 831 | "shasum": "" 832 | }, 833 | "require": { 834 | "php": ">=5.4", 835 | "psr/http-message": "^1.0" 836 | }, 837 | "type": "library", 838 | "extra": { 839 | "branch-alias": { 840 | "dev-master": "1.0-dev" 841 | } 842 | }, 843 | "autoload": { 844 | "psr-4": { 845 | "Http\\Message\\": "src/" 846 | } 847 | }, 848 | "notification-url": "https://packagist.org/downloads/", 849 | "license": [ 850 | "MIT" 851 | ], 852 | "authors": [ 853 | { 854 | "name": "Márk Sági-Kazár", 855 | "email": "mark.sagikazar@gmail.com" 856 | } 857 | ], 858 | "description": "Factory interfaces for PSR-7 HTTP Message", 859 | "homepage": "http://php-http.org", 860 | "keywords": [ 861 | "factory", 862 | "http", 863 | "message", 864 | "stream", 865 | "uri" 866 | ], 867 | "time": "2015-12-19T14:08:53+00:00" 868 | }, 869 | { 870 | "name": "php-http/mock-client", 871 | "version": "1.1.0", 872 | "source": { 873 | "type": "git", 874 | "url": "https://github.com/php-http/mock-client.git", 875 | "reference": "28195af1ba69590c9c4a02fab7b2eb1fb0200021" 876 | }, 877 | "dist": { 878 | "type": "zip", 879 | "url": "https://api.github.com/repos/php-http/mock-client/zipball/28195af1ba69590c9c4a02fab7b2eb1fb0200021", 880 | "reference": "28195af1ba69590c9c4a02fab7b2eb1fb0200021", 881 | "shasum": "" 882 | }, 883 | "require": { 884 | "php": "^5.5 || ^7.0", 885 | "php-http/client-common": "^1.1", 886 | "php-http/discovery": "^1.0", 887 | "php-http/httplug": "^1.0", 888 | "php-http/message-factory": "^1.0" 889 | }, 890 | "provide": { 891 | "php-http/async-client-implementation": "1.0", 892 | "php-http/client-implementation": "1.0" 893 | }, 894 | "require-dev": { 895 | "henrikbjorn/phpspec-code-coverage": "^1.0", 896 | "phpspec/phpspec": "^2.4" 897 | }, 898 | "type": "library", 899 | "extra": { 900 | "branch-alias": { 901 | "dev-master": "1.1-dev" 902 | } 903 | }, 904 | "autoload": { 905 | "psr-4": { 906 | "Http\\Mock\\": "src/" 907 | } 908 | }, 909 | "notification-url": "https://packagist.org/downloads/", 910 | "license": [ 911 | "MIT" 912 | ], 913 | "authors": [ 914 | { 915 | "name": "David de Boer", 916 | "email": "david@ddeboer.nl" 917 | } 918 | ], 919 | "description": "Mock HTTP client", 920 | "homepage": "http://httplug.io", 921 | "keywords": [ 922 | "client", 923 | "http", 924 | "mock", 925 | "psr7" 926 | ], 927 | "time": "2018-01-08T07:39:39+00:00" 928 | }, 929 | { 930 | "name": "phpdocumentor/reflection-common", 931 | "version": "1.0.1", 932 | "source": { 933 | "type": "git", 934 | "url": "https://github.com/phpDocumentor/ReflectionCommon.git", 935 | "reference": "21bdeb5f65d7ebf9f43b1b25d404f87deab5bfb6" 936 | }, 937 | "dist": { 938 | "type": "zip", 939 | "url": "https://api.github.com/repos/phpDocumentor/ReflectionCommon/zipball/21bdeb5f65d7ebf9f43b1b25d404f87deab5bfb6", 940 | "reference": "21bdeb5f65d7ebf9f43b1b25d404f87deab5bfb6", 941 | "shasum": "" 942 | }, 943 | "require": { 944 | "php": ">=5.5" 945 | }, 946 | "require-dev": { 947 | "phpunit/phpunit": "^4.6" 948 | }, 949 | "type": "library", 950 | "extra": { 951 | "branch-alias": { 952 | "dev-master": "1.0.x-dev" 953 | } 954 | }, 955 | "autoload": { 956 | "psr-4": { 957 | "phpDocumentor\\Reflection\\": [ 958 | "src" 959 | ] 960 | } 961 | }, 962 | "notification-url": "https://packagist.org/downloads/", 963 | "license": [ 964 | "MIT" 965 | ], 966 | "authors": [ 967 | { 968 | "name": "Jaap van Otterdijk", 969 | "email": "opensource@ijaap.nl" 970 | } 971 | ], 972 | "description": "Common reflection classes used by phpdocumentor to reflect the code structure", 973 | "homepage": "http://www.phpdoc.org", 974 | "keywords": [ 975 | "FQSEN", 976 | "phpDocumentor", 977 | "phpdoc", 978 | "reflection", 979 | "static analysis" 980 | ], 981 | "time": "2017-09-11T18:02:19+00:00" 982 | }, 983 | { 984 | "name": "phpdocumentor/reflection-docblock", 985 | "version": "3.2.2", 986 | "source": { 987 | "type": "git", 988 | "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", 989 | "reference": "4aada1f93c72c35e22fb1383b47fee43b8f1d157" 990 | }, 991 | "dist": { 992 | "type": "zip", 993 | "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/4aada1f93c72c35e22fb1383b47fee43b8f1d157", 994 | "reference": "4aada1f93c72c35e22fb1383b47fee43b8f1d157", 995 | "shasum": "" 996 | }, 997 | "require": { 998 | "php": ">=5.5", 999 | "phpdocumentor/reflection-common": "^1.0@dev", 1000 | "phpdocumentor/type-resolver": "^0.3.0", 1001 | "webmozart/assert": "^1.0" 1002 | }, 1003 | "require-dev": { 1004 | "mockery/mockery": "^0.9.4", 1005 | "phpunit/phpunit": "^4.4" 1006 | }, 1007 | "type": "library", 1008 | "autoload": { 1009 | "psr-4": { 1010 | "phpDocumentor\\Reflection\\": [ 1011 | "src/" 1012 | ] 1013 | } 1014 | }, 1015 | "notification-url": "https://packagist.org/downloads/", 1016 | "license": [ 1017 | "MIT" 1018 | ], 1019 | "authors": [ 1020 | { 1021 | "name": "Mike van Riel", 1022 | "email": "me@mikevanriel.com" 1023 | } 1024 | ], 1025 | "description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.", 1026 | "time": "2017-08-08T06:39:58+00:00" 1027 | }, 1028 | { 1029 | "name": "phpdocumentor/type-resolver", 1030 | "version": "0.3.0", 1031 | "source": { 1032 | "type": "git", 1033 | "url": "https://github.com/phpDocumentor/TypeResolver.git", 1034 | "reference": "fb3933512008d8162b3cdf9e18dba9309b7c3773" 1035 | }, 1036 | "dist": { 1037 | "type": "zip", 1038 | "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/fb3933512008d8162b3cdf9e18dba9309b7c3773", 1039 | "reference": "fb3933512008d8162b3cdf9e18dba9309b7c3773", 1040 | "shasum": "" 1041 | }, 1042 | "require": { 1043 | "php": "^5.5 || ^7.0", 1044 | "phpdocumentor/reflection-common": "^1.0" 1045 | }, 1046 | "require-dev": { 1047 | "mockery/mockery": "^0.9.4", 1048 | "phpunit/phpunit": "^5.2||^4.8.24" 1049 | }, 1050 | "type": "library", 1051 | "extra": { 1052 | "branch-alias": { 1053 | "dev-master": "1.0.x-dev" 1054 | } 1055 | }, 1056 | "autoload": { 1057 | "psr-4": { 1058 | "phpDocumentor\\Reflection\\": [ 1059 | "src/" 1060 | ] 1061 | } 1062 | }, 1063 | "notification-url": "https://packagist.org/downloads/", 1064 | "license": [ 1065 | "MIT" 1066 | ], 1067 | "authors": [ 1068 | { 1069 | "name": "Mike van Riel", 1070 | "email": "me@mikevanriel.com" 1071 | } 1072 | ], 1073 | "time": "2017-06-03T08:32:36+00:00" 1074 | }, 1075 | { 1076 | "name": "phpspec/prophecy", 1077 | "version": "1.7.6", 1078 | "source": { 1079 | "type": "git", 1080 | "url": "https://github.com/phpspec/prophecy.git", 1081 | "reference": "33a7e3c4fda54e912ff6338c48823bd5c0f0b712" 1082 | }, 1083 | "dist": { 1084 | "type": "zip", 1085 | "url": "https://api.github.com/repos/phpspec/prophecy/zipball/33a7e3c4fda54e912ff6338c48823bd5c0f0b712", 1086 | "reference": "33a7e3c4fda54e912ff6338c48823bd5c0f0b712", 1087 | "shasum": "" 1088 | }, 1089 | "require": { 1090 | "doctrine/instantiator": "^1.0.2", 1091 | "php": "^5.3|^7.0", 1092 | "phpdocumentor/reflection-docblock": "^2.0|^3.0.2|^4.0", 1093 | "sebastian/comparator": "^1.1|^2.0|^3.0", 1094 | "sebastian/recursion-context": "^1.0|^2.0|^3.0" 1095 | }, 1096 | "require-dev": { 1097 | "phpspec/phpspec": "^2.5|^3.2", 1098 | "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.5" 1099 | }, 1100 | "type": "library", 1101 | "extra": { 1102 | "branch-alias": { 1103 | "dev-master": "1.7.x-dev" 1104 | } 1105 | }, 1106 | "autoload": { 1107 | "psr-0": { 1108 | "Prophecy\\": "src/" 1109 | } 1110 | }, 1111 | "notification-url": "https://packagist.org/downloads/", 1112 | "license": [ 1113 | "MIT" 1114 | ], 1115 | "authors": [ 1116 | { 1117 | "name": "Konstantin Kudryashov", 1118 | "email": "ever.zet@gmail.com", 1119 | "homepage": "http://everzet.com" 1120 | }, 1121 | { 1122 | "name": "Marcello Duarte", 1123 | "email": "marcello.duarte@gmail.com" 1124 | } 1125 | ], 1126 | "description": "Highly opinionated mocking framework for PHP 5.3+", 1127 | "homepage": "https://github.com/phpspec/prophecy", 1128 | "keywords": [ 1129 | "Double", 1130 | "Dummy", 1131 | "fake", 1132 | "mock", 1133 | "spy", 1134 | "stub" 1135 | ], 1136 | "time": "2018-04-18T13:57:24+00:00" 1137 | }, 1138 | { 1139 | "name": "phpunit/php-code-coverage", 1140 | "version": "2.2.4", 1141 | "source": { 1142 | "type": "git", 1143 | "url": "https://github.com/sebastianbergmann/php-code-coverage.git", 1144 | "reference": "eabf68b476ac7d0f73793aada060f1c1a9bf8979" 1145 | }, 1146 | "dist": { 1147 | "type": "zip", 1148 | "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/eabf68b476ac7d0f73793aada060f1c1a9bf8979", 1149 | "reference": "eabf68b476ac7d0f73793aada060f1c1a9bf8979", 1150 | "shasum": "" 1151 | }, 1152 | "require": { 1153 | "php": ">=5.3.3", 1154 | "phpunit/php-file-iterator": "~1.3", 1155 | "phpunit/php-text-template": "~1.2", 1156 | "phpunit/php-token-stream": "~1.3", 1157 | "sebastian/environment": "^1.3.2", 1158 | "sebastian/version": "~1.0" 1159 | }, 1160 | "require-dev": { 1161 | "ext-xdebug": ">=2.1.4", 1162 | "phpunit/phpunit": "~4" 1163 | }, 1164 | "suggest": { 1165 | "ext-dom": "*", 1166 | "ext-xdebug": ">=2.2.1", 1167 | "ext-xmlwriter": "*" 1168 | }, 1169 | "type": "library", 1170 | "extra": { 1171 | "branch-alias": { 1172 | "dev-master": "2.2.x-dev" 1173 | } 1174 | }, 1175 | "autoload": { 1176 | "classmap": [ 1177 | "src/" 1178 | ] 1179 | }, 1180 | "notification-url": "https://packagist.org/downloads/", 1181 | "license": [ 1182 | "BSD-3-Clause" 1183 | ], 1184 | "authors": [ 1185 | { 1186 | "name": "Sebastian Bergmann", 1187 | "email": "sb@sebastian-bergmann.de", 1188 | "role": "lead" 1189 | } 1190 | ], 1191 | "description": "Library that provides collection, processing, and rendering functionality for PHP code coverage information.", 1192 | "homepage": "https://github.com/sebastianbergmann/php-code-coverage", 1193 | "keywords": [ 1194 | "coverage", 1195 | "testing", 1196 | "xunit" 1197 | ], 1198 | "time": "2015-10-06T15:47:00+00:00" 1199 | }, 1200 | { 1201 | "name": "phpunit/php-file-iterator", 1202 | "version": "1.4.5", 1203 | "source": { 1204 | "type": "git", 1205 | "url": "https://github.com/sebastianbergmann/php-file-iterator.git", 1206 | "reference": "730b01bc3e867237eaac355e06a36b85dd93a8b4" 1207 | }, 1208 | "dist": { 1209 | "type": "zip", 1210 | "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/730b01bc3e867237eaac355e06a36b85dd93a8b4", 1211 | "reference": "730b01bc3e867237eaac355e06a36b85dd93a8b4", 1212 | "shasum": "" 1213 | }, 1214 | "require": { 1215 | "php": ">=5.3.3" 1216 | }, 1217 | "type": "library", 1218 | "extra": { 1219 | "branch-alias": { 1220 | "dev-master": "1.4.x-dev" 1221 | } 1222 | }, 1223 | "autoload": { 1224 | "classmap": [ 1225 | "src/" 1226 | ] 1227 | }, 1228 | "notification-url": "https://packagist.org/downloads/", 1229 | "license": [ 1230 | "BSD-3-Clause" 1231 | ], 1232 | "authors": [ 1233 | { 1234 | "name": "Sebastian Bergmann", 1235 | "email": "sb@sebastian-bergmann.de", 1236 | "role": "lead" 1237 | } 1238 | ], 1239 | "description": "FilterIterator implementation that filters files based on a list of suffixes.", 1240 | "homepage": "https://github.com/sebastianbergmann/php-file-iterator/", 1241 | "keywords": [ 1242 | "filesystem", 1243 | "iterator" 1244 | ], 1245 | "time": "2017-11-27T13:52:08+00:00" 1246 | }, 1247 | { 1248 | "name": "phpunit/php-text-template", 1249 | "version": "1.2.1", 1250 | "source": { 1251 | "type": "git", 1252 | "url": "https://github.com/sebastianbergmann/php-text-template.git", 1253 | "reference": "31f8b717e51d9a2afca6c9f046f5d69fc27c8686" 1254 | }, 1255 | "dist": { 1256 | "type": "zip", 1257 | "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/31f8b717e51d9a2afca6c9f046f5d69fc27c8686", 1258 | "reference": "31f8b717e51d9a2afca6c9f046f5d69fc27c8686", 1259 | "shasum": "" 1260 | }, 1261 | "require": { 1262 | "php": ">=5.3.3" 1263 | }, 1264 | "type": "library", 1265 | "autoload": { 1266 | "classmap": [ 1267 | "src/" 1268 | ] 1269 | }, 1270 | "notification-url": "https://packagist.org/downloads/", 1271 | "license": [ 1272 | "BSD-3-Clause" 1273 | ], 1274 | "authors": [ 1275 | { 1276 | "name": "Sebastian Bergmann", 1277 | "email": "sebastian@phpunit.de", 1278 | "role": "lead" 1279 | } 1280 | ], 1281 | "description": "Simple template engine.", 1282 | "homepage": "https://github.com/sebastianbergmann/php-text-template/", 1283 | "keywords": [ 1284 | "template" 1285 | ], 1286 | "time": "2015-06-21T13:50:34+00:00" 1287 | }, 1288 | { 1289 | "name": "phpunit/php-timer", 1290 | "version": "1.0.9", 1291 | "source": { 1292 | "type": "git", 1293 | "url": "https://github.com/sebastianbergmann/php-timer.git", 1294 | "reference": "3dcf38ca72b158baf0bc245e9184d3fdffa9c46f" 1295 | }, 1296 | "dist": { 1297 | "type": "zip", 1298 | "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/3dcf38ca72b158baf0bc245e9184d3fdffa9c46f", 1299 | "reference": "3dcf38ca72b158baf0bc245e9184d3fdffa9c46f", 1300 | "shasum": "" 1301 | }, 1302 | "require": { 1303 | "php": "^5.3.3 || ^7.0" 1304 | }, 1305 | "require-dev": { 1306 | "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.0" 1307 | }, 1308 | "type": "library", 1309 | "extra": { 1310 | "branch-alias": { 1311 | "dev-master": "1.0-dev" 1312 | } 1313 | }, 1314 | "autoload": { 1315 | "classmap": [ 1316 | "src/" 1317 | ] 1318 | }, 1319 | "notification-url": "https://packagist.org/downloads/", 1320 | "license": [ 1321 | "BSD-3-Clause" 1322 | ], 1323 | "authors": [ 1324 | { 1325 | "name": "Sebastian Bergmann", 1326 | "email": "sb@sebastian-bergmann.de", 1327 | "role": "lead" 1328 | } 1329 | ], 1330 | "description": "Utility class for timing", 1331 | "homepage": "https://github.com/sebastianbergmann/php-timer/", 1332 | "keywords": [ 1333 | "timer" 1334 | ], 1335 | "time": "2017-02-26T11:10:40+00:00" 1336 | }, 1337 | { 1338 | "name": "phpunit/php-token-stream", 1339 | "version": "1.4.12", 1340 | "source": { 1341 | "type": "git", 1342 | "url": "https://github.com/sebastianbergmann/php-token-stream.git", 1343 | "reference": "1ce90ba27c42e4e44e6d8458241466380b51fa16" 1344 | }, 1345 | "dist": { 1346 | "type": "zip", 1347 | "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/1ce90ba27c42e4e44e6d8458241466380b51fa16", 1348 | "reference": "1ce90ba27c42e4e44e6d8458241466380b51fa16", 1349 | "shasum": "" 1350 | }, 1351 | "require": { 1352 | "ext-tokenizer": "*", 1353 | "php": ">=5.3.3" 1354 | }, 1355 | "require-dev": { 1356 | "phpunit/phpunit": "~4.2" 1357 | }, 1358 | "type": "library", 1359 | "extra": { 1360 | "branch-alias": { 1361 | "dev-master": "1.4-dev" 1362 | } 1363 | }, 1364 | "autoload": { 1365 | "classmap": [ 1366 | "src/" 1367 | ] 1368 | }, 1369 | "notification-url": "https://packagist.org/downloads/", 1370 | "license": [ 1371 | "BSD-3-Clause" 1372 | ], 1373 | "authors": [ 1374 | { 1375 | "name": "Sebastian Bergmann", 1376 | "email": "sebastian@phpunit.de" 1377 | } 1378 | ], 1379 | "description": "Wrapper around PHP's tokenizer extension.", 1380 | "homepage": "https://github.com/sebastianbergmann/php-token-stream/", 1381 | "keywords": [ 1382 | "tokenizer" 1383 | ], 1384 | "time": "2017-12-04T08:55:13+00:00" 1385 | }, 1386 | { 1387 | "name": "phpunit/phpunit", 1388 | "version": "4.8.36", 1389 | "source": { 1390 | "type": "git", 1391 | "url": "https://github.com/sebastianbergmann/phpunit.git", 1392 | "reference": "46023de9a91eec7dfb06cc56cb4e260017298517" 1393 | }, 1394 | "dist": { 1395 | "type": "zip", 1396 | "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/46023de9a91eec7dfb06cc56cb4e260017298517", 1397 | "reference": "46023de9a91eec7dfb06cc56cb4e260017298517", 1398 | "shasum": "" 1399 | }, 1400 | "require": { 1401 | "ext-dom": "*", 1402 | "ext-json": "*", 1403 | "ext-pcre": "*", 1404 | "ext-reflection": "*", 1405 | "ext-spl": "*", 1406 | "php": ">=5.3.3", 1407 | "phpspec/prophecy": "^1.3.1", 1408 | "phpunit/php-code-coverage": "~2.1", 1409 | "phpunit/php-file-iterator": "~1.4", 1410 | "phpunit/php-text-template": "~1.2", 1411 | "phpunit/php-timer": "^1.0.6", 1412 | "phpunit/phpunit-mock-objects": "~2.3", 1413 | "sebastian/comparator": "~1.2.2", 1414 | "sebastian/diff": "~1.2", 1415 | "sebastian/environment": "~1.3", 1416 | "sebastian/exporter": "~1.2", 1417 | "sebastian/global-state": "~1.0", 1418 | "sebastian/version": "~1.0", 1419 | "symfony/yaml": "~2.1|~3.0" 1420 | }, 1421 | "suggest": { 1422 | "phpunit/php-invoker": "~1.1" 1423 | }, 1424 | "bin": [ 1425 | "phpunit" 1426 | ], 1427 | "type": "library", 1428 | "extra": { 1429 | "branch-alias": { 1430 | "dev-master": "4.8.x-dev" 1431 | } 1432 | }, 1433 | "autoload": { 1434 | "classmap": [ 1435 | "src/" 1436 | ] 1437 | }, 1438 | "notification-url": "https://packagist.org/downloads/", 1439 | "license": [ 1440 | "BSD-3-Clause" 1441 | ], 1442 | "authors": [ 1443 | { 1444 | "name": "Sebastian Bergmann", 1445 | "email": "sebastian@phpunit.de", 1446 | "role": "lead" 1447 | } 1448 | ], 1449 | "description": "The PHP Unit Testing framework.", 1450 | "homepage": "https://phpunit.de/", 1451 | "keywords": [ 1452 | "phpunit", 1453 | "testing", 1454 | "xunit" 1455 | ], 1456 | "time": "2017-06-21T08:07:12+00:00" 1457 | }, 1458 | { 1459 | "name": "phpunit/phpunit-mock-objects", 1460 | "version": "2.3.8", 1461 | "source": { 1462 | "type": "git", 1463 | "url": "https://github.com/sebastianbergmann/phpunit-mock-objects.git", 1464 | "reference": "ac8e7a3db35738d56ee9a76e78a4e03d97628983" 1465 | }, 1466 | "dist": { 1467 | "type": "zip", 1468 | "url": "https://api.github.com/repos/sebastianbergmann/phpunit-mock-objects/zipball/ac8e7a3db35738d56ee9a76e78a4e03d97628983", 1469 | "reference": "ac8e7a3db35738d56ee9a76e78a4e03d97628983", 1470 | "shasum": "" 1471 | }, 1472 | "require": { 1473 | "doctrine/instantiator": "^1.0.2", 1474 | "php": ">=5.3.3", 1475 | "phpunit/php-text-template": "~1.2", 1476 | "sebastian/exporter": "~1.2" 1477 | }, 1478 | "require-dev": { 1479 | "phpunit/phpunit": "~4.4" 1480 | }, 1481 | "suggest": { 1482 | "ext-soap": "*" 1483 | }, 1484 | "type": "library", 1485 | "extra": { 1486 | "branch-alias": { 1487 | "dev-master": "2.3.x-dev" 1488 | } 1489 | }, 1490 | "autoload": { 1491 | "classmap": [ 1492 | "src/" 1493 | ] 1494 | }, 1495 | "notification-url": "https://packagist.org/downloads/", 1496 | "license": [ 1497 | "BSD-3-Clause" 1498 | ], 1499 | "authors": [ 1500 | { 1501 | "name": "Sebastian Bergmann", 1502 | "email": "sb@sebastian-bergmann.de", 1503 | "role": "lead" 1504 | } 1505 | ], 1506 | "description": "Mock Object library for PHPUnit", 1507 | "homepage": "https://github.com/sebastianbergmann/phpunit-mock-objects/", 1508 | "keywords": [ 1509 | "mock", 1510 | "xunit" 1511 | ], 1512 | "time": "2015-10-02T06:51:40+00:00" 1513 | }, 1514 | { 1515 | "name": "sebastian/comparator", 1516 | "version": "1.2.4", 1517 | "source": { 1518 | "type": "git", 1519 | "url": "https://github.com/sebastianbergmann/comparator.git", 1520 | "reference": "2b7424b55f5047b47ac6e5ccb20b2aea4011d9be" 1521 | }, 1522 | "dist": { 1523 | "type": "zip", 1524 | "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/2b7424b55f5047b47ac6e5ccb20b2aea4011d9be", 1525 | "reference": "2b7424b55f5047b47ac6e5ccb20b2aea4011d9be", 1526 | "shasum": "" 1527 | }, 1528 | "require": { 1529 | "php": ">=5.3.3", 1530 | "sebastian/diff": "~1.2", 1531 | "sebastian/exporter": "~1.2 || ~2.0" 1532 | }, 1533 | "require-dev": { 1534 | "phpunit/phpunit": "~4.4" 1535 | }, 1536 | "type": "library", 1537 | "extra": { 1538 | "branch-alias": { 1539 | "dev-master": "1.2.x-dev" 1540 | } 1541 | }, 1542 | "autoload": { 1543 | "classmap": [ 1544 | "src/" 1545 | ] 1546 | }, 1547 | "notification-url": "https://packagist.org/downloads/", 1548 | "license": [ 1549 | "BSD-3-Clause" 1550 | ], 1551 | "authors": [ 1552 | { 1553 | "name": "Jeff Welch", 1554 | "email": "whatthejeff@gmail.com" 1555 | }, 1556 | { 1557 | "name": "Volker Dusch", 1558 | "email": "github@wallbash.com" 1559 | }, 1560 | { 1561 | "name": "Bernhard Schussek", 1562 | "email": "bschussek@2bepublished.at" 1563 | }, 1564 | { 1565 | "name": "Sebastian Bergmann", 1566 | "email": "sebastian@phpunit.de" 1567 | } 1568 | ], 1569 | "description": "Provides the functionality to compare PHP values for equality", 1570 | "homepage": "http://www.github.com/sebastianbergmann/comparator", 1571 | "keywords": [ 1572 | "comparator", 1573 | "compare", 1574 | "equality" 1575 | ], 1576 | "time": "2017-01-29T09:50:25+00:00" 1577 | }, 1578 | { 1579 | "name": "sebastian/diff", 1580 | "version": "1.4.3", 1581 | "source": { 1582 | "type": "git", 1583 | "url": "https://github.com/sebastianbergmann/diff.git", 1584 | "reference": "7f066a26a962dbe58ddea9f72a4e82874a3975a4" 1585 | }, 1586 | "dist": { 1587 | "type": "zip", 1588 | "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/7f066a26a962dbe58ddea9f72a4e82874a3975a4", 1589 | "reference": "7f066a26a962dbe58ddea9f72a4e82874a3975a4", 1590 | "shasum": "" 1591 | }, 1592 | "require": { 1593 | "php": "^5.3.3 || ^7.0" 1594 | }, 1595 | "require-dev": { 1596 | "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.0" 1597 | }, 1598 | "type": "library", 1599 | "extra": { 1600 | "branch-alias": { 1601 | "dev-master": "1.4-dev" 1602 | } 1603 | }, 1604 | "autoload": { 1605 | "classmap": [ 1606 | "src/" 1607 | ] 1608 | }, 1609 | "notification-url": "https://packagist.org/downloads/", 1610 | "license": [ 1611 | "BSD-3-Clause" 1612 | ], 1613 | "authors": [ 1614 | { 1615 | "name": "Kore Nordmann", 1616 | "email": "mail@kore-nordmann.de" 1617 | }, 1618 | { 1619 | "name": "Sebastian Bergmann", 1620 | "email": "sebastian@phpunit.de" 1621 | } 1622 | ], 1623 | "description": "Diff implementation", 1624 | "homepage": "https://github.com/sebastianbergmann/diff", 1625 | "keywords": [ 1626 | "diff" 1627 | ], 1628 | "time": "2017-05-22T07:24:03+00:00" 1629 | }, 1630 | { 1631 | "name": "sebastian/environment", 1632 | "version": "1.3.8", 1633 | "source": { 1634 | "type": "git", 1635 | "url": "https://github.com/sebastianbergmann/environment.git", 1636 | "reference": "be2c607e43ce4c89ecd60e75c6a85c126e754aea" 1637 | }, 1638 | "dist": { 1639 | "type": "zip", 1640 | "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/be2c607e43ce4c89ecd60e75c6a85c126e754aea", 1641 | "reference": "be2c607e43ce4c89ecd60e75c6a85c126e754aea", 1642 | "shasum": "" 1643 | }, 1644 | "require": { 1645 | "php": "^5.3.3 || ^7.0" 1646 | }, 1647 | "require-dev": { 1648 | "phpunit/phpunit": "^4.8 || ^5.0" 1649 | }, 1650 | "type": "library", 1651 | "extra": { 1652 | "branch-alias": { 1653 | "dev-master": "1.3.x-dev" 1654 | } 1655 | }, 1656 | "autoload": { 1657 | "classmap": [ 1658 | "src/" 1659 | ] 1660 | }, 1661 | "notification-url": "https://packagist.org/downloads/", 1662 | "license": [ 1663 | "BSD-3-Clause" 1664 | ], 1665 | "authors": [ 1666 | { 1667 | "name": "Sebastian Bergmann", 1668 | "email": "sebastian@phpunit.de" 1669 | } 1670 | ], 1671 | "description": "Provides functionality to handle HHVM/PHP environments", 1672 | "homepage": "http://www.github.com/sebastianbergmann/environment", 1673 | "keywords": [ 1674 | "Xdebug", 1675 | "environment", 1676 | "hhvm" 1677 | ], 1678 | "time": "2016-08-18T05:49:44+00:00" 1679 | }, 1680 | { 1681 | "name": "sebastian/exporter", 1682 | "version": "1.2.2", 1683 | "source": { 1684 | "type": "git", 1685 | "url": "https://github.com/sebastianbergmann/exporter.git", 1686 | "reference": "42c4c2eec485ee3e159ec9884f95b431287edde4" 1687 | }, 1688 | "dist": { 1689 | "type": "zip", 1690 | "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/42c4c2eec485ee3e159ec9884f95b431287edde4", 1691 | "reference": "42c4c2eec485ee3e159ec9884f95b431287edde4", 1692 | "shasum": "" 1693 | }, 1694 | "require": { 1695 | "php": ">=5.3.3", 1696 | "sebastian/recursion-context": "~1.0" 1697 | }, 1698 | "require-dev": { 1699 | "ext-mbstring": "*", 1700 | "phpunit/phpunit": "~4.4" 1701 | }, 1702 | "type": "library", 1703 | "extra": { 1704 | "branch-alias": { 1705 | "dev-master": "1.3.x-dev" 1706 | } 1707 | }, 1708 | "autoload": { 1709 | "classmap": [ 1710 | "src/" 1711 | ] 1712 | }, 1713 | "notification-url": "https://packagist.org/downloads/", 1714 | "license": [ 1715 | "BSD-3-Clause" 1716 | ], 1717 | "authors": [ 1718 | { 1719 | "name": "Jeff Welch", 1720 | "email": "whatthejeff@gmail.com" 1721 | }, 1722 | { 1723 | "name": "Volker Dusch", 1724 | "email": "github@wallbash.com" 1725 | }, 1726 | { 1727 | "name": "Bernhard Schussek", 1728 | "email": "bschussek@2bepublished.at" 1729 | }, 1730 | { 1731 | "name": "Sebastian Bergmann", 1732 | "email": "sebastian@phpunit.de" 1733 | }, 1734 | { 1735 | "name": "Adam Harvey", 1736 | "email": "aharvey@php.net" 1737 | } 1738 | ], 1739 | "description": "Provides the functionality to export PHP variables for visualization", 1740 | "homepage": "http://www.github.com/sebastianbergmann/exporter", 1741 | "keywords": [ 1742 | "export", 1743 | "exporter" 1744 | ], 1745 | "time": "2016-06-17T09:04:28+00:00" 1746 | }, 1747 | { 1748 | "name": "sebastian/global-state", 1749 | "version": "1.1.1", 1750 | "source": { 1751 | "type": "git", 1752 | "url": "https://github.com/sebastianbergmann/global-state.git", 1753 | "reference": "bc37d50fea7d017d3d340f230811c9f1d7280af4" 1754 | }, 1755 | "dist": { 1756 | "type": "zip", 1757 | "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/bc37d50fea7d017d3d340f230811c9f1d7280af4", 1758 | "reference": "bc37d50fea7d017d3d340f230811c9f1d7280af4", 1759 | "shasum": "" 1760 | }, 1761 | "require": { 1762 | "php": ">=5.3.3" 1763 | }, 1764 | "require-dev": { 1765 | "phpunit/phpunit": "~4.2" 1766 | }, 1767 | "suggest": { 1768 | "ext-uopz": "*" 1769 | }, 1770 | "type": "library", 1771 | "extra": { 1772 | "branch-alias": { 1773 | "dev-master": "1.0-dev" 1774 | } 1775 | }, 1776 | "autoload": { 1777 | "classmap": [ 1778 | "src/" 1779 | ] 1780 | }, 1781 | "notification-url": "https://packagist.org/downloads/", 1782 | "license": [ 1783 | "BSD-3-Clause" 1784 | ], 1785 | "authors": [ 1786 | { 1787 | "name": "Sebastian Bergmann", 1788 | "email": "sebastian@phpunit.de" 1789 | } 1790 | ], 1791 | "description": "Snapshotting of global state", 1792 | "homepage": "http://www.github.com/sebastianbergmann/global-state", 1793 | "keywords": [ 1794 | "global state" 1795 | ], 1796 | "time": "2015-10-12T03:26:01+00:00" 1797 | }, 1798 | { 1799 | "name": "sebastian/recursion-context", 1800 | "version": "1.0.5", 1801 | "source": { 1802 | "type": "git", 1803 | "url": "https://github.com/sebastianbergmann/recursion-context.git", 1804 | "reference": "b19cc3298482a335a95f3016d2f8a6950f0fbcd7" 1805 | }, 1806 | "dist": { 1807 | "type": "zip", 1808 | "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/b19cc3298482a335a95f3016d2f8a6950f0fbcd7", 1809 | "reference": "b19cc3298482a335a95f3016d2f8a6950f0fbcd7", 1810 | "shasum": "" 1811 | }, 1812 | "require": { 1813 | "php": ">=5.3.3" 1814 | }, 1815 | "require-dev": { 1816 | "phpunit/phpunit": "~4.4" 1817 | }, 1818 | "type": "library", 1819 | "extra": { 1820 | "branch-alias": { 1821 | "dev-master": "1.0.x-dev" 1822 | } 1823 | }, 1824 | "autoload": { 1825 | "classmap": [ 1826 | "src/" 1827 | ] 1828 | }, 1829 | "notification-url": "https://packagist.org/downloads/", 1830 | "license": [ 1831 | "BSD-3-Clause" 1832 | ], 1833 | "authors": [ 1834 | { 1835 | "name": "Jeff Welch", 1836 | "email": "whatthejeff@gmail.com" 1837 | }, 1838 | { 1839 | "name": "Sebastian Bergmann", 1840 | "email": "sebastian@phpunit.de" 1841 | }, 1842 | { 1843 | "name": "Adam Harvey", 1844 | "email": "aharvey@php.net" 1845 | } 1846 | ], 1847 | "description": "Provides functionality to recursively process PHP variables", 1848 | "homepage": "http://www.github.com/sebastianbergmann/recursion-context", 1849 | "time": "2016-10-03T07:41:43+00:00" 1850 | }, 1851 | { 1852 | "name": "sebastian/version", 1853 | "version": "1.0.6", 1854 | "source": { 1855 | "type": "git", 1856 | "url": "https://github.com/sebastianbergmann/version.git", 1857 | "reference": "58b3a85e7999757d6ad81c787a1fbf5ff6c628c6" 1858 | }, 1859 | "dist": { 1860 | "type": "zip", 1861 | "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/58b3a85e7999757d6ad81c787a1fbf5ff6c628c6", 1862 | "reference": "58b3a85e7999757d6ad81c787a1fbf5ff6c628c6", 1863 | "shasum": "" 1864 | }, 1865 | "type": "library", 1866 | "autoload": { 1867 | "classmap": [ 1868 | "src/" 1869 | ] 1870 | }, 1871 | "notification-url": "https://packagist.org/downloads/", 1872 | "license": [ 1873 | "BSD-3-Clause" 1874 | ], 1875 | "authors": [ 1876 | { 1877 | "name": "Sebastian Bergmann", 1878 | "email": "sebastian@phpunit.de", 1879 | "role": "lead" 1880 | } 1881 | ], 1882 | "description": "Library that helps with managing the version number of Git-hosted PHP projects", 1883 | "homepage": "https://github.com/sebastianbergmann/version", 1884 | "time": "2015-06-21T13:59:46+00:00" 1885 | }, 1886 | { 1887 | "name": "squizlabs/php_codesniffer", 1888 | "version": "3.3.0", 1889 | "source": { 1890 | "type": "git", 1891 | "url": "https://github.com/squizlabs/PHP_CodeSniffer.git", 1892 | "reference": "d86873af43b4aa9d1f39a3601cc0cfcf02b25266" 1893 | }, 1894 | "dist": { 1895 | "type": "zip", 1896 | "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/d86873af43b4aa9d1f39a3601cc0cfcf02b25266", 1897 | "reference": "d86873af43b4aa9d1f39a3601cc0cfcf02b25266", 1898 | "shasum": "" 1899 | }, 1900 | "require": { 1901 | "ext-simplexml": "*", 1902 | "ext-tokenizer": "*", 1903 | "ext-xmlwriter": "*", 1904 | "php": ">=5.4.0" 1905 | }, 1906 | "require-dev": { 1907 | "phpunit/phpunit": "^4.0 || ^5.0 || ^6.0 || ^7.0" 1908 | }, 1909 | "bin": [ 1910 | "bin/phpcs", 1911 | "bin/phpcbf" 1912 | ], 1913 | "type": "library", 1914 | "extra": { 1915 | "branch-alias": { 1916 | "dev-master": "3.x-dev" 1917 | } 1918 | }, 1919 | "notification-url": "https://packagist.org/downloads/", 1920 | "license": [ 1921 | "BSD-3-Clause" 1922 | ], 1923 | "authors": [ 1924 | { 1925 | "name": "Greg Sherwood", 1926 | "role": "lead" 1927 | } 1928 | ], 1929 | "description": "PHP_CodeSniffer tokenizes PHP, JavaScript and CSS files and detects violations of a defined set of coding standards.", 1930 | "homepage": "http://www.squizlabs.com/php-codesniffer", 1931 | "keywords": [ 1932 | "phpcs", 1933 | "standards" 1934 | ], 1935 | "time": "2018-06-06T23:58:19+00:00" 1936 | }, 1937 | { 1938 | "name": "symfony/options-resolver", 1939 | "version": "v3.4.12", 1940 | "source": { 1941 | "type": "git", 1942 | "url": "https://github.com/symfony/options-resolver.git", 1943 | "reference": "cc5e98ed91688a22a7162a8800096356f9076b1d" 1944 | }, 1945 | "dist": { 1946 | "type": "zip", 1947 | "url": "https://api.github.com/repos/symfony/options-resolver/zipball/cc5e98ed91688a22a7162a8800096356f9076b1d", 1948 | "reference": "cc5e98ed91688a22a7162a8800096356f9076b1d", 1949 | "shasum": "" 1950 | }, 1951 | "require": { 1952 | "php": "^5.5.9|>=7.0.8" 1953 | }, 1954 | "type": "library", 1955 | "extra": { 1956 | "branch-alias": { 1957 | "dev-master": "3.4-dev" 1958 | } 1959 | }, 1960 | "autoload": { 1961 | "psr-4": { 1962 | "Symfony\\Component\\OptionsResolver\\": "" 1963 | }, 1964 | "exclude-from-classmap": [ 1965 | "/Tests/" 1966 | ] 1967 | }, 1968 | "notification-url": "https://packagist.org/downloads/", 1969 | "license": [ 1970 | "MIT" 1971 | ], 1972 | "authors": [ 1973 | { 1974 | "name": "Fabien Potencier", 1975 | "email": "fabien@symfony.com" 1976 | }, 1977 | { 1978 | "name": "Symfony Community", 1979 | "homepage": "https://symfony.com/contributors" 1980 | } 1981 | ], 1982 | "description": "Symfony OptionsResolver Component", 1983 | "homepage": "https://symfony.com", 1984 | "keywords": [ 1985 | "config", 1986 | "configuration", 1987 | "options" 1988 | ], 1989 | "time": "2018-05-30T04:26:49+00:00" 1990 | }, 1991 | { 1992 | "name": "symfony/polyfill-ctype", 1993 | "version": "v1.8.0", 1994 | "source": { 1995 | "type": "git", 1996 | "url": "https://github.com/symfony/polyfill-ctype.git", 1997 | "reference": "7cc359f1b7b80fc25ed7796be7d96adc9b354bae" 1998 | }, 1999 | "dist": { 2000 | "type": "zip", 2001 | "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/7cc359f1b7b80fc25ed7796be7d96adc9b354bae", 2002 | "reference": "7cc359f1b7b80fc25ed7796be7d96adc9b354bae", 2003 | "shasum": "" 2004 | }, 2005 | "require": { 2006 | "php": ">=5.3.3" 2007 | }, 2008 | "type": "library", 2009 | "extra": { 2010 | "branch-alias": { 2011 | "dev-master": "1.8-dev" 2012 | } 2013 | }, 2014 | "autoload": { 2015 | "psr-4": { 2016 | "Symfony\\Polyfill\\Ctype\\": "" 2017 | }, 2018 | "files": [ 2019 | "bootstrap.php" 2020 | ] 2021 | }, 2022 | "notification-url": "https://packagist.org/downloads/", 2023 | "license": [ 2024 | "MIT" 2025 | ], 2026 | "authors": [ 2027 | { 2028 | "name": "Symfony Community", 2029 | "homepage": "https://symfony.com/contributors" 2030 | }, 2031 | { 2032 | "name": "Gert de Pagter", 2033 | "email": "BackEndTea@gmail.com" 2034 | } 2035 | ], 2036 | "description": "Symfony polyfill for ctype functions", 2037 | "homepage": "https://symfony.com", 2038 | "keywords": [ 2039 | "compatibility", 2040 | "ctype", 2041 | "polyfill", 2042 | "portable" 2043 | ], 2044 | "time": "2018-04-30T19:57:29+00:00" 2045 | }, 2046 | { 2047 | "name": "symfony/yaml", 2048 | "version": "v3.4.12", 2049 | "source": { 2050 | "type": "git", 2051 | "url": "https://github.com/symfony/yaml.git", 2052 | "reference": "c5010cc1692ce1fa328b1fb666961eb3d4a85bb0" 2053 | }, 2054 | "dist": { 2055 | "type": "zip", 2056 | "url": "https://api.github.com/repos/symfony/yaml/zipball/c5010cc1692ce1fa328b1fb666961eb3d4a85bb0", 2057 | "reference": "c5010cc1692ce1fa328b1fb666961eb3d4a85bb0", 2058 | "shasum": "" 2059 | }, 2060 | "require": { 2061 | "php": "^5.5.9|>=7.0.8", 2062 | "symfony/polyfill-ctype": "~1.8" 2063 | }, 2064 | "conflict": { 2065 | "symfony/console": "<3.4" 2066 | }, 2067 | "require-dev": { 2068 | "symfony/console": "~3.4|~4.0" 2069 | }, 2070 | "suggest": { 2071 | "symfony/console": "For validating YAML files using the lint command" 2072 | }, 2073 | "type": "library", 2074 | "extra": { 2075 | "branch-alias": { 2076 | "dev-master": "3.4-dev" 2077 | } 2078 | }, 2079 | "autoload": { 2080 | "psr-4": { 2081 | "Symfony\\Component\\Yaml\\": "" 2082 | }, 2083 | "exclude-from-classmap": [ 2084 | "/Tests/" 2085 | ] 2086 | }, 2087 | "notification-url": "https://packagist.org/downloads/", 2088 | "license": [ 2089 | "MIT" 2090 | ], 2091 | "authors": [ 2092 | { 2093 | "name": "Fabien Potencier", 2094 | "email": "fabien@symfony.com" 2095 | }, 2096 | { 2097 | "name": "Symfony Community", 2098 | "homepage": "https://symfony.com/contributors" 2099 | } 2100 | ], 2101 | "description": "Symfony Yaml Component", 2102 | "homepage": "https://symfony.com", 2103 | "time": "2018-05-03T23:18:14+00:00" 2104 | }, 2105 | { 2106 | "name": "webmozart/assert", 2107 | "version": "1.3.0", 2108 | "source": { 2109 | "type": "git", 2110 | "url": "https://github.com/webmozart/assert.git", 2111 | "reference": "0df1908962e7a3071564e857d86874dad1ef204a" 2112 | }, 2113 | "dist": { 2114 | "type": "zip", 2115 | "url": "https://api.github.com/repos/webmozart/assert/zipball/0df1908962e7a3071564e857d86874dad1ef204a", 2116 | "reference": "0df1908962e7a3071564e857d86874dad1ef204a", 2117 | "shasum": "" 2118 | }, 2119 | "require": { 2120 | "php": "^5.3.3 || ^7.0" 2121 | }, 2122 | "require-dev": { 2123 | "phpunit/phpunit": "^4.6", 2124 | "sebastian/version": "^1.0.1" 2125 | }, 2126 | "type": "library", 2127 | "extra": { 2128 | "branch-alias": { 2129 | "dev-master": "1.3-dev" 2130 | } 2131 | }, 2132 | "autoload": { 2133 | "psr-4": { 2134 | "Webmozart\\Assert\\": "src/" 2135 | } 2136 | }, 2137 | "notification-url": "https://packagist.org/downloads/", 2138 | "license": [ 2139 | "MIT" 2140 | ], 2141 | "authors": [ 2142 | { 2143 | "name": "Bernhard Schussek", 2144 | "email": "bschussek@gmail.com" 2145 | } 2146 | ], 2147 | "description": "Assertions to validate method input/output with nice error messages.", 2148 | "keywords": [ 2149 | "assert", 2150 | "check", 2151 | "validate" 2152 | ], 2153 | "time": "2018-01-29T19:49:41+00:00" 2154 | } 2155 | ], 2156 | "aliases": [], 2157 | "minimum-stability": "stable", 2158 | "stability-flags": [], 2159 | "prefer-stable": false, 2160 | "prefer-lowest": false, 2161 | "platform": { 2162 | "php": ">=5.5", 2163 | "ext-curl": "*" 2164 | }, 2165 | "platform-dev": [], 2166 | "platform-overrides": { 2167 | "php": "5.5.34" 2168 | } 2169 | } 2170 | -------------------------------------------------------------------------------- /phpunit.xml.dist: -------------------------------------------------------------------------------- 1 | 2 | 13 | 14 | 20 | 22 | 23 | 24 | 25 | ./tests 26 | 27 | 28 | 29 | 30 | ./src 31 | 32 | ./vendor 33 | 34 | 35 | 36 | -------------------------------------------------------------------------------- /src/Entity/Account.php: -------------------------------------------------------------------------------- 1 | user; 295 | } 296 | 297 | /** 298 | * 299 | * @param string $user 300 | * 301 | * @return Account 302 | */ 303 | public function setUser($user) 304 | { 305 | $this->user = $user; 306 | 307 | return $this; 308 | } 309 | 310 | /** 311 | * 312 | * @return string 313 | */ 314 | public function getDomain() 315 | { 316 | return $this->domain; 317 | } 318 | 319 | /** 320 | * 321 | * @param string $domain 322 | * 323 | * @return Account 324 | */ 325 | public function setDomain($domain) 326 | { 327 | $this->domain = $domain; 328 | 329 | return $this; 330 | } 331 | 332 | /** 333 | * 334 | * @return int 335 | */ 336 | public function getMaxDeferFailMailPercentage() 337 | { 338 | return $this->maxDeferFailMailPercentage; 339 | } 340 | 341 | /** 342 | * 343 | * @param int $maxDeferFailMailPercentage 344 | * 345 | * @return Account 346 | */ 347 | public function setMaxDeferFailMailPercentage($maxDeferFailMailPercentage) 348 | { 349 | $this->maxDeferFailMailPercentage = $maxDeferFailMailPercentage; 350 | 351 | return $this; 352 | } 353 | 354 | /** 355 | * 356 | * @return string 357 | */ 358 | public function getShell() 359 | { 360 | return $this->shell; 361 | } 362 | 363 | /** 364 | * 365 | * @param string $shell 366 | * 367 | * @return Account 368 | */ 369 | public function setShell($shell) 370 | { 371 | $this->shell = $shell; 372 | 373 | return $this; 374 | } 375 | 376 | /** 377 | * 378 | * @return string 379 | */ 380 | public function getMailboxFormat() 381 | { 382 | return $this->mailboxFormat; 383 | } 384 | 385 | /** 386 | * 387 | * @param string $mailboxFormat 388 | * 389 | * @return Account 390 | */ 391 | public function setMailboxFormat($mailboxFormat) 392 | { 393 | $this->mailboxFormat = $mailboxFormat; 394 | 395 | return $this; 396 | } 397 | 398 | /** 399 | * 400 | * @return string 401 | */ 402 | public function getTheme() 403 | { 404 | return $this->theme; 405 | } 406 | 407 | /** 408 | * 409 | * @param string $theme 410 | * 411 | * @return Account 412 | */ 413 | public function setTheme($theme) 414 | { 415 | $this->theme = $theme; 416 | 417 | return $this; 418 | } 419 | 420 | /** 421 | * 422 | * @return int 423 | */ 424 | public function getMaxMailingList() 425 | { 426 | return $this->maxMailingList; 427 | } 428 | 429 | /** 430 | * 431 | * @param int $maxMailingList 432 | * 433 | * @return Account 434 | */ 435 | public function setMaxMailingList($maxMailingList) 436 | { 437 | $this->maxMailingList = $maxMailingList; 438 | 439 | return $this; 440 | } 441 | 442 | /** 443 | * 444 | * @return int 445 | */ 446 | public function getMaxAddonDomains() 447 | { 448 | return $this->maxAddonDomains; 449 | } 450 | 451 | /** 452 | * 453 | * @param int $maxAddonDomains 454 | * 455 | * @return Account 456 | */ 457 | public function setMaxAddonDomains($maxAddonDomains) 458 | { 459 | $this->maxAddonDomains = $maxAddonDomains; 460 | 461 | return $this; 462 | } 463 | 464 | /** 465 | * 466 | * @return int 467 | */ 468 | public function getMaxParkedDomains() 469 | { 470 | return $this->maxParkedDomains; 471 | } 472 | 473 | /** 474 | * 475 | * @param int $maxParkedDomains 476 | * 477 | * @return Account 478 | */ 479 | public function setMaxParkedDomains($maxParkedDomains) 480 | { 481 | $this->maxParkedDomains = $maxParkedDomains; 482 | 483 | return $this; 484 | } 485 | 486 | /** 487 | * 488 | * @return string 489 | */ 490 | public function getIpv6() 491 | { 492 | return $this->ipv6; 493 | } 494 | 495 | /** 496 | * 497 | * @param string $ipv6 498 | * 499 | * @return Account 500 | */ 501 | public function setIpv6($ipv6) 502 | { 503 | $this->ipv6 = $ipv6; 504 | 505 | return $this; 506 | } 507 | 508 | /** 509 | * 510 | * @return string 511 | */ 512 | public function getEmail() 513 | { 514 | return $this->email; 515 | } 516 | 517 | /** 518 | * 519 | * @param string $email 520 | * 521 | * @return Account 522 | */ 523 | public function setEmail($email) 524 | { 525 | $this->email = $email; 526 | 527 | return $this; 528 | } 529 | 530 | /** 531 | * 532 | * @return string 533 | */ 534 | public function getPartition() 535 | { 536 | return $this->partition; 537 | } 538 | 539 | /** 540 | * 541 | * @param string $partition 542 | * 543 | * @return Account 544 | */ 545 | public function setPartition($partition) 546 | { 547 | $this->partition = $partition; 548 | 549 | return $this; 550 | } 551 | 552 | /** 553 | * 554 | * @return int 555 | */ 556 | public function getMaxSQL() 557 | { 558 | return $this->maxSQL; 559 | } 560 | 561 | /** 562 | * 563 | * @param int $maxSQL 564 | * 565 | * @return Account 566 | */ 567 | public function setMaxSQL($maxSQL) 568 | { 569 | $this->maxSQL = $maxSQL; 570 | 571 | return $this; 572 | } 573 | 574 | /** 575 | * 576 | * @return \DateTime 577 | */ 578 | public function getCreatedAt() 579 | { 580 | return $this->createdAt; 581 | } 582 | 583 | /** 584 | * 585 | * @param \DateTime $createdAt 586 | * 587 | * @return Account 588 | */ 589 | public function setCreatedAt($createdAt) 590 | { 591 | $this->createdAt = $createdAt; 592 | 593 | return $this; 594 | } 595 | 596 | /** 597 | * 598 | * @return bool 599 | */ 600 | public function isBackupEnabled() 601 | { 602 | return $this->isBackupEnabled; 603 | } 604 | 605 | /** 606 | * 607 | * @param bool $isBackupEnabled 608 | * 609 | * @return Account 610 | */ 611 | public function setIsBackupEnabled($isBackupEnabled) 612 | { 613 | $this->isBackupEnabled = $isBackupEnabled; 614 | 615 | return $this; 616 | } 617 | 618 | /** 619 | * 620 | * @return bool 621 | */ 622 | public function isOutgoingMailSuspended() 623 | { 624 | return $this->outgoingMailSuspended; 625 | } 626 | 627 | /** 628 | * 629 | * @param bool $outgoingMailSuspended 630 | * 631 | * @return Account 632 | */ 633 | public function setOutgoingMailSuspended($outgoingMailSuspended) 634 | { 635 | $this->outgoingMailSuspended = $outgoingMailSuspended; 636 | 637 | return $this; 638 | } 639 | 640 | /** 641 | * 642 | * @return string 643 | */ 644 | public function getOwner() 645 | { 646 | return $this->owner; 647 | } 648 | 649 | /** 650 | * 651 | * @param string $owner 652 | * 653 | * @return Account 654 | */ 655 | public function setOwner($owner) 656 | { 657 | $this->owner = $owner; 658 | 659 | return $this; 660 | } 661 | 662 | /** 663 | * 664 | * @return string 665 | */ 666 | public function getSuspensionReason() 667 | { 668 | return $this->suspensionReason; 669 | } 670 | 671 | /** 672 | * 673 | * @param string $suspensionReason 674 | * 675 | * @return Account 676 | */ 677 | public function setSuspensionReason($suspensionReason) 678 | { 679 | $this->suspensionReason = $suspensionReason; 680 | 681 | return $this; 682 | } 683 | 684 | /** 685 | * 686 | * @return bool 687 | */ 688 | public function isLocked() 689 | { 690 | return $this->isLocked; 691 | } 692 | 693 | /** 694 | * 695 | * @param bool $isLocked 696 | * 697 | * @return Account 698 | */ 699 | public function setIsLocked($isLocked) 700 | { 701 | $this->isLocked = $isLocked; 702 | 703 | return $this; 704 | } 705 | 706 | /** 707 | * 708 | * @return bool 709 | */ 710 | public function isOutgoingMailCanHold() 711 | { 712 | return $this->outgoingMailCanHold; 713 | } 714 | 715 | /** 716 | * 717 | * @param bool $outgoingMailCanHold 718 | * 719 | * @return Account 720 | */ 721 | public function setOutgoingMailCanHold($outgoingMailCanHold) 722 | { 723 | $this->outgoingMailCanHold = $outgoingMailCanHold; 724 | 725 | return $this; 726 | } 727 | 728 | /** 729 | * 730 | * @return \DateTime 731 | */ 732 | public function getSuspendedAt() 733 | { 734 | return $this->suspendedAt; 735 | } 736 | 737 | /** 738 | * 739 | * @param \DateTime $suspendedAt 740 | * 741 | * @return Account 742 | */ 743 | public function setSuspendedAt($suspendedAt) 744 | { 745 | $this->suspendedAt = $suspendedAt; 746 | 747 | return $this; 748 | } 749 | 750 | /** 751 | * 752 | * @return int 753 | */ 754 | public function getMaxFTP() 755 | { 756 | return $this->maxFTP; 757 | } 758 | 759 | /** 760 | * 761 | * @param int $maxFTP 762 | * 763 | * @return Account 764 | */ 765 | public function setMaxFTP($maxFTP) 766 | { 767 | $this->maxFTP = $maxFTP; 768 | 769 | return $this; 770 | } 771 | 772 | /** 773 | * 774 | * @return int 775 | */ 776 | public function getMaxEmailPerHour() 777 | { 778 | return $this->maxEmailPerHour; 779 | } 780 | 781 | /** 782 | * 783 | * @param int $maxEmailPerHour 784 | * 785 | * @return Account 786 | */ 787 | public function setMaxEmailPerHour($maxEmailPerHour) 788 | { 789 | $this->maxEmailPerHour = $maxEmailPerHour; 790 | 791 | return $this; 792 | } 793 | 794 | /** 795 | * 796 | * @return bool 797 | */ 798 | public function isTemporary() 799 | { 800 | return $this->temporary; 801 | } 802 | 803 | /** 804 | * 805 | * @param bool $temporary 806 | * 807 | * @return Account 808 | */ 809 | public function setTemporary($temporary) 810 | { 811 | $this->temporary = $temporary; 812 | 813 | return $this; 814 | } 815 | 816 | /** 817 | * 818 | * @return string 819 | */ 820 | public function getIpAddress() 821 | { 822 | return $this->ipAddress; 823 | } 824 | 825 | /** 826 | * 827 | * @param string $ipAddress 828 | * 829 | * @return Account 830 | */ 831 | public function setIpAddress($ipAddress) 832 | { 833 | $this->ipAddress = $ipAddress; 834 | 835 | return $this; 836 | } 837 | 838 | /** 839 | * 840 | * @return int 841 | */ 842 | public function getUid() 843 | { 844 | return $this->uid; 845 | } 846 | 847 | /** 848 | * 849 | * @param int $uid 850 | * 851 | * @return Account 852 | */ 853 | public function setUid($uid) 854 | { 855 | $this->uid = $uid; 856 | 857 | return $this; 858 | } 859 | 860 | /** 861 | * 862 | * @return bool 863 | */ 864 | public function isSuspended() 865 | { 866 | return $this->suspended; 867 | } 868 | 869 | /** 870 | * 871 | * @param bool $suspended 872 | * 873 | * @return Account 874 | */ 875 | public function setSuspended($suspended) 876 | { 877 | $this->suspended = $suspended; 878 | 879 | return $this; 880 | } 881 | 882 | /** 883 | * 884 | * @return bool 885 | */ 886 | public function isBackup() 887 | { 888 | return $this->backup; 889 | } 890 | 891 | /** 892 | * 893 | * @param bool $backup 894 | * 895 | * @return Account 896 | */ 897 | public function setBackup($backup) 898 | { 899 | $this->backup = $backup; 900 | 901 | return $this; 902 | } 903 | 904 | /** 905 | * 906 | * @return int 907 | */ 908 | public function getMaxPOP() 909 | { 910 | return $this->maxPOP; 911 | } 912 | 913 | /** 914 | * 915 | * @param int $maxPOP 916 | * 917 | * @return Account 918 | */ 919 | public function setMaxPOP($maxPOP) 920 | { 921 | $this->maxPOP = $maxPOP; 922 | 923 | return $this; 924 | } 925 | 926 | /** 927 | * 928 | * @return int 929 | */ 930 | public function getMaxSubDomain() 931 | { 932 | return $this->maxSubDomain; 933 | } 934 | 935 | /** 936 | * 937 | * @param int $maxSubDomain 938 | * 939 | * @return Account 940 | */ 941 | public function setMaxSubDomain($maxSubDomain) 942 | { 943 | $this->maxSubDomain = $maxSubDomain; 944 | 945 | return $this; 946 | } 947 | 948 | /** 949 | * 950 | * @return int 951 | */ 952 | public function getMaxEmailAccountQuota() 953 | { 954 | return $this->maxEmailAccountQuota; 955 | } 956 | 957 | /** 958 | * 959 | * @param int $maxEmailAccountQuota 960 | * 961 | * @return Account 962 | */ 963 | public function setMaxEmailAccountQuota($maxEmailAccountQuota) 964 | { 965 | $this->maxEmailAccountQuota = $maxEmailAccountQuota; 966 | 967 | return $this; 968 | } 969 | 970 | /** 971 | * 972 | * @return int 973 | */ 974 | public function getDiskUsed() 975 | { 976 | return $this->diskUsed; 977 | } 978 | 979 | /** 980 | * 981 | * @param int $diskUsed 982 | * 983 | * @return Account 984 | */ 985 | public function setDiskUsed($diskUsed) 986 | { 987 | $this->diskUsed = $diskUsed; 988 | 989 | return $this; 990 | } 991 | 992 | /** 993 | * 994 | * @return int 995 | */ 996 | public function getInodeUsed() 997 | { 998 | return $this->inodeUsed; 999 | } 1000 | 1001 | /** 1002 | * 1003 | * @param int $inodeUsed 1004 | * 1005 | * @return Account 1006 | */ 1007 | public function setInodeUsed($inodeUsed) 1008 | { 1009 | $this->inodeUsed = $inodeUsed; 1010 | 1011 | return $this; 1012 | } 1013 | 1014 | /** 1015 | * 1016 | * @return mixed 1017 | */ 1018 | public function getMinDeferFailToTriggerProtection() 1019 | { 1020 | return $this->minDeferFailToTriggerProtection; 1021 | } 1022 | 1023 | /** 1024 | * 1025 | * @param mixed $minDeferFailToTriggerProtection 1026 | * 1027 | * @return Account 1028 | */ 1029 | public function setMinDeferFailToTriggerProtection($minDeferFailToTriggerProtection) 1030 | { 1031 | $this->minDeferFailToTriggerProtection = $minDeferFailToTriggerProtection; 1032 | 1033 | return $this; 1034 | } 1035 | 1036 | /** 1037 | * 1038 | * @return string 1039 | */ 1040 | public function getPlanName() 1041 | { 1042 | return $this->planName; 1043 | } 1044 | 1045 | /** 1046 | * 1047 | * @param string $planName 1048 | * 1049 | * @return Account 1050 | */ 1051 | public function setPlanName($planName) 1052 | { 1053 | $this->planName = $planName; 1054 | 1055 | return $this; 1056 | } 1057 | 1058 | /** 1059 | * 1060 | * @return int 1061 | */ 1062 | public function getInodesLimit() 1063 | { 1064 | return $this->inodesLimit; 1065 | } 1066 | 1067 | /** 1068 | * 1069 | * @param int $inodesLimit 1070 | * 1071 | * @return Account 1072 | */ 1073 | public function setInodesLimit($inodesLimit) 1074 | { 1075 | $this->inodesLimit = $inodesLimit; 1076 | 1077 | return $this; 1078 | } 1079 | 1080 | /** 1081 | * 1082 | * @return int 1083 | */ 1084 | public function getDiskLimit() 1085 | { 1086 | return $this->diskLimit; 1087 | } 1088 | 1089 | /** 1090 | * 1091 | * @param int $diskLimit 1092 | * 1093 | * @return Account 1094 | */ 1095 | public function setDiskLimit($diskLimit) 1096 | { 1097 | $this->diskLimit = $diskLimit; 1098 | 1099 | return $this; 1100 | } 1101 | 1102 | /** 1103 | * 1104 | * @return bool 1105 | */ 1106 | public function isLegacyBackup() 1107 | { 1108 | return $this->legacyBackup; 1109 | } 1110 | 1111 | /** 1112 | * 1113 | * @param bool $legacyBackup 1114 | * 1115 | * @return Account 1116 | */ 1117 | public function setLegacyBackup($legacyBackup) 1118 | { 1119 | $this->legacyBackup = $legacyBackup; 1120 | 1121 | return $this; 1122 | } 1123 | 1124 | /** 1125 | * @return null|string 1126 | */ 1127 | public function getPassword() 1128 | { 1129 | return $this->password; 1130 | } 1131 | 1132 | /** 1133 | * @param null|string $password 1134 | * @return Account 1135 | */ 1136 | public function setPassword($password) 1137 | { 1138 | $this->password = $password; 1139 | return $this; 1140 | } 1141 | 1142 | /** 1143 | * @return bool|null 1144 | */ 1145 | public function isCgiEnable() 1146 | { 1147 | return $this->cgiEnable; 1148 | } 1149 | 1150 | /** 1151 | * @param bool|null $cgiEnable 1152 | * @return Account 1153 | */ 1154 | public function setCgiEnable($cgiEnable) 1155 | { 1156 | $this->cgiEnable = $cgiEnable; 1157 | return $this; 1158 | } 1159 | 1160 | /** 1161 | * @return bool 1162 | */ 1163 | public function isSpamAssassinEnable() 1164 | { 1165 | return $this->spamAssassinEnable; 1166 | } 1167 | 1168 | /** 1169 | * @param bool $spamAssassinEnable 1170 | * @return Account 1171 | */ 1172 | public function setSpamAssassinEnable($spamAssassinEnable) 1173 | { 1174 | $this->spamAssassinEnable = $spamAssassinEnable; 1175 | return $this; 1176 | } 1177 | 1178 | /** 1179 | * @return bool 1180 | */ 1181 | public function isFrontPageEnable() 1182 | { 1183 | return $this->frontPageEnable; 1184 | } 1185 | 1186 | /** 1187 | * @param bool $frontPageEnable 1188 | * @return Account 1189 | */ 1190 | public function setFrontPageEnable($frontPageEnable) 1191 | { 1192 | $this->frontPageEnable = $frontPageEnable; 1193 | return $this; 1194 | } 1195 | 1196 | /** 1197 | * @return int 1198 | */ 1199 | public function getBandwidthLimit() 1200 | { 1201 | return $this->bandwidthLimit; 1202 | } 1203 | 1204 | /** 1205 | * @param int $bandwidthLimit 1206 | * @return Account 1207 | */ 1208 | public function setBandwidthLimit($bandwidthLimit) 1209 | { 1210 | $this->bandwidthLimit = $bandwidthLimit; 1211 | return $this; 1212 | } 1213 | 1214 | /** 1215 | * @return null|string 1216 | */ 1217 | public function getLanguagePreference() 1218 | { 1219 | return $this->languagePreference; 1220 | } 1221 | 1222 | /** 1223 | * @param null|string $languagePreference 1224 | * @return Account 1225 | */ 1226 | public function setLanguagePreference($languagePreference) 1227 | { 1228 | $this->languagePreference = $languagePreference; 1229 | return $this; 1230 | } 1231 | 1232 | /** 1233 | * 1234 | * @param array $account 1235 | * 1236 | * @return Account 1237 | */ 1238 | public static function buildFromArray(array $account) 1239 | { 1240 | $ac = new static(); 1241 | 1242 | if ($account['maxsub'] === "unlimited") { 1243 | $ac->setMaxSubDomain(-1); 1244 | } elseif ($account['maxsub'] === "unknown") { 1245 | $ac->setMaxSubDomain(0); 1246 | } else { 1247 | $ac->setMaxSubDomain(intval($account['maxsub'])); 1248 | } 1249 | 1250 | $ac->setPartition($account['partition']); 1251 | 1252 | if ($account['disklimit'] === "unlimited") { 1253 | $ac->setDiskLimit(-1); 1254 | } else { 1255 | $ac->setDiskLimit(intval(str_replace("M", "", $account['disklimit']))); 1256 | } 1257 | 1258 | $ac->setInodeUsed(intval($account['inodesused'])); 1259 | 1260 | if (! empty($account['has_backup'])) { 1261 | $ac->setBackup((bool)$account['has_backup']); 1262 | } 1263 | 1264 | if ($account['max_emailacct_quota'] === "unlimited") { 1265 | $ac->setMaxEmailAccountQuota(-1); 1266 | } else { 1267 | $ac->setMaxEmailAccountQuota(intval(str_replace("M", "", $account['max_emailacct_quota']))); 1268 | } 1269 | 1270 | $ac->setEmail($account['email']); 1271 | $ac->setSuspensionReason($account['suspendreason']); 1272 | $ac->setLegacyBackup((bool)$account['legacy_backup']); 1273 | $ac->setMaxEmailPerHour( 1274 | $account['max_email_per_hour'] === "unlimited" ? -1 : intval($account['max_email_per_hour']) 1275 | ); 1276 | $ac->setIsBackupEnabled((bool)$account['backup']); 1277 | $ac->setMaxPOP($account['maxpop'] === "unlimited" ? -1 : intval($account['maxpop'])); 1278 | $ac->setUid(intval($account['uid'])); 1279 | $ac->setUser($account['user']); 1280 | $ac->setPlanName($account['plan']); 1281 | $ac->setOutgoingMailSuspended((bool)$account['outgoing_mail_suspended']); 1282 | $ac->setMaxFTP($account['maxftp'] === "unlimited" ? -1 : intval($account['maxftp'])); 1283 | $ac->setTemporary((bool)$account['temporary']); 1284 | $ac->setDomain($account['domain']); 1285 | $ac->setShell($account['shell']); 1286 | $ac->setMailboxFormat($account['mailbox_format']); 1287 | $ac->setIpAddress($account['ip']); 1288 | 1289 | if ($account['diskused'] === "unlimited") { 1290 | $ac->setDiskUsed(-1); 1291 | } else { 1292 | $ac->setDiskUsed(intval(str_replace("M", "", $account['diskused']))); 1293 | } 1294 | 1295 | $ac->setMaxSQL($account['maxsql'] === "unlimited" ? -1 : intval($account['maxsql'])); 1296 | 1297 | if ($account['maxaddons'] === "*unknown*") { 1298 | $ac->setMaxAddonDomains(0); 1299 | } elseif ($account['maxaddons'] === "unlimited") { 1300 | $ac->setMaxAddonDomains(-1); 1301 | } else { 1302 | $ac->setMaxAddonDomains(intval($account['maxaddons'])); 1303 | } 1304 | 1305 | if ($account['maxparked'] === "*unknown*") { 1306 | $ac->setMaxParkedDomains(0); 1307 | } elseif ($account['maxparked'] === "unlimited") { 1308 | $ac->setMaxParkedDomains(-1); 1309 | } else { 1310 | $ac->setMaxParkedDomains(intval($account['maxparked'])); 1311 | } 1312 | 1313 | $ac->setIsLocked((bool)$account['is_locked']); 1314 | $ac->setOwner($account['owner']); 1315 | $ac->setInodesLimit($account['inodeslimit'] === "unlimited" ? -1 : intval($account['inodeslimit'])); 1316 | 1317 | return $ac; 1318 | } 1319 | 1320 | /** 1321 | * 1322 | * @return array 1323 | */ 1324 | public function toArray() 1325 | { 1326 | return [ 1327 | 'legacy_backup' => $this->isLegacyBackup(), 1328 | 'inodesused' => $this->getInodeUsed(), 1329 | 'min_defer_fail_to_trigger_protection' => $this->getMinDeferFailToTriggerProtection(), 1330 | 'maxlst' => $this->getMaxMailingList(), 1331 | 'max_email_per_hour' => $this->getMaxEmailPerHour(), 1332 | 'suspendreason' => $this->getSuspensionReason(), 1333 | 'backup' => $this->isBackupEnabled(), 1334 | 'suspendtime' => $this->getSuspendedAt()->format(DATE_ATOM), 1335 | 'maxpop' => $this->getMaxPOP(), 1336 | 'suspended' => $this->isSuspended(), 1337 | 'uid' => $this->getUid(), 1338 | 'user' => $this->getUser(), 1339 | 'plan' => $this->getPlanName(), 1340 | 'has_backup' => $this->isBackup(), 1341 | 'outgoing_mail_suspended' => $this->isOutgoingMailSuspended(), 1342 | 'startdate' => $this->getCreatedAt()->format(DATE_ATOM), 1343 | 'maxftp' => $this->getMaxFTP(), 1344 | 'temporary' => $this->isTemporary(), 1345 | 'domain' => $this->getDomain(), 1346 | 'disklimit' => $this->getDiskLimit(), 1347 | 'max_emailacct_quota' => $this->getMaxEmailAccountQuota(), 1348 | 'shell' => $this->getShell(), 1349 | 'partition' => $this->getPartition(), 1350 | 'mailbox_format' => $this->getMailboxFormat(), 1351 | 'ip' => $this->getIpAddress(), 1352 | 'maxsub' => $this->getMaxSubDomain(), 1353 | 'max_defer_fail_percentage' => $this->getMaxDeferFailMailPercentage(), 1354 | 'diskused' => $this->getDiskUsed(), 1355 | 'maxsql' => $this->getMaxSQL(), 1356 | 'maxaddons' => $this->getMaxAddonDomains(), 1357 | 'theme' => $this->getTheme(), 1358 | 'maxparked' => $this->getMaxParkedDomains(), 1359 | 'is_locked' => $this->isLocked(), 1360 | 'ipv6' => $this->getIpv6(), 1361 | 'email' => $this->getEmail(), 1362 | 'outgoing_mail_hold' => $this->isOutgoingMailCanHold(), 1363 | 'inodeslimit' => $this->getInodesLimit() 1364 | ]; 1365 | } 1366 | } 1367 | -------------------------------------------------------------------------------- /src/Entity/Domain.php: -------------------------------------------------------------------------------- 1 | domain; 83 | } 84 | 85 | /** 86 | * @param string $domain 87 | * @return Domain 88 | */ 89 | public function setDomain($domain) 90 | { 91 | $this->domain = $domain; 92 | return $this; 93 | } 94 | 95 | /** 96 | * @return string 97 | */ 98 | public function getIpv4SSL() 99 | { 100 | return $this->ipv4SSL; 101 | } 102 | 103 | /** 104 | * @param string $ipv4SSL 105 | * @return Domain 106 | */ 107 | public function setIpv4SSL($ipv4SSL) 108 | { 109 | $this->ipv4SSL = $ipv4SSL; 110 | return $this; 111 | } 112 | 113 | /** 114 | * @return string 115 | */ 116 | public function getIpv6() 117 | { 118 | return $this->ipv6; 119 | } 120 | 121 | /** 122 | * @param string $ipv6 123 | * @return Domain 124 | */ 125 | public function setIpv6($ipv6) 126 | { 127 | $this->ipv6 = $ipv6; 128 | return $this; 129 | } 130 | 131 | /** 132 | * @return int 133 | */ 134 | public function getSslPort() 135 | { 136 | return $this->sslPort; 137 | } 138 | 139 | /** 140 | * @param int $sslPort 141 | * @return Domain 142 | */ 143 | public function setSslPort($sslPort) 144 | { 145 | $this->sslPort = $sslPort; 146 | return $this; 147 | } 148 | 149 | /** 150 | * @return null|string 151 | */ 152 | public function getPhpVersion() 153 | { 154 | return $this->phpVersion; 155 | } 156 | 157 | /** 158 | * @param null|string $phpVersion 159 | * @return Domain 160 | */ 161 | public function setPhpVersion($phpVersion) 162 | { 163 | $this->phpVersion = $phpVersion; 164 | return $this; 165 | } 166 | 167 | /** 168 | * @return string 169 | */ 170 | public function getUser() 171 | { 172 | return $this->user; 173 | } 174 | 175 | /** 176 | * @param string $user 177 | * @return Domain 178 | */ 179 | public function setUser($user) 180 | { 181 | $this->user = $user; 182 | return $this; 183 | } 184 | 185 | /** 186 | * @return string 187 | */ 188 | public function getUserOwner() 189 | { 190 | return $this->userOwner; 191 | } 192 | 193 | /** 194 | * @param string $userOwner 195 | * @return Domain 196 | */ 197 | public function setUserOwner($userOwner) 198 | { 199 | $this->userOwner = $userOwner; 200 | return $this; 201 | } 202 | 203 | /** 204 | * @return string 205 | */ 206 | public function getDomainType() 207 | { 208 | return $this->domainType; 209 | } 210 | 211 | /** 212 | * @param string $domainType 213 | * @return Domain 214 | */ 215 | public function setDomainType($domainType) 216 | { 217 | $this->domainType = $domainType; 218 | return $this; 219 | } 220 | 221 | /** 222 | * @return bool 223 | */ 224 | public function isIpv6IsDedicated() 225 | { 226 | return $this->ipv6IsDedicated; 227 | } 228 | 229 | /** 230 | * @param bool $ipv6IsDedicated 231 | * @return Domain 232 | */ 233 | public function setIpv6IsDedicated($ipv6IsDedicated) 234 | { 235 | $this->ipv6IsDedicated = $ipv6IsDedicated; 236 | return $this; 237 | } 238 | 239 | /** 240 | * @return null|string 241 | */ 242 | public function getParentDomain() 243 | { 244 | return $this->parentDomain; 245 | } 246 | 247 | /** 248 | * @param null|string $parentDomain 249 | * @return Domain 250 | */ 251 | public function setParentDomain($parentDomain) 252 | { 253 | $this->parentDomain = $parentDomain; 254 | return $this; 255 | } 256 | 257 | /** 258 | * @return string 259 | */ 260 | public function getIpv4() 261 | { 262 | return $this->ipv4; 263 | } 264 | 265 | /** 266 | * @param string $ipv4 267 | * @return Domain 268 | */ 269 | public function setIpv4($ipv4) 270 | { 271 | $this->ipv4 = $ipv4; 272 | return $this; 273 | } 274 | 275 | /** 276 | * @return bool 277 | */ 278 | public function isModSecurityEnabled() 279 | { 280 | return $this->modSecurityEnabled; 281 | } 282 | 283 | /** 284 | * @param bool $modSecurityEnabled 285 | * @return Domain 286 | */ 287 | public function setModSecurityEnabled($modSecurityEnabled) 288 | { 289 | $this->modSecurityEnabled = $modSecurityEnabled; 290 | return $this; 291 | } 292 | 293 | /** 294 | * @return int 295 | */ 296 | public function getPort() 297 | { 298 | return $this->port; 299 | } 300 | 301 | /** 302 | * @param int $port 303 | * @return Domain 304 | */ 305 | public function setPort($port) 306 | { 307 | $this->port = $port; 308 | return $this; 309 | } 310 | 311 | /** 312 | * @return string 313 | */ 314 | public function getDocRoot() 315 | { 316 | return $this->docRoot; 317 | } 318 | 319 | /** 320 | * @param string $docRoot 321 | * @return Domain 322 | */ 323 | public function setDocRoot($docRoot) 324 | { 325 | $this->docRoot = $docRoot; 326 | return $this; 327 | } 328 | } 329 | -------------------------------------------------------------------------------- /src/Entity/DomainUser.php: -------------------------------------------------------------------------------- 1 | hasCGI; 88 | } 89 | 90 | /** 91 | * @param bool $hasCGI 92 | * @return DomainUser 93 | */ 94 | public function setHasCGI($hasCGI) 95 | { 96 | $this->hasCGI = $hasCGI; 97 | return $this; 98 | } 99 | 100 | /** 101 | * @return string 102 | */ 103 | public function getServerName() 104 | { 105 | return $this->serverName; 106 | } 107 | 108 | /** 109 | * @param string $serverName 110 | * @return DomainUser 111 | */ 112 | public function setServerName($serverName) 113 | { 114 | $this->serverName = $serverName; 115 | return $this; 116 | } 117 | 118 | /** 119 | * @return string 120 | */ 121 | public function getOwner() 122 | { 123 | return $this->owner; 124 | } 125 | 126 | /** 127 | * @param string $owner 128 | * @return DomainUser 129 | */ 130 | public function setOwner($owner) 131 | { 132 | $this->owner = $owner; 133 | return $this; 134 | } 135 | 136 | /** 137 | * @return array 138 | */ 139 | public function getScriptAlias() 140 | { 141 | return $this->scriptAlias; 142 | } 143 | 144 | /** 145 | * @param array $scriptAlias 146 | * @return DomainUser 147 | */ 148 | public function setScriptAlias($scriptAlias) 149 | { 150 | $this->scriptAlias = $scriptAlias; 151 | return $this; 152 | } 153 | 154 | /** 155 | * @return string 156 | */ 157 | public function getHomeDirectory() 158 | { 159 | return $this->homeDirectory; 160 | } 161 | 162 | /** 163 | * @param string $homeDirectory 164 | * @return DomainUser 165 | */ 166 | public function setHomeDirectory($homeDirectory) 167 | { 168 | $this->homeDirectory = $homeDirectory; 169 | return $this; 170 | } 171 | 172 | /** 173 | * @return array 174 | */ 175 | public function getCustomLog() 176 | { 177 | return $this->customLog; 178 | } 179 | 180 | /** 181 | * @param array $customLog 182 | * @return DomainUser 183 | */ 184 | public function setCustomLog($customLog) 185 | { 186 | $this->customLog = $customLog; 187 | return $this; 188 | } 189 | 190 | /** 191 | * @return string 192 | */ 193 | public function getUser() 194 | { 195 | return $this->user; 196 | } 197 | 198 | /** 199 | * @param string $user 200 | * @return DomainUser 201 | */ 202 | public function setUser($user) 203 | { 204 | $this->user = $user; 205 | return $this; 206 | } 207 | 208 | /** 209 | * @return string 210 | */ 211 | public function getGroup() 212 | { 213 | return $this->group; 214 | } 215 | 216 | /** 217 | * @param string $group 218 | * @return DomainUser 219 | */ 220 | public function setGroup($group) 221 | { 222 | $this->group = $group; 223 | return $this; 224 | } 225 | 226 | /** 227 | * @return string 228 | */ 229 | public function getIpAddress() 230 | { 231 | return $this->ipAddress; 232 | } 233 | 234 | /** 235 | * @param string $ipAddress 236 | * @return DomainUser 237 | */ 238 | public function setIpAddress($ipAddress) 239 | { 240 | $this->ipAddress = $ipAddress; 241 | return $this; 242 | } 243 | 244 | /** 245 | * @return int 246 | */ 247 | public function getPort() 248 | { 249 | return $this->port; 250 | } 251 | 252 | /** 253 | * @param int $port 254 | * @return DomainUser 255 | */ 256 | public function setPort($port) 257 | { 258 | $this->port = $port; 259 | return $this; 260 | } 261 | 262 | /** 263 | * @return bool 264 | */ 265 | public function isPhpOpenBaseDirectoryProtect() 266 | { 267 | return $this->phpOpenBaseDirectoryProtect; 268 | } 269 | 270 | /** 271 | * @param bool $phpOpenBaseDirectoryProtect 272 | * @return DomainUser 273 | */ 274 | public function setPhpOpenBaseDirectoryProtect($phpOpenBaseDirectoryProtect) 275 | { 276 | $this->phpOpenBaseDirectoryProtect = $phpOpenBaseDirectoryProtect; 277 | return $this; 278 | } 279 | 280 | /** 281 | * @return bool 282 | */ 283 | public function isUseCanonicalName() 284 | { 285 | return $this->useCanonicalName; 286 | } 287 | 288 | /** 289 | * @param bool $useCanonicalName 290 | * @return DomainUser 291 | */ 292 | public function setUseCanonicalName($useCanonicalName) 293 | { 294 | $this->useCanonicalName = $useCanonicalName; 295 | return $this; 296 | } 297 | 298 | /** 299 | * @return string 300 | */ 301 | public function getServerAdmin() 302 | { 303 | return $this->serverAdmin; 304 | } 305 | 306 | /** 307 | * @param string $serverAdmin 308 | * @return DomainUser 309 | */ 310 | public function setServerAdmin($serverAdmin) 311 | { 312 | $this->serverAdmin = $serverAdmin; 313 | return $this; 314 | } 315 | 316 | /** 317 | * @return string 318 | */ 319 | public function getServerAlias() 320 | { 321 | return $this->serverAlias; 322 | } 323 | 324 | /** 325 | * @param string $serverAlias 326 | * @return DomainUser 327 | */ 328 | public function setServerAlias($serverAlias) 329 | { 330 | $this->serverAlias = $serverAlias; 331 | return $this; 332 | } 333 | 334 | /** 335 | * @return string 336 | */ 337 | public function getDocumentRoot() 338 | { 339 | return $this->documentRoot; 340 | } 341 | 342 | /** 343 | * @param string $documentRoot 344 | * @return DomainUser 345 | */ 346 | public function setDocumentRoot($documentRoot) 347 | { 348 | $this->documentRoot = $documentRoot; 349 | return $this; 350 | } 351 | } 352 | -------------------------------------------------------------------------------- /src/Entity/SuspendedAccount.php: -------------------------------------------------------------------------------- 1 | owner; 39 | } 40 | 41 | /** 42 | * @param string $owner 43 | * 44 | * @return SuspendedAccount 45 | */ 46 | public function setOwner($owner) 47 | { 48 | $this->owner = $owner; 49 | 50 | return $this; 51 | } 52 | 53 | /** 54 | * @return \DateTime 55 | */ 56 | public function getTime() 57 | { 58 | return $this->time; 59 | } 60 | 61 | /** 62 | * @param \DateTime $time 63 | * 64 | * @return SuspendedAccount 65 | */ 66 | public function setTime($time) 67 | { 68 | $this->time = $time; 69 | 70 | return $this; 71 | } 72 | 73 | /** 74 | * @return string 75 | */ 76 | public function getReason() 77 | { 78 | return $this->reason; 79 | } 80 | 81 | /** 82 | * @param string $reason 83 | * 84 | * @return SuspendedAccount 85 | */ 86 | public function setReason($reason) 87 | { 88 | $this->reason = $reason; 89 | 90 | return $this; 91 | } 92 | 93 | /** 94 | * @return bool 95 | */ 96 | public function isLocked() 97 | { 98 | return $this->isLocked; 99 | } 100 | 101 | /** 102 | * @param bool $isLocked 103 | * 104 | * @return SuspendedAccount 105 | */ 106 | public function setIsLocked($isLocked) 107 | { 108 | $this->isLocked = $isLocked; 109 | 110 | return $this; 111 | } 112 | 113 | /** 114 | * @return string 115 | */ 116 | public function getUser() 117 | { 118 | return $this->user; 119 | } 120 | 121 | /** 122 | * @param string $user 123 | * 124 | * @return SuspendedAccount 125 | */ 126 | public function setUser($user) 127 | { 128 | $this->user = $user; 129 | 130 | return $this; 131 | } 132 | } -------------------------------------------------------------------------------- /src/Entity/UserPrivilege.php: -------------------------------------------------------------------------------- 1 | reason = $reason; 12 | 13 | parent::__construct($message, $code); 14 | } 15 | 16 | /** 17 | * 18 | * @param $message 19 | * @param $reason 20 | * 21 | * @return ClientExceptions 22 | */ 23 | public static function accessDenied($message, $reason = null) 24 | { 25 | return new static($message, 0, $reason); 26 | } 27 | 28 | /** 29 | * 30 | * @param $message 31 | * @param $reason 32 | * 33 | * @return ClientExceptions 34 | */ 35 | public static function recordNotFound($message, $reason = null) 36 | { 37 | return new static($message, 0, $reason); 38 | } 39 | 40 | /** 41 | * 42 | * @param $message 43 | * @param $reason 44 | * 45 | * @return ClientExceptions 46 | */ 47 | public static function invalidArgument($message, $reason = null) 48 | { 49 | return new static($message, 0, $reason); 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /src/WHM/Accounts.php: -------------------------------------------------------------------------------- 1 | client = $client; 35 | } 36 | 37 | /** 38 | * Search accounts from your WHM server. 39 | * 40 | * WHM API function: Accounts -> listaccts 41 | * 42 | * $accounts = new Accounts($c); 43 | * $keyword = "search_keyword"; 44 | * $searchType = "username"; //valid search types are "domain", "owner", "user", "ip", "package" 45 | * $options = [ 46 | * 'searchmethod' => "exact", //"exact" or "regex", 47 | * "page" => 1, 48 | * "limit" => 10, //per page, 49 | * "want" => "username" //A comma-separated list of fields you want to fetch 50 | * ]; 51 | * 52 | * try { 53 | * $accounts->searchAccounts($keyword, $searchType, $options); 54 | * } catch (\Http\Client\Exception $e) { 55 | * echo $e->getMessage(); 56 | * } catch (\PreviewTechs\cPanelWHM\Exceptions\ClientExceptions $e) { 57 | * echo $e->getMessage(); 58 | * } 59 | * 60 | * @link https://documentation.cpanel.net/display/DD/WHM+API+1+Functions+-+listaccts 61 | * 62 | * @param null $keyword 63 | * @param null $searchType 64 | * @param array $options 65 | * 66 | * @return array 67 | * @throws ClientExceptions 68 | * @throws Exception 69 | */ 70 | public function searchAccounts($keyword = null, $searchType = null, array $options = []) 71 | { 72 | $limit = 10; 73 | $page = 1; 74 | 75 | $params = [ 76 | 'api.version' => 1, 77 | 'api.chunk.enable' => 1, 78 | 'api.chunk.size' => $limit, 79 | 'api.chunk.start' => $page * $limit 80 | ]; 81 | 82 | if ( ! empty($options['limit'])) { 83 | $params['api.chunk.size'] = intval($options['limit']); 84 | } 85 | 86 | if ( ! empty($options['page'])) { 87 | $params['api.chunk.start'] = intval($options['page']) * $params['api.chunk.size']; 88 | } 89 | 90 | if ( ! empty($searchType) && ! in_array($searchType, ["domain", "owner", "user", "ip", "package"])) { 91 | throw new \InvalidArgumentException("`searchType` must be one of these - domain, owner, user, ip, package"); 92 | } 93 | 94 | if ( ! empty($options['searchmethod']) && ! in_array($options['searchmethod'], ["exact", "regex"])) { 95 | throw new \InvalidArgumentException("options[searchmethod] must be either `regex` or `exact`"); 96 | } 97 | 98 | if ( ! empty($options['want'])) { 99 | $params['want'] = $options['want']; 100 | } 101 | 102 | if ( ! empty($searchType)) { 103 | $params['searchtype'] = $searchType; 104 | } 105 | 106 | if ( ! empty($keyword)) { 107 | $params['search'] = $keyword; 108 | empty($searchType) ? $params['searchtype'] = "user" : null; 109 | } 110 | 111 | $results = $this->client->sendRequest("/json-api/listaccts", "GET", $params); 112 | if (empty($results['data']['acct'])) { 113 | return []; 114 | } 115 | 116 | $accounts = []; 117 | foreach ($results['data']['acct'] as $account) { 118 | $accounts[] = Account::buildFromArray($account); 119 | } 120 | 121 | return [ 122 | 'accounts' => $accounts, 123 | 'count' => $params['api.chunk.size'], 124 | 'page' => $page 125 | ]; 126 | } 127 | 128 | /** 129 | * Get an account details 130 | * 131 | * WHM API function: Accounts -> accountsummary 132 | * 133 | * @link https://documentation.cpanel.net/display/DD/WHM+API+1+Functions+-+accountsummary 134 | * 135 | * @param null $user 136 | * @param null $domain 137 | * 138 | * @return null|Account 139 | * @throws ClientExceptions 140 | * @throws Exception 141 | */ 142 | public function getDetails($user = null, $domain = null) 143 | { 144 | if (empty($user) && empty($domain)) { 145 | throw ClientExceptions::invalidArgument("You must provide either a username or a domain or both"); 146 | } 147 | 148 | if ( ! empty($user) && ! empty($domain)) { 149 | throw ClientExceptions::invalidArgument( 150 | "You must provide only one argument either user OR domain (not both)" 151 | ); 152 | } 153 | 154 | $params = []; 155 | 156 | if ( ! empty($user)) { 157 | $params['user'] = $user; 158 | } 159 | 160 | if ( ! empty($domain)) { 161 | $params['domain'] = $domain; 162 | } 163 | 164 | $result = $this->client->sendRequest("/json-api/accountsummary", "GET", $params); 165 | 166 | if (empty($result)) { 167 | return null; 168 | } 169 | 170 | if ($result['metadata']['reason'] != "OK") { 171 | throw ClientExceptions::recordNotFound( 172 | ! empty($result['metadata']['reason']) ? $result['metadata']['reason'] : "Record not found" 173 | ); 174 | } 175 | 176 | if ( ! empty($result['data']) && is_array($result['data']) && !empty($result['data']['acct'])) { 177 | return Account::buildFromArray($result['data']['acct'][0]); 178 | } 179 | 180 | return null; 181 | } 182 | 183 | /** 184 | * This function lists available WHM API 1 functions. 185 | * 186 | * This function only lists the functions that are available to the current user. 187 | * For example, if the authenticated user is a reseller without root -level privileges, 188 | * the function will not list WHM API 1 functions that require root privileges. 189 | * 190 | * WHM API function: Accounts -> applist 191 | * 192 | * @link https://documentation.cpanel.net/display/DD/WHM+API+1+Functions+-+applist 193 | * 194 | * @return array 195 | * @throws ClientExceptions 196 | * @throws Exception 197 | */ 198 | public function availableFunctions() 199 | { 200 | $result = $this->client->sendRequest("/json-api/applist", 'GET', []); 201 | 202 | if ( ! empty($result['app']) && sizeof($result['app']) > 0) { 203 | return $result['app']; 204 | } 205 | 206 | return []; 207 | } 208 | 209 | /** 210 | * Create a new account. This function creates a cPanel account. 211 | * The function also sets up the new account's domain information. 212 | * 213 | * WHM API function: Accounts -> createacct 214 | * 215 | * @link https://documentation.cpanel.net/display/DD/WHM+API+1+Functions+-+createacct 216 | * 217 | * @param Account $account 218 | * @param array $options 219 | * 220 | * @return array 221 | * @throws ClientExceptions 222 | * @throws Exception 223 | */ 224 | public function create(Account $account, array $options = []) 225 | { 226 | if (empty($account->getUser())) { 227 | throw ClientExceptions::invalidArgument("You must provide an username to create new account"); 228 | } 229 | 230 | if (empty($account->getDomain())) { 231 | throw ClientExceptions::invalidArgument("You must provide a domain to create new account"); 232 | } 233 | 234 | $params = []; 235 | $params['username'] = $account->getUser(); 236 | $params['domain'] = $account->getDomain(); 237 | ! empty($account->getPlanName()) ? $params['plan'] = $account->getPlanName() : null; 238 | ! empty($options['pkgname']) ? $params['pkgname'] = $options['pkgname'] : null; 239 | if ( ! empty($options['savepkg'])) { 240 | if ( ! in_array(intval($options['savepkg']), [0, 1])) { 241 | throw new ClientExceptions("`savepkg` must be either 0 or 1"); 242 | } 243 | 244 | $params['savepkg'] = $options['savepkg']; 245 | } 246 | 247 | ! empty($options['featurelist']) ? $params['featurelist'] = $options['featurelist'] : null; 248 | if ( ! empty($account->getDiskLimit())) { 249 | if ($account->getDiskLimit() === -1) { 250 | $params['quota'] = 0; 251 | } else { 252 | $params['quota'] = intval($account->getDiskLimit()); 253 | } 254 | } 255 | 256 | ! empty($account->getPassword()) ? $params['password'] = $account->getPassword() : null; 257 | ! empty($account->getIpAddress()) ? $params['ip'] = $account->getIpAddress() : null; 258 | ! empty($account->isCgiEnable()) ? $params['cgi'] = (int)$account->isCgiEnable() : null; 259 | ! empty($account->isSpamAssassinEnable()) ? 260 | $params['spamassassin'] = (int)$account->isSpamAssassinEnable() 261 | : null; 262 | ! empty($account->isFrontPageEnable()) ? $params['frontpage'] = (int)$account->isFrontPageEnable() : null; 263 | ! empty($account->getShell()) ? $params['hasshell'] = 1 : null; 264 | ! empty($account->getEmail()) ? $params['contactemail'] = $account->getEmail() : null; 265 | ! empty($account->getTheme()) ? $params['cpmod'] = 1 : null; 266 | 267 | if ($account->getMaxFTP() === -1) { 268 | $params['maxftp'] = "unlimited"; 269 | } elseif ($account->getMaxFTP() > 0) { 270 | $params['maxftp'] = intval($account->getMaxFTP()); 271 | } 272 | 273 | if ($account->getMaxSQL() === -1) { 274 | $params['maxsql'] = "unlimited"; 275 | } elseif ($account->getMaxSQL() > 0) { 276 | $params['maxsql'] = intval($account->getMaxSQL()); 277 | } 278 | 279 | if ($account->getMaxPOP() === -1) { 280 | $params['maxpop'] = "unlimited"; 281 | } elseif ($account->getMaxPOP() > 0) { 282 | $params['maxpop'] = intval($account->getMaxPOP()); 283 | } 284 | 285 | if ($account->getMaxMailingList() === -1) { 286 | $params['maxlst'] = "unlimited"; 287 | } elseif ($account->getMaxMailingList() > 0) { 288 | $params['maxlst'] = intval($account->getMaxMailingList()); 289 | } 290 | 291 | if ($account->getMaxSubDomain() === -1) { 292 | $params['maxsub'] = "unlimited"; 293 | } elseif ($account->getMaxSubDomain() > 0) { 294 | $params['maxsub'] = intval($account->getMaxSubDomain()); 295 | } 296 | 297 | if ($account->getMaxParkedDomains() === -1) { 298 | $params['maxpark'] = "unlimited"; 299 | } elseif ($account->getMaxParkedDomains() > 0) { 300 | $params['maxpark'] = intval($account->getMaxParkedDomains()); 301 | } 302 | 303 | if ($account->getMaxAddonDomains() === -1) { 304 | $params['maxaddon'] = "unlimited"; 305 | } elseif ($account->getMaxAddonDomains() > 0) { 306 | $params['maxaddon'] = intval($account->getMaxAddonDomains()); 307 | } 308 | 309 | if ($account->getBandwidthLimit() === -1) { 310 | $params['bwlimit'] = "unlimited"; 311 | } elseif ($account->getBandwidthLimit() > 0) { 312 | $params['bwlimit'] = intval($account->getBandwidthLimit()); 313 | } 314 | 315 | ! empty($options['customip']) ? $params['customip'] = $options['customip'] : null; 316 | 317 | ! empty($account->getLanguagePreference()) ? $params['language'] = $account->getLanguagePreference() : null; 318 | 319 | ! empty($options['useregns']) ? $params['useregns'] = $options['useregns'] : null; 320 | ! empty($options['reseller']) ? $params['reseller'] = (int)$options['reseller'] : null; 321 | ! empty($options['forcedns']) ? $params['forcedns'] = (int)$options['forcedns'] : null; 322 | 323 | ! empty($account->getMailboxFormat()) ? $params['mailbox_format'] = $account->getMailboxFormat() : null; 324 | 325 | if ( ! empty($options['mxcheck'])) { 326 | if ( ! in_array($options['mxcheck'], ['local', 'secondary', 'remote', 'auto'])) { 327 | throw new ClientExceptions("options[mxcheck] parameters must be one of local, secondary, remote, auto"); 328 | } 329 | 330 | $params['mxcheck'] = $options['mxcheck']; 331 | } 332 | 333 | if ($account->getMaxEmailPerHour() === -1) { 334 | $params['max_email_per_hour'] = "unlimited"; 335 | } elseif ($account->getMaxEmailPerHour() > 0) { 336 | $params['max_email_per_hour'] = intval($account->getMaxEmailPerHour()); 337 | } 338 | 339 | if ($account->getMaxEmailAccountQuota() === -1) { 340 | $params['max_emailacct_quota'] = "unlimited"; 341 | } elseif ($account->getMaxEmailAccountQuota() > 0) { 342 | $params['max_email_per_hour'] = intval($account->getMaxEmailAccountQuota()); 343 | } 344 | 345 | if ($account->getMaxDeferFailMailPercentage() === -1) { 346 | $params['max_defer_fail_percentage'] = "unlimited"; 347 | } elseif ($account->getMaxDeferFailMailPercentage() > 0) { 348 | $params['max_defer_fail_percentage'] = intval($account->getMaxDeferFailMailPercentage()); 349 | } 350 | 351 | ! empty($account->getUid()) ? $params['uid'] = $account->getUid() : null; 352 | ! empty($account->getPartition()) ? $params['homedir'] = $account->getPartition() : null; 353 | ! empty($options['dkim']) ? $params['dkim'] = intval($options['dkim']) : null; 354 | ! empty($options['spf']) ? $params['spf'] = intval($options['spf']) : null; 355 | ! empty($account->getOwner()) ? $params['owner'] = $account->getOwner() : null; 356 | 357 | $result = $this->client->sendRequest("/json-api/createacct", "GET", $params); 358 | 359 | if(!empty($result['metadata']) && $result['metadata']['result'] === 0){ 360 | throw new ClientExceptions($result['metadata']['reason']); 361 | } 362 | 363 | if ( ! empty($result) && ! empty($result['result'][0]) && $result['result'][0]['status'] === 0) { 364 | throw new ClientExceptions($result['result'][0]['statusmsg']); 365 | } 366 | 367 | if ( ! empty($result) && ! empty($result['result'][0]) && $result['result'][0]['status'] === 1) { 368 | return ['result' => $result['result'][0]['options'], 'raw_output' => $result['result'][0]['rawout']]; 369 | } 370 | 371 | if(!empty($result['metadata']) && $result['metadata']['result'] === 1){ 372 | return ['result' => $result['data'], 'raw_output' => $result['metadata']['output']['raw']]; 373 | } 374 | 375 | return []; 376 | } 377 | 378 | /** 379 | * This function retrieves domain data. 380 | * 381 | * WHM API function: Accounts -> domainuserdata 382 | * 383 | * @link https://documentation.cpanel.net/display/DD/WHM+API+1+Functions+-+domainuserdata 384 | * 385 | * @param $domain 386 | * 387 | * @return null|DomainUser 388 | * @throws ClientExceptions 389 | * @throws Exception 390 | */ 391 | public function domainDetails($domain) 392 | { 393 | $params = ['domain' => $domain]; 394 | 395 | $result = $this->client->sendRequest("/json-api/domainuserdata", "GET", $params); 396 | if (empty($result)) { 397 | return null; 398 | } 399 | 400 | if ($result['result'][0]['status'] === 0) { 401 | throw new ClientExceptions($result['result'][0]['statusmsg']); 402 | } 403 | 404 | $userData = $result['userdata']; 405 | $domainUser = new DomainUser(); 406 | $domainUser->setHasCGI((bool)$userData['hascgi']); 407 | $domainUser->setServerName($userData['servername']); 408 | $domainUser->setOwner($userData['owner']); 409 | $domainUser->setScriptAlias($userData['scriptalias']); 410 | $domainUser->setHomeDirectory($userData['homedir']); 411 | $domainUser->setCustomLog($userData['customlog']); 412 | $domainUser->setUser($userData['user']); 413 | $domainUser->setGroup($userData['group']); 414 | $domainUser->setIpAddress($userData['ip']); 415 | $domainUser->setPort($userData['port']); 416 | $domainUser->setPhpOpenBaseDirectoryProtect((bool)$userData['phpopenbasedirprotect']); 417 | 418 | if ($userData['usecanonicalname'] === "Off") { 419 | $domainUser->setUseCanonicalName(false); 420 | } elseif ($userData['usecanonicalname'] === "On") { 421 | $domainUser->setUseCanonicalName(true); 422 | } 423 | 424 | $domainUser->setServerAdmin($userData['serveradmin']); 425 | $domainUser->setServerAlias($userData['serveralias']); 426 | $domainUser->setDocumentRoot($userData['documentroot']); 427 | 428 | return $domainUser; 429 | } 430 | 431 | /** 432 | * This function modifies a user's disk quota. 433 | * WHM API function: Accounts -> editquota 434 | * @link https://documentation.cpanel.net/display/DD/WHM+API+1+Functions+-+editquota 435 | * 436 | * @param $username 437 | * @param $newQuota 438 | * 439 | * @return bool 440 | * @throws ClientExceptions 441 | * @throws Exception 442 | */ 443 | public function changeDiskSpaceQuota($username, $newQuota) 444 | { 445 | $params = ['user' => $username, 'quota' => $newQuota]; 446 | 447 | $this->client->sendRequest("/json-api/editquota", "GET", $params); 448 | 449 | return true; 450 | } 451 | 452 | /** 453 | * This function forces a user to change the account password after the next login attempt. 454 | * 455 | * WHM API function: Accounts -> forcepasswordchange 456 | * 457 | * @link https://documentation.cpanel.net/display/DD/WHM+API+1+Functions+-+forcepasswordchange 458 | * 459 | * @param array $usernames 460 | * @param int $stopOnFail 461 | * 462 | * @return null 463 | * @throws ClientExceptions 464 | * @throws Exception 465 | */ 466 | public function forcePasswordChange(array $usernames, $stopOnFail = 1) 467 | { 468 | $params = [ 469 | "stop_on_failure" => $stopOnFail 470 | ]; 471 | 472 | $usersJson = []; 473 | foreach ($usernames as $username) { 474 | $usersJson[$username] = 1; 475 | } 476 | 477 | $params['users_json'] = json_encode($usersJson); 478 | 479 | $result = $this->client->sendRequest("/json-api/forcepasswordchange", "GET", $params); 480 | if ($result['metadata']['result'] === 0) { 481 | throw new ClientExceptions($result['metadata']['reason']); 482 | } 483 | 484 | if ( ! empty($result['data'])) { 485 | return $result['updated']; 486 | } 487 | 488 | return null; 489 | } 490 | 491 | /** 492 | * This function returns information about each domain on the server. 493 | * 494 | * WHM API function: Accounts -> get_domain_info 495 | * @link https://documentation.cpanel.net/display/DD/WHM+API+1+Functions+-+get_domain_info 496 | * 497 | * @return Domain[]|null 498 | * @throws ClientExceptions 499 | * @throws Exception 500 | */ 501 | public function getDomains() 502 | { 503 | $params = []; 504 | $result = $this->client->sendRequest("/json-api/get_domain_info", "GET", $params); 505 | 506 | if (empty($result)) { 507 | return null; 508 | } 509 | 510 | if ( ! empty($result['metadata']) && $result['metadata']['result'] === 1) { 511 | $domains = $result['data']['domains']; 512 | 513 | $domainList = []; 514 | foreach ($domains as $domain) { 515 | $do = new Domain(); 516 | $do->setPort(intval($domain['port'])); 517 | $do->setUser($domain['user']); 518 | $do->setDomain($domain['domain']); 519 | $do->setIpv4SSL($domain['ipv4_ssl']); 520 | $do->setIpv6($domain['ipv6']); 521 | $do->setSslPort(intval($domain['port_ssl'])); 522 | $do->setPhpVersion($domain['php_version']); 523 | $do->setUserOwner($domain['user_owner']); 524 | $do->setDomainType($domain['domain_type']); 525 | $do->setIpv6IsDedicated((bool)$domain['ipv6_is_dedicated']); 526 | $do->setIpv4($domain['ipv4']); 527 | $do->setModSecurityEnabled((bool)$domain['modsecurity_enabled']); 528 | $do->setDocRoot($domain['docroot']); 529 | $domainList[] = $do; 530 | } 531 | 532 | return $domainList; 533 | } 534 | 535 | return null; 536 | } 537 | 538 | /** 539 | * Digest Authentication is enabled or disabled for any specific user. 540 | * This function checks whether Digest Authentication is enabled for 541 | * a cPanel user. 542 | * Windows® Vista, Windows® 7, and Windows® 8 require Digest Authentication 543 | * support in order to access Web Disk over an unencrypted connection. 544 | * 545 | * WHM API function: Accounts -> has_digest_auth 546 | * @link https://documentation.cpanel.net/display/DD/WHM+API+1+Functions+-+has_digest_auth 547 | * 548 | * @param $user 549 | * 550 | * @return bool|null 551 | * @throws ClientExceptions 552 | * @throws Exception 553 | */ 554 | public function hasDigestAuth($user) 555 | { 556 | $params = ['user' => $user]; 557 | $result = $this->client->sendRequest("/json-api/has_digest_auth", "GET", $params); 558 | if ( ! empty($result['data'])) { 559 | return $result['data']['digestauth'] === 1 ? true : false; 560 | } 561 | 562 | return null; 563 | } 564 | 565 | /** 566 | * This function enables or disables Digest Authentication for an account. 567 | * Windows Vista®, Windows® 7, and Windows® 8 requires that 568 | * you enable Digest Authentication support in order to access your Web Disk over a clear text, 569 | * unencrypted connection. 570 | * 571 | * WHM API function: Accounts -> set_digest_auth 572 | * @link https://documentation.cpanel.net/display/DD/WHM+API+1+Functions+-+set_digest_auth 573 | * 574 | * @param $user 575 | * @param $password 576 | * @param bool $enableDigestAuth 577 | * 578 | * @return bool 579 | * @throws ClientExceptions 580 | * @throws Exception 581 | */ 582 | public function setDigestAuth($user, $password, $enableDigestAuth = true) 583 | { 584 | $params = ['user' => $user, 'password' => $password, 'digestauth' => (int) $enableDigestAuth]; 585 | $result = $this->client->sendRequest("/json-api/set_digest_auth", "GET", $params); 586 | 587 | if(!empty($result['metadata']) && $result['metadata']['result'] === 0){ 588 | throw new ClientExceptions($result['metadata']['reason']); 589 | } 590 | 591 | if(!empty($result['metadata']) && $result['metadata']['result'] === 1){ 592 | return true; 593 | } 594 | 595 | return false; 596 | } 597 | 598 | /** 599 | * This function checks whether a cPanel user's home directory contains a valid .my.cnf file. 600 | * WHM API function: Accounts -> has_mycnf_for_cpuser 601 | * @link https://documentation.cpanel.net/display/DD/WHM+API+1+Functions+-+has_mycnf_for_cpuser 602 | * 603 | * @param $user 604 | * 605 | * @return bool|null 606 | * @throws ClientExceptions 607 | * @throws Exception 608 | */ 609 | public function hasMyCnfInHomeDirectory($user) 610 | { 611 | $params = ['user' => $user]; 612 | $result = $this->client->sendRequest("/json-api/has_mycnf_for_cpuser", "GET", $params); 613 | if ( ! empty($result['data'])) { 614 | return $result['data']['has_mycnf_for_cpuser'] === 1 ? true : false; 615 | } 616 | 617 | return null; 618 | } 619 | 620 | /** 621 | * Modify a cPanel account's bandwidth quota. 622 | * WHM API function: Accounts -> limitbw 623 | * @link https://documentation.cpanel.net/display/DD/WHM+API+1+Functions+-+limitbw 624 | * 625 | * @param $user 626 | * @param $bwlimit 627 | * 628 | * @return null 629 | * @throws ClientExceptions 630 | * @throws Exception 631 | */ 632 | public function limitBandwidth($user, $bwlimit) 633 | { 634 | $params = ['user' => $user, 'bwlimit' => intval($bwlimit)]; 635 | $result = $this->client->sendRequest("/json-api/limitbw", "GET", $params); 636 | if ( ! empty($result['metadata']) && $result['metadata']['result'] === 1) { 637 | return $result['data']['bwlimits'][0]; 638 | } 639 | 640 | return null; 641 | } 642 | 643 | 644 | /** 645 | * Get lists of the cPanel user accounts and the root user on the server. 646 | * WHM API function: Accounts -> list_users 647 | * @link https://documentation.cpanel.net/display/DD/WHM+API+1+Functions+-+list_users 648 | * 649 | * @return array 650 | * @throws ClientExceptions 651 | * @throws Exception 652 | */ 653 | public function getUsers() 654 | { 655 | $result = $this->client->sendRequest("/json-api/list_users", "GET", []); 656 | if ( ! empty($result['metadata']) && $result['metadata']['result'] === 1) { 657 | return $result['data']['users']; 658 | } 659 | 660 | return []; 661 | } 662 | 663 | /** 664 | * Get a list of locked accounts. 665 | * This function lists locked accounts on the server. Only WHM users with root-level privileges can unsuspend locked accounts. 666 | * 667 | * WHM API function: Accounts -> listlockedaccounts 668 | * @link https://documentation.cpanel.net/display/DD/WHM+API+1+Functions+-+listlockedaccounts 669 | * 670 | * @return array 671 | * @throws ClientExceptions 672 | * @throws Exception 673 | */ 674 | public function getLockedAccounts() 675 | { 676 | $result = $this->client->sendRequest("/json-api/listlockedaccounts", "GET", []); 677 | if ( ! empty($result['metadata']) && $result['metadata']['result'] === 1) { 678 | return $result['data']['account']; 679 | } 680 | 681 | return []; 682 | } 683 | 684 | /** 685 | * Get a list of suspended accounts 686 | * 687 | * WHM API function: listsuspended 688 | * @link https://documentation.cpanel.net/display/DD/WHM+API+1+Functions+-+listsuspended 689 | * 690 | * @return SuspendedAccount[] 691 | * @throws ClientExceptions 692 | * @throws Exception 693 | */ 694 | public function getSuspendedAccounts() 695 | { 696 | $result = $this->client->sendRequest("/json-api/listsuspended", "GET", []); 697 | if ( ! empty($result['metadata']) && $result['metadata']['result'] === 1) { 698 | $suspendList = $result['data']['account']; 699 | 700 | $lists = []; 701 | foreach ($suspendList as $item) { 702 | $sa = new SuspendedAccount(); 703 | $sa->setUser($item['user']); 704 | $sa->setOwner($item['owner']); 705 | $sa->setIsLocked((bool)$item['is_locked']); 706 | $sa->setReason($item['reason']); 707 | $sa->setTime(DateTime::createFromFormat("D M j H:i:s Y", $item['time'])); 708 | $lists[] = $sa; 709 | } 710 | 711 | return $lists; 712 | } 713 | 714 | return []; 715 | } 716 | 717 | /** 718 | * This function modifies a cPanel account. 719 | * You must define the user parameter to identify which account to update. 720 | * All other input parameters are optional, and assign new values to the account. 721 | * If you specify the current value in one of these parameters, no change will occur. 722 | * 723 | * WHM API function: Accounts -> modifyacct 724 | * @link https://documentation.cpanel.net/display/DD/WHM+API+1+Functions+-+modifyacct 725 | * 726 | * @param Account $account 727 | * 728 | * @return bool 729 | * @throws ClientExceptions 730 | * @throws Exception 731 | */ 732 | public function modifyAccount(Account $account) 733 | { 734 | if(empty($account->getUser())){ 735 | throw ClientExceptions::invalidArgument("You must provide username to modify account"); 736 | } 737 | 738 | $params = [ 739 | 'user' => $account->getUser() 740 | ]; 741 | 742 | if($account->isBackupEnabled()){ 743 | $params['BACKUP'] = 1; 744 | } 745 | 746 | if($account->getBandwidthLimit() === -1){ 747 | $params['BWLIMIT'] = "unlimited"; 748 | } 749 | 750 | if(!empty($account->getDomain())){ 751 | $params['DNS'] = $account->getDomain(); 752 | } 753 | 754 | if(!empty($account->isCgiEnable())){ 755 | $params['HASCGI'] = (int) $account->isCgiEnable(); 756 | } 757 | 758 | if(!empty($account->getMaxAddonDomains())){ 759 | $params['MAXADDON'] = $account->getMaxAddonDomains() === -1 ? "unlimited" : intval($account->getMaxAddonDomains()); 760 | } 761 | 762 | if(!empty($account->getMaxFTP())){ 763 | $params['MAXFTP'] = $account->getMaxFTP() === -1 ? "unlimited" : intval($account->getMaxFTP()); 764 | } 765 | 766 | if(!empty($account->getMaxMailingList())){ 767 | $params['MAXLST'] = $account->getMaxMailingList() === -1 ? "unlimited" : intval($account->getMaxMailingList()); 768 | } 769 | 770 | if(!empty($account->getMaxParkedDomains())){ 771 | $params['MAXPARK'] = $account->getMaxParkedDomains() === -1 ? "unlimited" : intval($account->getMaxParkedDomains()); 772 | } 773 | 774 | if(!empty($account->getMaxPOP())){ 775 | $params['MAXPOP'] = $account->getMaxPOP() === -1 ? "unlimited" : null; 776 | } 777 | 778 | if(!empty($account->getMaxSQL())){ 779 | $params['MAXSQL'] = $account->getMaxSQL() === -1 ? "unlimited" : intval($account->getMaxSQL()); 780 | } 781 | 782 | if(!empty($account->getMaxSubDomain())){ 783 | $params['MAXSUB'] = $account->getMaxSubDomain() === -1 ? "unlimited" : intval($account->getMaxSubDomain()); 784 | } 785 | 786 | if(!empty($account->getMaxEmailPerHour())){ 787 | $params['MAX_EMAIL_PER_HOUR'] = $account->getMaxEmailPerHour() === -1 ? "unlimited" : intval($account->getMaxEmailPerHour()); 788 | } 789 | if(!empty($account->getMaxEmailAccountQuota())){ 790 | $params['MAX_EMAILACCT_QUOTA'] = $account->getMaxEmailAccountQuota() === -1 ? "unlimited" : intval($account->getMaxDeferFailMailPercentage()); 791 | } 792 | 793 | if(!empty($account->getMaxDeferFailMailPercentage())){ 794 | $params['MAX_DEFER_FAIL_PERCENTAGE'] = $account->getMaxDeferFailMailPercentage() === -1 ? "unlimited" : intval($account->getMaxDeferFailMailPercentage()); 795 | } 796 | 797 | if(!empty($account->getOwner())){ 798 | $params['owner'] = $account->getOwner(); 799 | } 800 | 801 | if(!empty($account->getDiskLimit())){ 802 | $params['QUOTA'] = $account->getDiskLimit() === -1 ? "unlimited" : intval($account->getDiskLimit()); 803 | } 804 | 805 | if($account->isSpamAssassinEnable()){ 806 | $params['spamassassin'] = (int) $account->isSpamAssassinEnable(); 807 | } 808 | 809 | if($account->isFrontPageEnable()){ 810 | $params['frontpage'] = (int) $account->isFrontPageEnable(); 811 | } 812 | 813 | if(!empty($account->getTheme())){ 814 | $params['RS'] = $account->getTheme(); 815 | } 816 | 817 | if(!empty($account->getIpAddress())){ 818 | $params['IP'] = $account->getIpAddress(); 819 | } 820 | 821 | if(!empty($account->getLanguagePreference())){ 822 | $params['LANG'] = $account->getLanguagePreference(); 823 | } 824 | 825 | if(!empty($account->getMailboxFormat())){ 826 | $params['MAILBOX_FORMAT'] = $account->getMailboxFormat(); 827 | } 828 | 829 | if(is_bool($account->isOutgoingMailSuspended())){ 830 | $params['OUTGOING_EMAIL_SUSPENDED'] = (int) $account->isOutgoingMailSuspended(); 831 | } 832 | 833 | $result = $this->client->sendRequest("/json-api/modifyacct", "GET", $params); 834 | if(!empty($result['metadata']) && $result['metadata']['result'] === 1){ 835 | return true; 836 | } 837 | 838 | if(!empty($result['metadata']) && $result['metadata']['result'] === 0){ 839 | throw new ClientExceptions($result['metadata']['reason']); 840 | } 841 | 842 | return false; 843 | } 844 | 845 | /** 846 | * WHM API function: Accounts -> passwd 847 | * @link https://documentation.cpanel.net/display/DD/WHM+API+1+Functions+-+passwd 848 | * 849 | * @param $user 850 | * @param $newPassword 851 | * @param null $digestAuth 852 | * @param bool $dbPassUpdate 853 | * 854 | * @return null|array 855 | * @throws ClientExceptions 856 | * @throws Exception 857 | */ 858 | public function changePassword($user, $newPassword, $digestAuth = null, $dbPassUpdate = false) 859 | { 860 | $params = [ 861 | 'user' => $user, 862 | 'password' => $newPassword 863 | ]; 864 | 865 | if(isset($digestAuth)){ 866 | $params['digestauth'] = (int) $digestAuth; 867 | } 868 | 869 | if(isset($dbPassUpdate)){ 870 | $params['db_pass_update'] = (int) $dbPassUpdate; 871 | } 872 | 873 | $result = $this->client->sendRequest("/json-api/passwd", "GET", $params); 874 | 875 | if(!empty($result['metadata']) && $result['metadata']['result'] === 0){ 876 | throw new ClientExceptions($result['metadata']['reason']); 877 | } 878 | 879 | if(!empty($result['metadata']) && $result['metadata']['result'] === 1){ 880 | return $result['data']['app']; 881 | } 882 | 883 | return null; 884 | } 885 | 886 | /** 887 | * This function deletes a cPanel or WHM account. 888 | * 889 | * WHM API function: Accounts -> removeacct 890 | * @link https://documentation.cpanel.net/display/DD/WHM+API+1+Functions+-+removeacct 891 | * @param $username 892 | * @param bool $keepDNS 893 | * 894 | * @return bool 895 | * @throws ClientExceptions 896 | * @throws Exception 897 | */ 898 | public function remove($username, $keepDNS = false) 899 | { 900 | $params = ['user' => $username, 'keepdns' => (int) $keepDNS]; 901 | $result = $this->client->sendRequest("/json-api/removeacct", "GET", $params); 902 | 903 | if(!empty($result['metadata']) && $result['metadata']['result'] === 0){ 904 | throw new ClientExceptions($result['metadata']['reason']); 905 | } 906 | 907 | if(!empty($result['metadata']) && $result['metadata']['result'] === 1){ 908 | return true; 909 | } 910 | 911 | return false; 912 | } 913 | 914 | /** 915 | * This function retrieves account bandwidth information. 916 | * WHM API function: Accounts -> showbw 917 | * @link https://documentation.cpanel.net/display/DD/WHM+API+1+Functions+-+showbw 918 | * 919 | * @param null $month 920 | * @param null $year 921 | * @param null $resellerUsername 922 | * @param null $searchKeyword 923 | * @param null $searchType 924 | * 925 | * @return array 926 | * @throws ClientExceptions 927 | * @throws Exception 928 | */ 929 | public function getBandwidthInfo($month = null, $year = null, $resellerUsername = null, $searchKeyword = null, $searchType = null) 930 | { 931 | $params = []; 932 | if(!empty($searchKeyword)){ 933 | $params['search'] = $searchKeyword; 934 | } 935 | 936 | if(!empty($searchType) && !in_array($searchType, ["domain", "user", "owner", "ip", "package"])){ 937 | throw new ClientExceptions("searchType must be one of domain, user, owner, ip and package"); 938 | } 939 | 940 | if(!empty($searchType)){ 941 | $params['searchtype'] = $searchType; 942 | } 943 | 944 | if(!empty($month) && !is_int($month)){ 945 | throw new ClientExceptions("month must be an integer"); 946 | } 947 | if(!empty($month)){ 948 | $params['month'] = intval($month); 949 | } 950 | 951 | if(!empty($year) && !is_int($year)){ 952 | throw new ClientExceptions("year must be an integer"); 953 | } 954 | 955 | if(!empty($year)){ 956 | $params['year'] = intval($year); 957 | } 958 | 959 | if(!empty($resellerUsername)){ 960 | $params['showres'] = $resellerUsername; 961 | } 962 | 963 | $result = $this->client->sendRequest("/json-api/showbw", "GET", $params); 964 | 965 | if(!empty($result['metadata']) && $result['metadata']['result'] === 0){ 966 | throw new ClientExceptions($result['metadata']['reason']); 967 | } 968 | 969 | if(!empty($result['metadata']) && $result['metadata']['result'] === 1) { 970 | return $result['data']['acct']; 971 | } 972 | 973 | return []; 974 | } 975 | 976 | /** 977 | * This function suspends an account. Suspension denies the user access to the account. Unlike account deletion, you can reverse account suspension. 978 | * WHM API function: Accounts->suspendacct 979 | * @link https://documentation.cpanel.net/display/DD/WHM+API+1+Functions+-+suspendacct 980 | * 981 | * @param $user 982 | * @param $reason 983 | * @param bool $disallowUnsuspension 984 | * 985 | * @return bool 986 | * @throws ClientExceptions 987 | * @throws Exception 988 | */ 989 | public function suspend($user, $reason, $disallowUnsuspension = true) 990 | { 991 | $params = ['user' => $user, 'reason' => $reason, 'disallowun' => (int) $disallowUnsuspension]; 992 | $result = $this->client->sendRequest("/json-api/suspendacct", "GET", $params); 993 | 994 | if(!empty($result['metadata']) && $result['metadata']['result'] === 0){ 995 | throw new ClientExceptions($result['metadata']['reason']); 996 | } 997 | 998 | if(!empty($result['metadata']) && $result['metadata']['result'] === 1){ 999 | return true; 1000 | } 1001 | 1002 | return false; 1003 | } 1004 | 1005 | /** 1006 | * This function unsuspends an account. 1007 | * WHM API function: Accounts -> unsuspendacct 1008 | * @link https://documentation.cpanel.net/display/DD/WHM+API+1+Functions+-+unsuspendacct 1009 | * 1010 | * @param $user 1011 | * 1012 | * @return bool 1013 | * @throws ClientExceptions 1014 | * @throws Exception 1015 | */ 1016 | public function unsuspend($user) 1017 | { 1018 | $params = ['user' => $user]; 1019 | $result = $this->client->sendRequest("/json-api/unsuspendacct", "GET", $params); 1020 | 1021 | if(!empty($result['metadata']) && $result['metadata']['result'] === 0){ 1022 | throw new ClientExceptions($result['metadata']['reason']); 1023 | } 1024 | 1025 | if(!empty($result['metadata']) && $result['metadata']['result'] === 1){ 1026 | return true; 1027 | } 1028 | 1029 | return false; 1030 | } 1031 | 1032 | /** 1033 | * This function checks for username conflicts during account creation. 1034 | * WHM API function: verify_new_username 1035 | * @link https://documentation.cpanel.net/display/DD/WHM+API+1+Functions+-+verify_new_username 1036 | * 1037 | * @param $username 1038 | * 1039 | * @return bool 1040 | * @throws ClientExceptions 1041 | * @throws Exception 1042 | */ 1043 | public function validateNewUsername($username) 1044 | { 1045 | $params = ['user' => $username]; 1046 | $result = $this->client->sendRequest("/json-api/verify_new_username", "GET", $params); 1047 | 1048 | if(!empty($result['metadata']) && $result['metadata']['result'] === 0){ 1049 | throw new ClientExceptions($result['metadata']['reason']); 1050 | } 1051 | 1052 | if(!empty($result['metadata']) && $result['metadata']['result'] === 1){ 1053 | return true; 1054 | } 1055 | } 1056 | 1057 | /** 1058 | * This generates a URL for one-click login to cPanel. 1059 | * 1060 | * You can replace $service with a supported service, defaults to cPanel 1061 | * $app when set to something invalid will send the user to the cPanel home page, you 1062 | * can set it to anything valid to override the default of 'home' 1063 | * 1064 | * @link https://documentation.cpanel.net/display/DD/WHM+API+1+Functions+-+create_user_session 1065 | * 1066 | * @param $username 1067 | * @param string $service 1068 | * @param string $app 1069 | * 1070 | * @return mixed|\Psr\Http\Message\ResponseInterface 1071 | * @throws ClientExceptions 1072 | * @throws Exception 1073 | */ 1074 | public function createUserSession($username, $service = 'cpaneld', $app = 'home') 1075 | { 1076 | $params = ['user' => $username, 'service' => $service, 'app' => $app]; 1077 | 1078 | $result = $this->client->sendRequest('/json-api/create_user_session', 'GET', $params); 1079 | 1080 | if(!empty($result['metadata']) && $result['metadata']['result'] === 0){ 1081 | throw new ClientExceptions($result['metadata']['reason']); 1082 | } 1083 | 1084 | return $result; 1085 | } 1086 | 1087 | /** 1088 | * This changes the plan set on the account 1089 | * 1090 | * This is purely for changing the plan of the account 1091 | * 1092 | * @link https://documentation.cpanel.net/display/DD/WHM+API+1+Functions+-+modifyacct 1093 | * 1094 | * @param $username 1095 | * @param $plan 1096 | * 1097 | * @return mixed|\Psr\Http\Message\ResponseInterface 1098 | * @throws ClientExceptions 1099 | * @throws Exception 1100 | */ 1101 | public function changePlan($username, $plan) 1102 | { 1103 | $params = ['user' => $username, 'pkg' => $plan]; 1104 | 1105 | $result = $this->client->sendRequest('/json-api/changepackage', 'GET', $params); 1106 | 1107 | if(!empty($result['metadata']) && $result['metadata']['result'] === 0){ 1108 | throw new ClientExceptions($result['metadata']['reason']); 1109 | } 1110 | 1111 | return $result; 1112 | } 1113 | } 1114 | -------------------------------------------------------------------------------- /src/WHMClient.php: -------------------------------------------------------------------------------- 1 | whmUser = $whmUser; 52 | $this->apiToken = $apiToken; 53 | $this->whmHost = $whmHost; 54 | $this->whmPort = $whmPort; 55 | 56 | $client = Client::createWithConfig(['timeout' => 120]); 57 | $this->setHttpClient($client); 58 | $this->httpClient = $this->getHttpClient(); 59 | } 60 | 61 | /** 62 | * 63 | * @param HttpClient $client 64 | * 65 | * @return WHMClient 66 | */ 67 | public function setHttpClient(HttpClient $client) 68 | { 69 | $this->httpClient = $client; 70 | 71 | return $this; 72 | } 73 | 74 | /** 75 | * 76 | * @return HttpClient 77 | */ 78 | public function getHttpClient() 79 | { 80 | return $this->httpClient; 81 | } 82 | 83 | /** 84 | * 85 | * @param $endpoint 86 | * @param $method 87 | * @param array $params 88 | * 89 | * @return mixed|\Psr\Http\Message\ResponseInterface 90 | * @throws ClientExceptions 91 | * @throws \Http\Client\Exception 92 | */ 93 | public function sendRequest($endpoint, $method, array $params = []) 94 | { 95 | $params = array_merge(['api.version' => 1], $params); 96 | $queryParams = http_build_query($params); 97 | 98 | $url = sprintf("https://%s:%s%s", $this->whmHost, $this->whmPort, $endpoint); 99 | 100 | $request = new Request($method, $url . "?" . $queryParams); 101 | $request = $request->withHeader("Authorization", "whm {$this->whmUser}:{$this->apiToken}"); 102 | 103 | $response = $this->httpClient->sendRequest($request); 104 | 105 | $data = []; 106 | if (strpos($response->getHeaderLine("Content-Type"), "application/json") === 0) { 107 | $data = json_decode((string)$response->getBody(), true); 108 | } elseif (strpos($response->getHeaderLine("Content-Type"), "text/plain") === 0) { 109 | $data = json_decode((string)$response->getBody(), true); 110 | } 111 | 112 | if (array_key_exists("status", $data) && $data['status'] === 0) { 113 | throw ClientExceptions::accessDenied(!empty($data['statusmsg']) ? $data['statusmsg'] : null); 114 | } 115 | 116 | if ($response->getStatusCode() === 403) { 117 | if (!empty($data['cpanelresult']['error'])) { 118 | throw ClientExceptions::accessDenied( 119 | $data['cpanelresult']['error'], 120 | $data['cpanelresult']['data']['reason'] 121 | ); 122 | } 123 | } 124 | 125 | return $data; 126 | } 127 | } 128 | -------------------------------------------------------------------------------- /tests/WHMClientTest.php: -------------------------------------------------------------------------------- 1 | assertTrue($whmClient instanceof WHMClient); 20 | } 21 | 22 | public function testSetHttpClient() 23 | { 24 | $this->httpClientResponseTest(['test' => 1], ['Content-Type' => "text/plain"]); 25 | $this->httpClientResponseTest(['test' => 1], ['Content-Type' => "application/json"]); 26 | } 27 | 28 | /** 29 | * @throws \Http\Client\Exception 30 | * @throws \PreviewTechs\cPanelWHM\Exceptions\ClientExceptions 31 | * 32 | * @expectedException \PreviewTechs\cPanelWHM\Exceptions\ClientExceptions 33 | */ 34 | public function testSendRequestWithBadCredsAndThrowException() 35 | { 36 | $fakeResponseArray = array ( 37 | 'cpanelresult' => 38 | array ( 39 | 'apiversion' => '2', 40 | 'error' => 'Access denied', 41 | 'data' => 42 | array ( 43 | 'reason' => 'Access denied', 44 | 'result' => '0', 45 | ), 46 | 'type' => 'text', 47 | ), 48 | ); 49 | $whmClient = new WHMClient("FAKE_USER", "FAKE_TOKEN", "FAKE_HOST", 2087); 50 | 51 | $client = new Client(); 52 | $response = new Response(403, ['Content-Type' => "text/plain"], json_encode($fakeResponseArray)); 53 | $response = $response->withStatus(403); 54 | $client->addResponse($response); 55 | $whmClient->setHttpClient($client); 56 | 57 | $whmClient->sendRequest("/fake_endpoint", "GET", []); 58 | } 59 | 60 | protected function httpClientResponseTest(array $responseArray = [], array $headers = []) 61 | { 62 | $whmClient = new WHMClient("FAKE_USER", "FAKE_TOKEN", "FAKE_HOST", 2087); 63 | 64 | $client = new Client(); 65 | $response = new Response(200, $headers, json_encode($responseArray)); 66 | $client->addResponse($response); 67 | $whmClient->setHttpClient($client); 68 | 69 | $result = $whmClient->sendRequest("/fake_endpoint", "GET", []); 70 | $this->assertTrue(is_array($result)); 71 | $this->assertEquals($responseArray, $result); 72 | } 73 | } --------------------------------------------------------------------------------