├── .gitignore ├── LICENSE ├── README.md ├── README.rst ├── composer.json ├── composer.lock ├── docs ├── Makefile ├── make.bat └── source │ ├── api.rst │ ├── conf.py │ ├── index.rst │ └── usage.rst ├── index.rst ├── phpunit.xml ├── src ├── DiscordWebhook.php ├── Exception │ └── InvalidResponseException.php └── Message │ ├── EmbedMessage.php │ ├── FileMessage.php │ ├── Message.php │ ├── MessageFactory.php │ └── TextMessage.php └── tests └── MessageFactoryTest.php /.gitignore: -------------------------------------------------------------------------------- 1 | vendor 2 | .idea 3 | .phpunit.result.cache 4 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2022 Atakan Demircioğlu 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # discord-webhook-php 2 | 3 | A php package for sending message to discord with webhook. Supports both text and embed messages types. 4 | 5 | ## Installation 6 | 7 | Install via composer 8 | 9 | ```bash 10 | composer require atakde/discord-webhook-php 11 | ``` 12 | 13 | ## Usage (Text Message) 14 | 15 | ```php 16 | 17 | require 'vendor/autoload.php'; 18 | 19 | use Atakde\DiscordWebhook\DiscordWebhook; 20 | use Atakde\DiscordWebhook\Message\MessageFactory; 21 | 22 | $messageFactory = new MessageFactory(); 23 | $textMessage = $messageFactory->create('text'); 24 | $textMessage->setUsername("John Doe"); 25 | $textMessage->setContent("Hello World!"); 26 | 27 | $webhook = new DiscordWebhook($textMessage); 28 | $webhook->setWebhookUrl("https://discord.com/api/..."); 29 | $webhook->send(); 30 | 31 | ``` 32 | 33 | ## Usage (Embed Message) 34 | 35 | ```php 36 | $embedMessage = $messageFactory->create('embed'); 37 | $embedMessage->setAvatarUrl("https://doodleipsum.com/700?i=f8b1abea359b643310916a38aa0b0562"); 38 | $embedMessage->setContent("Hello World!"); 39 | $embedMessage->setUsername("John Doe"); 40 | $embedMessage->setTitle("Title"); 41 | $embedMessage->setDescription("Description"); 42 | $embedMessage->setUrl("https://doodleipsum.com/700?i=f8b1abea359b643310916a38aa0b0562"); 43 | $embedMessage->setColor(0x00ff00); 44 | $embedMessage->setTimestamp(date("Y-m-d", strtotime("now"))); 45 | $embedMessage->setFooterIcon("https://doodleipsum.com/700?i=f8b1abea359b643310916a38aa0b0562"); 46 | $embedMessage->setFooterText("Footer Text"); 47 | $embedMessage->setImageUrl("https://doodleipsum.com/700?i=f8b1abea359b643310916a38aa0b0562"); 48 | $embedMessage->setThumbnailUrl("https://doodleipsum.com/700?i=f8b1abea359b643310916a38aa0b0562"); 49 | $embedMessage->setAuthorName("Author Name"); 50 | $embedMessage->setAuthorUrl("https://doodleipsum.com/700?i=f8b1abea359b643310916a38aa0b0562"); 51 | $embedMessage->setAuthorIcon("https://doodleipsum.com/700?i=f8b1abea359b643310916a38aa0b0562"); 52 | $embedMessage->setFields([ 53 | [ 54 | 'name' => 'Field 1', 55 | 'value' => 'Value 1', 56 | 'inline' => true 57 | ], 58 | [ 59 | 'name' => 'Field 2', 60 | 'value' => 'Value 2', 61 | 'inline' => false 62 | ] 63 | ]); 64 | 65 | $webhook = new DiscordWebhook($embedMessage); 66 | $webhook->setWebhookUrl("https://discord.com/api/..."); 67 | $webhook->send(); 68 | ``` 69 | 70 | ## Usage (File Message) 71 | 72 | ```php 73 | $messageFactory = new MessageFactory(); 74 | $fileMessage = $messageFactory->create('file'); 75 | $fileMessage->setUsername('Atakde'); 76 | $fileMessage->setContent('Hello World!'); 77 | $fileMessage->setAvatarUrl('https://avatars.githubusercontent.com/u/25267804?v=4'); 78 | $fileMessage->setTts(false); 79 | $fileMessage->setFileFromURL('https://avatars.githubusercontent.com/u/25267804?v=4'); 80 | 81 | $webhook = new DiscordWebhook($fileMessage); 82 | $webhook->setWebhookUrl("https://discord.com/api/..."); 83 | $webhook->send(); 84 | ``` 85 | -------------------------------------------------------------------------------- /README.rst: -------------------------------------------------------------------------------- 1 | .. meta:: 2 | :description: A php package for sending message to discord with webhook. 3 | :keywords: php, discord, discord-webhook, discord-webhook-php, webhook, webhook-php 4 | 5 | .. discord-webhook-php 6 | 7 | ================= 8 | discord-webhook-php 9 | ================= 10 | 11 | .. image:: https://readthedocs.org/projects/discord-webhook-php/badge/?version=latest 12 | :target: https://readthedocs.org/projects/discord-webhook-php/?badge=latest 13 | :alt: Documentation Status 14 | -------------------------------------------------------------------------------- /composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "atakde/discord-webhook-php", 3 | "description": "discord webhook php", 4 | "keywords": [ 5 | "discord", 6 | "webhook", 7 | "php" 8 | ], 9 | "license": "MIT", 10 | "authors": [ 11 | { 12 | "name": "Atakan Demircioğlu", 13 | "homepage": "https://atakann.com/" 14 | } 15 | ], 16 | "require": { 17 | "php": ">=8.0.9", 18 | "ext-curl": "*" 19 | }, 20 | "require-dev": { 21 | "phpunit/phpunit": "^9.5" 22 | }, 23 | "autoload": { 24 | "psr-4": { 25 | "Atakde\\DiscordWebhook\\": "src" 26 | } 27 | }, 28 | "autoload-dev": { 29 | "psr-4": { 30 | "Atakde\\DiscordWebhook\\Tests\\": "tests/" 31 | } 32 | }, 33 | "scripts": { 34 | "test": "./vendor/bin/phpunit", 35 | "coverage": "vendor/bin/phpunit --coverage-html coverage" 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /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": "d06115d09d66e7f06c0dbbbd6cb602ee", 8 | "packages": [], 9 | "packages-dev": [ 10 | { 11 | "name": "doctrine/instantiator", 12 | "version": "2.0.0", 13 | "source": { 14 | "type": "git", 15 | "url": "https://github.com/doctrine/instantiator.git", 16 | "reference": "c6222283fa3f4ac679f8b9ced9a4e23f163e80d0" 17 | }, 18 | "dist": { 19 | "type": "zip", 20 | "url": "https://api.github.com/repos/doctrine/instantiator/zipball/c6222283fa3f4ac679f8b9ced9a4e23f163e80d0", 21 | "reference": "c6222283fa3f4ac679f8b9ced9a4e23f163e80d0", 22 | "shasum": "" 23 | }, 24 | "require": { 25 | "php": "^8.1" 26 | }, 27 | "require-dev": { 28 | "doctrine/coding-standard": "^11", 29 | "ext-pdo": "*", 30 | "ext-phar": "*", 31 | "phpbench/phpbench": "^1.2", 32 | "phpstan/phpstan": "^1.9.4", 33 | "phpstan/phpstan-phpunit": "^1.3", 34 | "phpunit/phpunit": "^9.5.27", 35 | "vimeo/psalm": "^5.4" 36 | }, 37 | "type": "library", 38 | "autoload": { 39 | "psr-4": { 40 | "Doctrine\\Instantiator\\": "src/Doctrine/Instantiator/" 41 | } 42 | }, 43 | "notification-url": "https://packagist.org/downloads/", 44 | "license": [ 45 | "MIT" 46 | ], 47 | "authors": [ 48 | { 49 | "name": "Marco Pivetta", 50 | "email": "ocramius@gmail.com", 51 | "homepage": "https://ocramius.github.io/" 52 | } 53 | ], 54 | "description": "A small, lightweight utility to instantiate objects in PHP without invoking their constructors", 55 | "homepage": "https://www.doctrine-project.org/projects/instantiator.html", 56 | "keywords": [ 57 | "constructor", 58 | "instantiate" 59 | ], 60 | "support": { 61 | "issues": "https://github.com/doctrine/instantiator/issues", 62 | "source": "https://github.com/doctrine/instantiator/tree/2.0.0" 63 | }, 64 | "funding": [ 65 | { 66 | "url": "https://www.doctrine-project.org/sponsorship.html", 67 | "type": "custom" 68 | }, 69 | { 70 | "url": "https://www.patreon.com/phpdoctrine", 71 | "type": "patreon" 72 | }, 73 | { 74 | "url": "https://tidelift.com/funding/github/packagist/doctrine%2Finstantiator", 75 | "type": "tidelift" 76 | } 77 | ], 78 | "time": "2022-12-30T00:23:10+00:00" 79 | }, 80 | { 81 | "name": "myclabs/deep-copy", 82 | "version": "1.11.1", 83 | "source": { 84 | "type": "git", 85 | "url": "https://github.com/myclabs/DeepCopy.git", 86 | "reference": "7284c22080590fb39f2ffa3e9057f10a4ddd0e0c" 87 | }, 88 | "dist": { 89 | "type": "zip", 90 | "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/7284c22080590fb39f2ffa3e9057f10a4ddd0e0c", 91 | "reference": "7284c22080590fb39f2ffa3e9057f10a4ddd0e0c", 92 | "shasum": "" 93 | }, 94 | "require": { 95 | "php": "^7.1 || ^8.0" 96 | }, 97 | "conflict": { 98 | "doctrine/collections": "<1.6.8", 99 | "doctrine/common": "<2.13.3 || >=3,<3.2.2" 100 | }, 101 | "require-dev": { 102 | "doctrine/collections": "^1.6.8", 103 | "doctrine/common": "^2.13.3 || ^3.2.2", 104 | "phpunit/phpunit": "^7.5.20 || ^8.5.23 || ^9.5.13" 105 | }, 106 | "type": "library", 107 | "autoload": { 108 | "files": [ 109 | "src/DeepCopy/deep_copy.php" 110 | ], 111 | "psr-4": { 112 | "DeepCopy\\": "src/DeepCopy/" 113 | } 114 | }, 115 | "notification-url": "https://packagist.org/downloads/", 116 | "license": [ 117 | "MIT" 118 | ], 119 | "description": "Create deep copies (clones) of your objects", 120 | "keywords": [ 121 | "clone", 122 | "copy", 123 | "duplicate", 124 | "object", 125 | "object graph" 126 | ], 127 | "support": { 128 | "issues": "https://github.com/myclabs/DeepCopy/issues", 129 | "source": "https://github.com/myclabs/DeepCopy/tree/1.11.1" 130 | }, 131 | "funding": [ 132 | { 133 | "url": "https://tidelift.com/funding/github/packagist/myclabs/deep-copy", 134 | "type": "tidelift" 135 | } 136 | ], 137 | "time": "2023-03-08T13:26:56+00:00" 138 | }, 139 | { 140 | "name": "nikic/php-parser", 141 | "version": "v4.16.0", 142 | "source": { 143 | "type": "git", 144 | "url": "https://github.com/nikic/PHP-Parser.git", 145 | "reference": "19526a33fb561ef417e822e85f08a00db4059c17" 146 | }, 147 | "dist": { 148 | "type": "zip", 149 | "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/19526a33fb561ef417e822e85f08a00db4059c17", 150 | "reference": "19526a33fb561ef417e822e85f08a00db4059c17", 151 | "shasum": "" 152 | }, 153 | "require": { 154 | "ext-tokenizer": "*", 155 | "php": ">=7.0" 156 | }, 157 | "require-dev": { 158 | "ircmaxell/php-yacc": "^0.0.7", 159 | "phpunit/phpunit": "^6.5 || ^7.0 || ^8.0 || ^9.0" 160 | }, 161 | "bin": [ 162 | "bin/php-parse" 163 | ], 164 | "type": "library", 165 | "extra": { 166 | "branch-alias": { 167 | "dev-master": "4.9-dev" 168 | } 169 | }, 170 | "autoload": { 171 | "psr-4": { 172 | "PhpParser\\": "lib/PhpParser" 173 | } 174 | }, 175 | "notification-url": "https://packagist.org/downloads/", 176 | "license": [ 177 | "BSD-3-Clause" 178 | ], 179 | "authors": [ 180 | { 181 | "name": "Nikita Popov" 182 | } 183 | ], 184 | "description": "A PHP parser written in PHP", 185 | "keywords": [ 186 | "parser", 187 | "php" 188 | ], 189 | "support": { 190 | "issues": "https://github.com/nikic/PHP-Parser/issues", 191 | "source": "https://github.com/nikic/PHP-Parser/tree/v4.16.0" 192 | }, 193 | "time": "2023-06-25T14:52:30+00:00" 194 | }, 195 | { 196 | "name": "phar-io/manifest", 197 | "version": "2.0.3", 198 | "source": { 199 | "type": "git", 200 | "url": "https://github.com/phar-io/manifest.git", 201 | "reference": "97803eca37d319dfa7826cc2437fc020857acb53" 202 | }, 203 | "dist": { 204 | "type": "zip", 205 | "url": "https://api.github.com/repos/phar-io/manifest/zipball/97803eca37d319dfa7826cc2437fc020857acb53", 206 | "reference": "97803eca37d319dfa7826cc2437fc020857acb53", 207 | "shasum": "" 208 | }, 209 | "require": { 210 | "ext-dom": "*", 211 | "ext-phar": "*", 212 | "ext-xmlwriter": "*", 213 | "phar-io/version": "^3.0.1", 214 | "php": "^7.2 || ^8.0" 215 | }, 216 | "type": "library", 217 | "extra": { 218 | "branch-alias": { 219 | "dev-master": "2.0.x-dev" 220 | } 221 | }, 222 | "autoload": { 223 | "classmap": [ 224 | "src/" 225 | ] 226 | }, 227 | "notification-url": "https://packagist.org/downloads/", 228 | "license": [ 229 | "BSD-3-Clause" 230 | ], 231 | "authors": [ 232 | { 233 | "name": "Arne Blankerts", 234 | "email": "arne@blankerts.de", 235 | "role": "Developer" 236 | }, 237 | { 238 | "name": "Sebastian Heuer", 239 | "email": "sebastian@phpeople.de", 240 | "role": "Developer" 241 | }, 242 | { 243 | "name": "Sebastian Bergmann", 244 | "email": "sebastian@phpunit.de", 245 | "role": "Developer" 246 | } 247 | ], 248 | "description": "Component for reading phar.io manifest information from a PHP Archive (PHAR)", 249 | "support": { 250 | "issues": "https://github.com/phar-io/manifest/issues", 251 | "source": "https://github.com/phar-io/manifest/tree/2.0.3" 252 | }, 253 | "time": "2021-07-20T11:28:43+00:00" 254 | }, 255 | { 256 | "name": "phar-io/version", 257 | "version": "3.2.1", 258 | "source": { 259 | "type": "git", 260 | "url": "https://github.com/phar-io/version.git", 261 | "reference": "4f7fd7836c6f332bb2933569e566a0d6c4cbed74" 262 | }, 263 | "dist": { 264 | "type": "zip", 265 | "url": "https://api.github.com/repos/phar-io/version/zipball/4f7fd7836c6f332bb2933569e566a0d6c4cbed74", 266 | "reference": "4f7fd7836c6f332bb2933569e566a0d6c4cbed74", 267 | "shasum": "" 268 | }, 269 | "require": { 270 | "php": "^7.2 || ^8.0" 271 | }, 272 | "type": "library", 273 | "autoload": { 274 | "classmap": [ 275 | "src/" 276 | ] 277 | }, 278 | "notification-url": "https://packagist.org/downloads/", 279 | "license": [ 280 | "BSD-3-Clause" 281 | ], 282 | "authors": [ 283 | { 284 | "name": "Arne Blankerts", 285 | "email": "arne@blankerts.de", 286 | "role": "Developer" 287 | }, 288 | { 289 | "name": "Sebastian Heuer", 290 | "email": "sebastian@phpeople.de", 291 | "role": "Developer" 292 | }, 293 | { 294 | "name": "Sebastian Bergmann", 295 | "email": "sebastian@phpunit.de", 296 | "role": "Developer" 297 | } 298 | ], 299 | "description": "Library for handling version information and constraints", 300 | "support": { 301 | "issues": "https://github.com/phar-io/version/issues", 302 | "source": "https://github.com/phar-io/version/tree/3.2.1" 303 | }, 304 | "time": "2022-02-21T01:04:05+00:00" 305 | }, 306 | { 307 | "name": "phpunit/php-code-coverage", 308 | "version": "9.2.27", 309 | "source": { 310 | "type": "git", 311 | "url": "https://github.com/sebastianbergmann/php-code-coverage.git", 312 | "reference": "b0a88255cb70d52653d80c890bd7f38740ea50d1" 313 | }, 314 | "dist": { 315 | "type": "zip", 316 | "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/b0a88255cb70d52653d80c890bd7f38740ea50d1", 317 | "reference": "b0a88255cb70d52653d80c890bd7f38740ea50d1", 318 | "shasum": "" 319 | }, 320 | "require": { 321 | "ext-dom": "*", 322 | "ext-libxml": "*", 323 | "ext-xmlwriter": "*", 324 | "nikic/php-parser": "^4.15", 325 | "php": ">=7.3", 326 | "phpunit/php-file-iterator": "^3.0.3", 327 | "phpunit/php-text-template": "^2.0.2", 328 | "sebastian/code-unit-reverse-lookup": "^2.0.2", 329 | "sebastian/complexity": "^2.0", 330 | "sebastian/environment": "^5.1.2", 331 | "sebastian/lines-of-code": "^1.0.3", 332 | "sebastian/version": "^3.0.1", 333 | "theseer/tokenizer": "^1.2.0" 334 | }, 335 | "require-dev": { 336 | "phpunit/phpunit": "^9.3" 337 | }, 338 | "suggest": { 339 | "ext-pcov": "PHP extension that provides line coverage", 340 | "ext-xdebug": "PHP extension that provides line coverage as well as branch and path coverage" 341 | }, 342 | "type": "library", 343 | "extra": { 344 | "branch-alias": { 345 | "dev-master": "9.2-dev" 346 | } 347 | }, 348 | "autoload": { 349 | "classmap": [ 350 | "src/" 351 | ] 352 | }, 353 | "notification-url": "https://packagist.org/downloads/", 354 | "license": [ 355 | "BSD-3-Clause" 356 | ], 357 | "authors": [ 358 | { 359 | "name": "Sebastian Bergmann", 360 | "email": "sebastian@phpunit.de", 361 | "role": "lead" 362 | } 363 | ], 364 | "description": "Library that provides collection, processing, and rendering functionality for PHP code coverage information.", 365 | "homepage": "https://github.com/sebastianbergmann/php-code-coverage", 366 | "keywords": [ 367 | "coverage", 368 | "testing", 369 | "xunit" 370 | ], 371 | "support": { 372 | "issues": "https://github.com/sebastianbergmann/php-code-coverage/issues", 373 | "security": "https://github.com/sebastianbergmann/php-code-coverage/security/policy", 374 | "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/9.2.27" 375 | }, 376 | "funding": [ 377 | { 378 | "url": "https://github.com/sebastianbergmann", 379 | "type": "github" 380 | } 381 | ], 382 | "time": "2023-07-26T13:44:30+00:00" 383 | }, 384 | { 385 | "name": "phpunit/php-file-iterator", 386 | "version": "3.0.6", 387 | "source": { 388 | "type": "git", 389 | "url": "https://github.com/sebastianbergmann/php-file-iterator.git", 390 | "reference": "cf1c2e7c203ac650e352f4cc675a7021e7d1b3cf" 391 | }, 392 | "dist": { 393 | "type": "zip", 394 | "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/cf1c2e7c203ac650e352f4cc675a7021e7d1b3cf", 395 | "reference": "cf1c2e7c203ac650e352f4cc675a7021e7d1b3cf", 396 | "shasum": "" 397 | }, 398 | "require": { 399 | "php": ">=7.3" 400 | }, 401 | "require-dev": { 402 | "phpunit/phpunit": "^9.3" 403 | }, 404 | "type": "library", 405 | "extra": { 406 | "branch-alias": { 407 | "dev-master": "3.0-dev" 408 | } 409 | }, 410 | "autoload": { 411 | "classmap": [ 412 | "src/" 413 | ] 414 | }, 415 | "notification-url": "https://packagist.org/downloads/", 416 | "license": [ 417 | "BSD-3-Clause" 418 | ], 419 | "authors": [ 420 | { 421 | "name": "Sebastian Bergmann", 422 | "email": "sebastian@phpunit.de", 423 | "role": "lead" 424 | } 425 | ], 426 | "description": "FilterIterator implementation that filters files based on a list of suffixes.", 427 | "homepage": "https://github.com/sebastianbergmann/php-file-iterator/", 428 | "keywords": [ 429 | "filesystem", 430 | "iterator" 431 | ], 432 | "support": { 433 | "issues": "https://github.com/sebastianbergmann/php-file-iterator/issues", 434 | "source": "https://github.com/sebastianbergmann/php-file-iterator/tree/3.0.6" 435 | }, 436 | "funding": [ 437 | { 438 | "url": "https://github.com/sebastianbergmann", 439 | "type": "github" 440 | } 441 | ], 442 | "time": "2021-12-02T12:48:52+00:00" 443 | }, 444 | { 445 | "name": "phpunit/php-invoker", 446 | "version": "3.1.1", 447 | "source": { 448 | "type": "git", 449 | "url": "https://github.com/sebastianbergmann/php-invoker.git", 450 | "reference": "5a10147d0aaf65b58940a0b72f71c9ac0423cc67" 451 | }, 452 | "dist": { 453 | "type": "zip", 454 | "url": "https://api.github.com/repos/sebastianbergmann/php-invoker/zipball/5a10147d0aaf65b58940a0b72f71c9ac0423cc67", 455 | "reference": "5a10147d0aaf65b58940a0b72f71c9ac0423cc67", 456 | "shasum": "" 457 | }, 458 | "require": { 459 | "php": ">=7.3" 460 | }, 461 | "require-dev": { 462 | "ext-pcntl": "*", 463 | "phpunit/phpunit": "^9.3" 464 | }, 465 | "suggest": { 466 | "ext-pcntl": "*" 467 | }, 468 | "type": "library", 469 | "extra": { 470 | "branch-alias": { 471 | "dev-master": "3.1-dev" 472 | } 473 | }, 474 | "autoload": { 475 | "classmap": [ 476 | "src/" 477 | ] 478 | }, 479 | "notification-url": "https://packagist.org/downloads/", 480 | "license": [ 481 | "BSD-3-Clause" 482 | ], 483 | "authors": [ 484 | { 485 | "name": "Sebastian Bergmann", 486 | "email": "sebastian@phpunit.de", 487 | "role": "lead" 488 | } 489 | ], 490 | "description": "Invoke callables with a timeout", 491 | "homepage": "https://github.com/sebastianbergmann/php-invoker/", 492 | "keywords": [ 493 | "process" 494 | ], 495 | "support": { 496 | "issues": "https://github.com/sebastianbergmann/php-invoker/issues", 497 | "source": "https://github.com/sebastianbergmann/php-invoker/tree/3.1.1" 498 | }, 499 | "funding": [ 500 | { 501 | "url": "https://github.com/sebastianbergmann", 502 | "type": "github" 503 | } 504 | ], 505 | "time": "2020-09-28T05:58:55+00:00" 506 | }, 507 | { 508 | "name": "phpunit/php-text-template", 509 | "version": "2.0.4", 510 | "source": { 511 | "type": "git", 512 | "url": "https://github.com/sebastianbergmann/php-text-template.git", 513 | "reference": "5da5f67fc95621df9ff4c4e5a84d6a8a2acf7c28" 514 | }, 515 | "dist": { 516 | "type": "zip", 517 | "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/5da5f67fc95621df9ff4c4e5a84d6a8a2acf7c28", 518 | "reference": "5da5f67fc95621df9ff4c4e5a84d6a8a2acf7c28", 519 | "shasum": "" 520 | }, 521 | "require": { 522 | "php": ">=7.3" 523 | }, 524 | "require-dev": { 525 | "phpunit/phpunit": "^9.3" 526 | }, 527 | "type": "library", 528 | "extra": { 529 | "branch-alias": { 530 | "dev-master": "2.0-dev" 531 | } 532 | }, 533 | "autoload": { 534 | "classmap": [ 535 | "src/" 536 | ] 537 | }, 538 | "notification-url": "https://packagist.org/downloads/", 539 | "license": [ 540 | "BSD-3-Clause" 541 | ], 542 | "authors": [ 543 | { 544 | "name": "Sebastian Bergmann", 545 | "email": "sebastian@phpunit.de", 546 | "role": "lead" 547 | } 548 | ], 549 | "description": "Simple template engine.", 550 | "homepage": "https://github.com/sebastianbergmann/php-text-template/", 551 | "keywords": [ 552 | "template" 553 | ], 554 | "support": { 555 | "issues": "https://github.com/sebastianbergmann/php-text-template/issues", 556 | "source": "https://github.com/sebastianbergmann/php-text-template/tree/2.0.4" 557 | }, 558 | "funding": [ 559 | { 560 | "url": "https://github.com/sebastianbergmann", 561 | "type": "github" 562 | } 563 | ], 564 | "time": "2020-10-26T05:33:50+00:00" 565 | }, 566 | { 567 | "name": "phpunit/php-timer", 568 | "version": "5.0.3", 569 | "source": { 570 | "type": "git", 571 | "url": "https://github.com/sebastianbergmann/php-timer.git", 572 | "reference": "5a63ce20ed1b5bf577850e2c4e87f4aa902afbd2" 573 | }, 574 | "dist": { 575 | "type": "zip", 576 | "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/5a63ce20ed1b5bf577850e2c4e87f4aa902afbd2", 577 | "reference": "5a63ce20ed1b5bf577850e2c4e87f4aa902afbd2", 578 | "shasum": "" 579 | }, 580 | "require": { 581 | "php": ">=7.3" 582 | }, 583 | "require-dev": { 584 | "phpunit/phpunit": "^9.3" 585 | }, 586 | "type": "library", 587 | "extra": { 588 | "branch-alias": { 589 | "dev-master": "5.0-dev" 590 | } 591 | }, 592 | "autoload": { 593 | "classmap": [ 594 | "src/" 595 | ] 596 | }, 597 | "notification-url": "https://packagist.org/downloads/", 598 | "license": [ 599 | "BSD-3-Clause" 600 | ], 601 | "authors": [ 602 | { 603 | "name": "Sebastian Bergmann", 604 | "email": "sebastian@phpunit.de", 605 | "role": "lead" 606 | } 607 | ], 608 | "description": "Utility class for timing", 609 | "homepage": "https://github.com/sebastianbergmann/php-timer/", 610 | "keywords": [ 611 | "timer" 612 | ], 613 | "support": { 614 | "issues": "https://github.com/sebastianbergmann/php-timer/issues", 615 | "source": "https://github.com/sebastianbergmann/php-timer/tree/5.0.3" 616 | }, 617 | "funding": [ 618 | { 619 | "url": "https://github.com/sebastianbergmann", 620 | "type": "github" 621 | } 622 | ], 623 | "time": "2020-10-26T13:16:10+00:00" 624 | }, 625 | { 626 | "name": "phpunit/phpunit", 627 | "version": "9.6.10", 628 | "source": { 629 | "type": "git", 630 | "url": "https://github.com/sebastianbergmann/phpunit.git", 631 | "reference": "a6d351645c3fe5a30f5e86be6577d946af65a328" 632 | }, 633 | "dist": { 634 | "type": "zip", 635 | "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/a6d351645c3fe5a30f5e86be6577d946af65a328", 636 | "reference": "a6d351645c3fe5a30f5e86be6577d946af65a328", 637 | "shasum": "" 638 | }, 639 | "require": { 640 | "doctrine/instantiator": "^1.3.1 || ^2", 641 | "ext-dom": "*", 642 | "ext-json": "*", 643 | "ext-libxml": "*", 644 | "ext-mbstring": "*", 645 | "ext-xml": "*", 646 | "ext-xmlwriter": "*", 647 | "myclabs/deep-copy": "^1.10.1", 648 | "phar-io/manifest": "^2.0.3", 649 | "phar-io/version": "^3.0.2", 650 | "php": ">=7.3", 651 | "phpunit/php-code-coverage": "^9.2.13", 652 | "phpunit/php-file-iterator": "^3.0.5", 653 | "phpunit/php-invoker": "^3.1.1", 654 | "phpunit/php-text-template": "^2.0.3", 655 | "phpunit/php-timer": "^5.0.2", 656 | "sebastian/cli-parser": "^1.0.1", 657 | "sebastian/code-unit": "^1.0.6", 658 | "sebastian/comparator": "^4.0.8", 659 | "sebastian/diff": "^4.0.3", 660 | "sebastian/environment": "^5.1.3", 661 | "sebastian/exporter": "^4.0.5", 662 | "sebastian/global-state": "^5.0.1", 663 | "sebastian/object-enumerator": "^4.0.3", 664 | "sebastian/resource-operations": "^3.0.3", 665 | "sebastian/type": "^3.2", 666 | "sebastian/version": "^3.0.2" 667 | }, 668 | "suggest": { 669 | "ext-soap": "To be able to generate mocks based on WSDL files", 670 | "ext-xdebug": "PHP extension that provides line coverage as well as branch and path coverage" 671 | }, 672 | "bin": [ 673 | "phpunit" 674 | ], 675 | "type": "library", 676 | "extra": { 677 | "branch-alias": { 678 | "dev-master": "9.6-dev" 679 | } 680 | }, 681 | "autoload": { 682 | "files": [ 683 | "src/Framework/Assert/Functions.php" 684 | ], 685 | "classmap": [ 686 | "src/" 687 | ] 688 | }, 689 | "notification-url": "https://packagist.org/downloads/", 690 | "license": [ 691 | "BSD-3-Clause" 692 | ], 693 | "authors": [ 694 | { 695 | "name": "Sebastian Bergmann", 696 | "email": "sebastian@phpunit.de", 697 | "role": "lead" 698 | } 699 | ], 700 | "description": "The PHP Unit Testing framework.", 701 | "homepage": "https://phpunit.de/", 702 | "keywords": [ 703 | "phpunit", 704 | "testing", 705 | "xunit" 706 | ], 707 | "support": { 708 | "issues": "https://github.com/sebastianbergmann/phpunit/issues", 709 | "security": "https://github.com/sebastianbergmann/phpunit/security/policy", 710 | "source": "https://github.com/sebastianbergmann/phpunit/tree/9.6.10" 711 | }, 712 | "funding": [ 713 | { 714 | "url": "https://phpunit.de/sponsors.html", 715 | "type": "custom" 716 | }, 717 | { 718 | "url": "https://github.com/sebastianbergmann", 719 | "type": "github" 720 | }, 721 | { 722 | "url": "https://tidelift.com/funding/github/packagist/phpunit/phpunit", 723 | "type": "tidelift" 724 | } 725 | ], 726 | "time": "2023-07-10T04:04:23+00:00" 727 | }, 728 | { 729 | "name": "sebastian/cli-parser", 730 | "version": "1.0.1", 731 | "source": { 732 | "type": "git", 733 | "url": "https://github.com/sebastianbergmann/cli-parser.git", 734 | "reference": "442e7c7e687e42adc03470c7b668bc4b2402c0b2" 735 | }, 736 | "dist": { 737 | "type": "zip", 738 | "url": "https://api.github.com/repos/sebastianbergmann/cli-parser/zipball/442e7c7e687e42adc03470c7b668bc4b2402c0b2", 739 | "reference": "442e7c7e687e42adc03470c7b668bc4b2402c0b2", 740 | "shasum": "" 741 | }, 742 | "require": { 743 | "php": ">=7.3" 744 | }, 745 | "require-dev": { 746 | "phpunit/phpunit": "^9.3" 747 | }, 748 | "type": "library", 749 | "extra": { 750 | "branch-alias": { 751 | "dev-master": "1.0-dev" 752 | } 753 | }, 754 | "autoload": { 755 | "classmap": [ 756 | "src/" 757 | ] 758 | }, 759 | "notification-url": "https://packagist.org/downloads/", 760 | "license": [ 761 | "BSD-3-Clause" 762 | ], 763 | "authors": [ 764 | { 765 | "name": "Sebastian Bergmann", 766 | "email": "sebastian@phpunit.de", 767 | "role": "lead" 768 | } 769 | ], 770 | "description": "Library for parsing CLI options", 771 | "homepage": "https://github.com/sebastianbergmann/cli-parser", 772 | "support": { 773 | "issues": "https://github.com/sebastianbergmann/cli-parser/issues", 774 | "source": "https://github.com/sebastianbergmann/cli-parser/tree/1.0.1" 775 | }, 776 | "funding": [ 777 | { 778 | "url": "https://github.com/sebastianbergmann", 779 | "type": "github" 780 | } 781 | ], 782 | "time": "2020-09-28T06:08:49+00:00" 783 | }, 784 | { 785 | "name": "sebastian/code-unit", 786 | "version": "1.0.8", 787 | "source": { 788 | "type": "git", 789 | "url": "https://github.com/sebastianbergmann/code-unit.git", 790 | "reference": "1fc9f64c0927627ef78ba436c9b17d967e68e120" 791 | }, 792 | "dist": { 793 | "type": "zip", 794 | "url": "https://api.github.com/repos/sebastianbergmann/code-unit/zipball/1fc9f64c0927627ef78ba436c9b17d967e68e120", 795 | "reference": "1fc9f64c0927627ef78ba436c9b17d967e68e120", 796 | "shasum": "" 797 | }, 798 | "require": { 799 | "php": ">=7.3" 800 | }, 801 | "require-dev": { 802 | "phpunit/phpunit": "^9.3" 803 | }, 804 | "type": "library", 805 | "extra": { 806 | "branch-alias": { 807 | "dev-master": "1.0-dev" 808 | } 809 | }, 810 | "autoload": { 811 | "classmap": [ 812 | "src/" 813 | ] 814 | }, 815 | "notification-url": "https://packagist.org/downloads/", 816 | "license": [ 817 | "BSD-3-Clause" 818 | ], 819 | "authors": [ 820 | { 821 | "name": "Sebastian Bergmann", 822 | "email": "sebastian@phpunit.de", 823 | "role": "lead" 824 | } 825 | ], 826 | "description": "Collection of value objects that represent the PHP code units", 827 | "homepage": "https://github.com/sebastianbergmann/code-unit", 828 | "support": { 829 | "issues": "https://github.com/sebastianbergmann/code-unit/issues", 830 | "source": "https://github.com/sebastianbergmann/code-unit/tree/1.0.8" 831 | }, 832 | "funding": [ 833 | { 834 | "url": "https://github.com/sebastianbergmann", 835 | "type": "github" 836 | } 837 | ], 838 | "time": "2020-10-26T13:08:54+00:00" 839 | }, 840 | { 841 | "name": "sebastian/code-unit-reverse-lookup", 842 | "version": "2.0.3", 843 | "source": { 844 | "type": "git", 845 | "url": "https://github.com/sebastianbergmann/code-unit-reverse-lookup.git", 846 | "reference": "ac91f01ccec49fb77bdc6fd1e548bc70f7faa3e5" 847 | }, 848 | "dist": { 849 | "type": "zip", 850 | "url": "https://api.github.com/repos/sebastianbergmann/code-unit-reverse-lookup/zipball/ac91f01ccec49fb77bdc6fd1e548bc70f7faa3e5", 851 | "reference": "ac91f01ccec49fb77bdc6fd1e548bc70f7faa3e5", 852 | "shasum": "" 853 | }, 854 | "require": { 855 | "php": ">=7.3" 856 | }, 857 | "require-dev": { 858 | "phpunit/phpunit": "^9.3" 859 | }, 860 | "type": "library", 861 | "extra": { 862 | "branch-alias": { 863 | "dev-master": "2.0-dev" 864 | } 865 | }, 866 | "autoload": { 867 | "classmap": [ 868 | "src/" 869 | ] 870 | }, 871 | "notification-url": "https://packagist.org/downloads/", 872 | "license": [ 873 | "BSD-3-Clause" 874 | ], 875 | "authors": [ 876 | { 877 | "name": "Sebastian Bergmann", 878 | "email": "sebastian@phpunit.de" 879 | } 880 | ], 881 | "description": "Looks up which function or method a line of code belongs to", 882 | "homepage": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/", 883 | "support": { 884 | "issues": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/issues", 885 | "source": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/tree/2.0.3" 886 | }, 887 | "funding": [ 888 | { 889 | "url": "https://github.com/sebastianbergmann", 890 | "type": "github" 891 | } 892 | ], 893 | "time": "2020-09-28T05:30:19+00:00" 894 | }, 895 | { 896 | "name": "sebastian/comparator", 897 | "version": "4.0.8", 898 | "source": { 899 | "type": "git", 900 | "url": "https://github.com/sebastianbergmann/comparator.git", 901 | "reference": "fa0f136dd2334583309d32b62544682ee972b51a" 902 | }, 903 | "dist": { 904 | "type": "zip", 905 | "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/fa0f136dd2334583309d32b62544682ee972b51a", 906 | "reference": "fa0f136dd2334583309d32b62544682ee972b51a", 907 | "shasum": "" 908 | }, 909 | "require": { 910 | "php": ">=7.3", 911 | "sebastian/diff": "^4.0", 912 | "sebastian/exporter": "^4.0" 913 | }, 914 | "require-dev": { 915 | "phpunit/phpunit": "^9.3" 916 | }, 917 | "type": "library", 918 | "extra": { 919 | "branch-alias": { 920 | "dev-master": "4.0-dev" 921 | } 922 | }, 923 | "autoload": { 924 | "classmap": [ 925 | "src/" 926 | ] 927 | }, 928 | "notification-url": "https://packagist.org/downloads/", 929 | "license": [ 930 | "BSD-3-Clause" 931 | ], 932 | "authors": [ 933 | { 934 | "name": "Sebastian Bergmann", 935 | "email": "sebastian@phpunit.de" 936 | }, 937 | { 938 | "name": "Jeff Welch", 939 | "email": "whatthejeff@gmail.com" 940 | }, 941 | { 942 | "name": "Volker Dusch", 943 | "email": "github@wallbash.com" 944 | }, 945 | { 946 | "name": "Bernhard Schussek", 947 | "email": "bschussek@2bepublished.at" 948 | } 949 | ], 950 | "description": "Provides the functionality to compare PHP values for equality", 951 | "homepage": "https://github.com/sebastianbergmann/comparator", 952 | "keywords": [ 953 | "comparator", 954 | "compare", 955 | "equality" 956 | ], 957 | "support": { 958 | "issues": "https://github.com/sebastianbergmann/comparator/issues", 959 | "source": "https://github.com/sebastianbergmann/comparator/tree/4.0.8" 960 | }, 961 | "funding": [ 962 | { 963 | "url": "https://github.com/sebastianbergmann", 964 | "type": "github" 965 | } 966 | ], 967 | "time": "2022-09-14T12:41:17+00:00" 968 | }, 969 | { 970 | "name": "sebastian/complexity", 971 | "version": "2.0.2", 972 | "source": { 973 | "type": "git", 974 | "url": "https://github.com/sebastianbergmann/complexity.git", 975 | "reference": "739b35e53379900cc9ac327b2147867b8b6efd88" 976 | }, 977 | "dist": { 978 | "type": "zip", 979 | "url": "https://api.github.com/repos/sebastianbergmann/complexity/zipball/739b35e53379900cc9ac327b2147867b8b6efd88", 980 | "reference": "739b35e53379900cc9ac327b2147867b8b6efd88", 981 | "shasum": "" 982 | }, 983 | "require": { 984 | "nikic/php-parser": "^4.7", 985 | "php": ">=7.3" 986 | }, 987 | "require-dev": { 988 | "phpunit/phpunit": "^9.3" 989 | }, 990 | "type": "library", 991 | "extra": { 992 | "branch-alias": { 993 | "dev-master": "2.0-dev" 994 | } 995 | }, 996 | "autoload": { 997 | "classmap": [ 998 | "src/" 999 | ] 1000 | }, 1001 | "notification-url": "https://packagist.org/downloads/", 1002 | "license": [ 1003 | "BSD-3-Clause" 1004 | ], 1005 | "authors": [ 1006 | { 1007 | "name": "Sebastian Bergmann", 1008 | "email": "sebastian@phpunit.de", 1009 | "role": "lead" 1010 | } 1011 | ], 1012 | "description": "Library for calculating the complexity of PHP code units", 1013 | "homepage": "https://github.com/sebastianbergmann/complexity", 1014 | "support": { 1015 | "issues": "https://github.com/sebastianbergmann/complexity/issues", 1016 | "source": "https://github.com/sebastianbergmann/complexity/tree/2.0.2" 1017 | }, 1018 | "funding": [ 1019 | { 1020 | "url": "https://github.com/sebastianbergmann", 1021 | "type": "github" 1022 | } 1023 | ], 1024 | "time": "2020-10-26T15:52:27+00:00" 1025 | }, 1026 | { 1027 | "name": "sebastian/diff", 1028 | "version": "4.0.5", 1029 | "source": { 1030 | "type": "git", 1031 | "url": "https://github.com/sebastianbergmann/diff.git", 1032 | "reference": "74be17022044ebaaecfdf0c5cd504fc9cd5a7131" 1033 | }, 1034 | "dist": { 1035 | "type": "zip", 1036 | "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/74be17022044ebaaecfdf0c5cd504fc9cd5a7131", 1037 | "reference": "74be17022044ebaaecfdf0c5cd504fc9cd5a7131", 1038 | "shasum": "" 1039 | }, 1040 | "require": { 1041 | "php": ">=7.3" 1042 | }, 1043 | "require-dev": { 1044 | "phpunit/phpunit": "^9.3", 1045 | "symfony/process": "^4.2 || ^5" 1046 | }, 1047 | "type": "library", 1048 | "extra": { 1049 | "branch-alias": { 1050 | "dev-master": "4.0-dev" 1051 | } 1052 | }, 1053 | "autoload": { 1054 | "classmap": [ 1055 | "src/" 1056 | ] 1057 | }, 1058 | "notification-url": "https://packagist.org/downloads/", 1059 | "license": [ 1060 | "BSD-3-Clause" 1061 | ], 1062 | "authors": [ 1063 | { 1064 | "name": "Sebastian Bergmann", 1065 | "email": "sebastian@phpunit.de" 1066 | }, 1067 | { 1068 | "name": "Kore Nordmann", 1069 | "email": "mail@kore-nordmann.de" 1070 | } 1071 | ], 1072 | "description": "Diff implementation", 1073 | "homepage": "https://github.com/sebastianbergmann/diff", 1074 | "keywords": [ 1075 | "diff", 1076 | "udiff", 1077 | "unidiff", 1078 | "unified diff" 1079 | ], 1080 | "support": { 1081 | "issues": "https://github.com/sebastianbergmann/diff/issues", 1082 | "source": "https://github.com/sebastianbergmann/diff/tree/4.0.5" 1083 | }, 1084 | "funding": [ 1085 | { 1086 | "url": "https://github.com/sebastianbergmann", 1087 | "type": "github" 1088 | } 1089 | ], 1090 | "time": "2023-05-07T05:35:17+00:00" 1091 | }, 1092 | { 1093 | "name": "sebastian/environment", 1094 | "version": "5.1.5", 1095 | "source": { 1096 | "type": "git", 1097 | "url": "https://github.com/sebastianbergmann/environment.git", 1098 | "reference": "830c43a844f1f8d5b7a1f6d6076b784454d8b7ed" 1099 | }, 1100 | "dist": { 1101 | "type": "zip", 1102 | "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/830c43a844f1f8d5b7a1f6d6076b784454d8b7ed", 1103 | "reference": "830c43a844f1f8d5b7a1f6d6076b784454d8b7ed", 1104 | "shasum": "" 1105 | }, 1106 | "require": { 1107 | "php": ">=7.3" 1108 | }, 1109 | "require-dev": { 1110 | "phpunit/phpunit": "^9.3" 1111 | }, 1112 | "suggest": { 1113 | "ext-posix": "*" 1114 | }, 1115 | "type": "library", 1116 | "extra": { 1117 | "branch-alias": { 1118 | "dev-master": "5.1-dev" 1119 | } 1120 | }, 1121 | "autoload": { 1122 | "classmap": [ 1123 | "src/" 1124 | ] 1125 | }, 1126 | "notification-url": "https://packagist.org/downloads/", 1127 | "license": [ 1128 | "BSD-3-Clause" 1129 | ], 1130 | "authors": [ 1131 | { 1132 | "name": "Sebastian Bergmann", 1133 | "email": "sebastian@phpunit.de" 1134 | } 1135 | ], 1136 | "description": "Provides functionality to handle HHVM/PHP environments", 1137 | "homepage": "http://www.github.com/sebastianbergmann/environment", 1138 | "keywords": [ 1139 | "Xdebug", 1140 | "environment", 1141 | "hhvm" 1142 | ], 1143 | "support": { 1144 | "issues": "https://github.com/sebastianbergmann/environment/issues", 1145 | "source": "https://github.com/sebastianbergmann/environment/tree/5.1.5" 1146 | }, 1147 | "funding": [ 1148 | { 1149 | "url": "https://github.com/sebastianbergmann", 1150 | "type": "github" 1151 | } 1152 | ], 1153 | "time": "2023-02-03T06:03:51+00:00" 1154 | }, 1155 | { 1156 | "name": "sebastian/exporter", 1157 | "version": "4.0.5", 1158 | "source": { 1159 | "type": "git", 1160 | "url": "https://github.com/sebastianbergmann/exporter.git", 1161 | "reference": "ac230ed27f0f98f597c8a2b6eb7ac563af5e5b9d" 1162 | }, 1163 | "dist": { 1164 | "type": "zip", 1165 | "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/ac230ed27f0f98f597c8a2b6eb7ac563af5e5b9d", 1166 | "reference": "ac230ed27f0f98f597c8a2b6eb7ac563af5e5b9d", 1167 | "shasum": "" 1168 | }, 1169 | "require": { 1170 | "php": ">=7.3", 1171 | "sebastian/recursion-context": "^4.0" 1172 | }, 1173 | "require-dev": { 1174 | "ext-mbstring": "*", 1175 | "phpunit/phpunit": "^9.3" 1176 | }, 1177 | "type": "library", 1178 | "extra": { 1179 | "branch-alias": { 1180 | "dev-master": "4.0-dev" 1181 | } 1182 | }, 1183 | "autoload": { 1184 | "classmap": [ 1185 | "src/" 1186 | ] 1187 | }, 1188 | "notification-url": "https://packagist.org/downloads/", 1189 | "license": [ 1190 | "BSD-3-Clause" 1191 | ], 1192 | "authors": [ 1193 | { 1194 | "name": "Sebastian Bergmann", 1195 | "email": "sebastian@phpunit.de" 1196 | }, 1197 | { 1198 | "name": "Jeff Welch", 1199 | "email": "whatthejeff@gmail.com" 1200 | }, 1201 | { 1202 | "name": "Volker Dusch", 1203 | "email": "github@wallbash.com" 1204 | }, 1205 | { 1206 | "name": "Adam Harvey", 1207 | "email": "aharvey@php.net" 1208 | }, 1209 | { 1210 | "name": "Bernhard Schussek", 1211 | "email": "bschussek@gmail.com" 1212 | } 1213 | ], 1214 | "description": "Provides the functionality to export PHP variables for visualization", 1215 | "homepage": "https://www.github.com/sebastianbergmann/exporter", 1216 | "keywords": [ 1217 | "export", 1218 | "exporter" 1219 | ], 1220 | "support": { 1221 | "issues": "https://github.com/sebastianbergmann/exporter/issues", 1222 | "source": "https://github.com/sebastianbergmann/exporter/tree/4.0.5" 1223 | }, 1224 | "funding": [ 1225 | { 1226 | "url": "https://github.com/sebastianbergmann", 1227 | "type": "github" 1228 | } 1229 | ], 1230 | "time": "2022-09-14T06:03:37+00:00" 1231 | }, 1232 | { 1233 | "name": "sebastian/global-state", 1234 | "version": "5.0.6", 1235 | "source": { 1236 | "type": "git", 1237 | "url": "https://github.com/sebastianbergmann/global-state.git", 1238 | "reference": "bde739e7565280bda77be70044ac1047bc007e34" 1239 | }, 1240 | "dist": { 1241 | "type": "zip", 1242 | "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/bde739e7565280bda77be70044ac1047bc007e34", 1243 | "reference": "bde739e7565280bda77be70044ac1047bc007e34", 1244 | "shasum": "" 1245 | }, 1246 | "require": { 1247 | "php": ">=7.3", 1248 | "sebastian/object-reflector": "^2.0", 1249 | "sebastian/recursion-context": "^4.0" 1250 | }, 1251 | "require-dev": { 1252 | "ext-dom": "*", 1253 | "phpunit/phpunit": "^9.3" 1254 | }, 1255 | "suggest": { 1256 | "ext-uopz": "*" 1257 | }, 1258 | "type": "library", 1259 | "extra": { 1260 | "branch-alias": { 1261 | "dev-master": "5.0-dev" 1262 | } 1263 | }, 1264 | "autoload": { 1265 | "classmap": [ 1266 | "src/" 1267 | ] 1268 | }, 1269 | "notification-url": "https://packagist.org/downloads/", 1270 | "license": [ 1271 | "BSD-3-Clause" 1272 | ], 1273 | "authors": [ 1274 | { 1275 | "name": "Sebastian Bergmann", 1276 | "email": "sebastian@phpunit.de" 1277 | } 1278 | ], 1279 | "description": "Snapshotting of global state", 1280 | "homepage": "http://www.github.com/sebastianbergmann/global-state", 1281 | "keywords": [ 1282 | "global state" 1283 | ], 1284 | "support": { 1285 | "issues": "https://github.com/sebastianbergmann/global-state/issues", 1286 | "source": "https://github.com/sebastianbergmann/global-state/tree/5.0.6" 1287 | }, 1288 | "funding": [ 1289 | { 1290 | "url": "https://github.com/sebastianbergmann", 1291 | "type": "github" 1292 | } 1293 | ], 1294 | "time": "2023-08-02T09:26:13+00:00" 1295 | }, 1296 | { 1297 | "name": "sebastian/lines-of-code", 1298 | "version": "1.0.3", 1299 | "source": { 1300 | "type": "git", 1301 | "url": "https://github.com/sebastianbergmann/lines-of-code.git", 1302 | "reference": "c1c2e997aa3146983ed888ad08b15470a2e22ecc" 1303 | }, 1304 | "dist": { 1305 | "type": "zip", 1306 | "url": "https://api.github.com/repos/sebastianbergmann/lines-of-code/zipball/c1c2e997aa3146983ed888ad08b15470a2e22ecc", 1307 | "reference": "c1c2e997aa3146983ed888ad08b15470a2e22ecc", 1308 | "shasum": "" 1309 | }, 1310 | "require": { 1311 | "nikic/php-parser": "^4.6", 1312 | "php": ">=7.3" 1313 | }, 1314 | "require-dev": { 1315 | "phpunit/phpunit": "^9.3" 1316 | }, 1317 | "type": "library", 1318 | "extra": { 1319 | "branch-alias": { 1320 | "dev-master": "1.0-dev" 1321 | } 1322 | }, 1323 | "autoload": { 1324 | "classmap": [ 1325 | "src/" 1326 | ] 1327 | }, 1328 | "notification-url": "https://packagist.org/downloads/", 1329 | "license": [ 1330 | "BSD-3-Clause" 1331 | ], 1332 | "authors": [ 1333 | { 1334 | "name": "Sebastian Bergmann", 1335 | "email": "sebastian@phpunit.de", 1336 | "role": "lead" 1337 | } 1338 | ], 1339 | "description": "Library for counting the lines of code in PHP source code", 1340 | "homepage": "https://github.com/sebastianbergmann/lines-of-code", 1341 | "support": { 1342 | "issues": "https://github.com/sebastianbergmann/lines-of-code/issues", 1343 | "source": "https://github.com/sebastianbergmann/lines-of-code/tree/1.0.3" 1344 | }, 1345 | "funding": [ 1346 | { 1347 | "url": "https://github.com/sebastianbergmann", 1348 | "type": "github" 1349 | } 1350 | ], 1351 | "time": "2020-11-28T06:42:11+00:00" 1352 | }, 1353 | { 1354 | "name": "sebastian/object-enumerator", 1355 | "version": "4.0.4", 1356 | "source": { 1357 | "type": "git", 1358 | "url": "https://github.com/sebastianbergmann/object-enumerator.git", 1359 | "reference": "5c9eeac41b290a3712d88851518825ad78f45c71" 1360 | }, 1361 | "dist": { 1362 | "type": "zip", 1363 | "url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/5c9eeac41b290a3712d88851518825ad78f45c71", 1364 | "reference": "5c9eeac41b290a3712d88851518825ad78f45c71", 1365 | "shasum": "" 1366 | }, 1367 | "require": { 1368 | "php": ">=7.3", 1369 | "sebastian/object-reflector": "^2.0", 1370 | "sebastian/recursion-context": "^4.0" 1371 | }, 1372 | "require-dev": { 1373 | "phpunit/phpunit": "^9.3" 1374 | }, 1375 | "type": "library", 1376 | "extra": { 1377 | "branch-alias": { 1378 | "dev-master": "4.0-dev" 1379 | } 1380 | }, 1381 | "autoload": { 1382 | "classmap": [ 1383 | "src/" 1384 | ] 1385 | }, 1386 | "notification-url": "https://packagist.org/downloads/", 1387 | "license": [ 1388 | "BSD-3-Clause" 1389 | ], 1390 | "authors": [ 1391 | { 1392 | "name": "Sebastian Bergmann", 1393 | "email": "sebastian@phpunit.de" 1394 | } 1395 | ], 1396 | "description": "Traverses array structures and object graphs to enumerate all referenced objects", 1397 | "homepage": "https://github.com/sebastianbergmann/object-enumerator/", 1398 | "support": { 1399 | "issues": "https://github.com/sebastianbergmann/object-enumerator/issues", 1400 | "source": "https://github.com/sebastianbergmann/object-enumerator/tree/4.0.4" 1401 | }, 1402 | "funding": [ 1403 | { 1404 | "url": "https://github.com/sebastianbergmann", 1405 | "type": "github" 1406 | } 1407 | ], 1408 | "time": "2020-10-26T13:12:34+00:00" 1409 | }, 1410 | { 1411 | "name": "sebastian/object-reflector", 1412 | "version": "2.0.4", 1413 | "source": { 1414 | "type": "git", 1415 | "url": "https://github.com/sebastianbergmann/object-reflector.git", 1416 | "reference": "b4f479ebdbf63ac605d183ece17d8d7fe49c15c7" 1417 | }, 1418 | "dist": { 1419 | "type": "zip", 1420 | "url": "https://api.github.com/repos/sebastianbergmann/object-reflector/zipball/b4f479ebdbf63ac605d183ece17d8d7fe49c15c7", 1421 | "reference": "b4f479ebdbf63ac605d183ece17d8d7fe49c15c7", 1422 | "shasum": "" 1423 | }, 1424 | "require": { 1425 | "php": ">=7.3" 1426 | }, 1427 | "require-dev": { 1428 | "phpunit/phpunit": "^9.3" 1429 | }, 1430 | "type": "library", 1431 | "extra": { 1432 | "branch-alias": { 1433 | "dev-master": "2.0-dev" 1434 | } 1435 | }, 1436 | "autoload": { 1437 | "classmap": [ 1438 | "src/" 1439 | ] 1440 | }, 1441 | "notification-url": "https://packagist.org/downloads/", 1442 | "license": [ 1443 | "BSD-3-Clause" 1444 | ], 1445 | "authors": [ 1446 | { 1447 | "name": "Sebastian Bergmann", 1448 | "email": "sebastian@phpunit.de" 1449 | } 1450 | ], 1451 | "description": "Allows reflection of object attributes, including inherited and non-public ones", 1452 | "homepage": "https://github.com/sebastianbergmann/object-reflector/", 1453 | "support": { 1454 | "issues": "https://github.com/sebastianbergmann/object-reflector/issues", 1455 | "source": "https://github.com/sebastianbergmann/object-reflector/tree/2.0.4" 1456 | }, 1457 | "funding": [ 1458 | { 1459 | "url": "https://github.com/sebastianbergmann", 1460 | "type": "github" 1461 | } 1462 | ], 1463 | "time": "2020-10-26T13:14:26+00:00" 1464 | }, 1465 | { 1466 | "name": "sebastian/recursion-context", 1467 | "version": "4.0.5", 1468 | "source": { 1469 | "type": "git", 1470 | "url": "https://github.com/sebastianbergmann/recursion-context.git", 1471 | "reference": "e75bd0f07204fec2a0af9b0f3cfe97d05f92efc1" 1472 | }, 1473 | "dist": { 1474 | "type": "zip", 1475 | "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/e75bd0f07204fec2a0af9b0f3cfe97d05f92efc1", 1476 | "reference": "e75bd0f07204fec2a0af9b0f3cfe97d05f92efc1", 1477 | "shasum": "" 1478 | }, 1479 | "require": { 1480 | "php": ">=7.3" 1481 | }, 1482 | "require-dev": { 1483 | "phpunit/phpunit": "^9.3" 1484 | }, 1485 | "type": "library", 1486 | "extra": { 1487 | "branch-alias": { 1488 | "dev-master": "4.0-dev" 1489 | } 1490 | }, 1491 | "autoload": { 1492 | "classmap": [ 1493 | "src/" 1494 | ] 1495 | }, 1496 | "notification-url": "https://packagist.org/downloads/", 1497 | "license": [ 1498 | "BSD-3-Clause" 1499 | ], 1500 | "authors": [ 1501 | { 1502 | "name": "Sebastian Bergmann", 1503 | "email": "sebastian@phpunit.de" 1504 | }, 1505 | { 1506 | "name": "Jeff Welch", 1507 | "email": "whatthejeff@gmail.com" 1508 | }, 1509 | { 1510 | "name": "Adam Harvey", 1511 | "email": "aharvey@php.net" 1512 | } 1513 | ], 1514 | "description": "Provides functionality to recursively process PHP variables", 1515 | "homepage": "https://github.com/sebastianbergmann/recursion-context", 1516 | "support": { 1517 | "issues": "https://github.com/sebastianbergmann/recursion-context/issues", 1518 | "source": "https://github.com/sebastianbergmann/recursion-context/tree/4.0.5" 1519 | }, 1520 | "funding": [ 1521 | { 1522 | "url": "https://github.com/sebastianbergmann", 1523 | "type": "github" 1524 | } 1525 | ], 1526 | "time": "2023-02-03T06:07:39+00:00" 1527 | }, 1528 | { 1529 | "name": "sebastian/resource-operations", 1530 | "version": "3.0.3", 1531 | "source": { 1532 | "type": "git", 1533 | "url": "https://github.com/sebastianbergmann/resource-operations.git", 1534 | "reference": "0f4443cb3a1d92ce809899753bc0d5d5a8dd19a8" 1535 | }, 1536 | "dist": { 1537 | "type": "zip", 1538 | "url": "https://api.github.com/repos/sebastianbergmann/resource-operations/zipball/0f4443cb3a1d92ce809899753bc0d5d5a8dd19a8", 1539 | "reference": "0f4443cb3a1d92ce809899753bc0d5d5a8dd19a8", 1540 | "shasum": "" 1541 | }, 1542 | "require": { 1543 | "php": ">=7.3" 1544 | }, 1545 | "require-dev": { 1546 | "phpunit/phpunit": "^9.0" 1547 | }, 1548 | "type": "library", 1549 | "extra": { 1550 | "branch-alias": { 1551 | "dev-master": "3.0-dev" 1552 | } 1553 | }, 1554 | "autoload": { 1555 | "classmap": [ 1556 | "src/" 1557 | ] 1558 | }, 1559 | "notification-url": "https://packagist.org/downloads/", 1560 | "license": [ 1561 | "BSD-3-Clause" 1562 | ], 1563 | "authors": [ 1564 | { 1565 | "name": "Sebastian Bergmann", 1566 | "email": "sebastian@phpunit.de" 1567 | } 1568 | ], 1569 | "description": "Provides a list of PHP built-in functions that operate on resources", 1570 | "homepage": "https://www.github.com/sebastianbergmann/resource-operations", 1571 | "support": { 1572 | "issues": "https://github.com/sebastianbergmann/resource-operations/issues", 1573 | "source": "https://github.com/sebastianbergmann/resource-operations/tree/3.0.3" 1574 | }, 1575 | "funding": [ 1576 | { 1577 | "url": "https://github.com/sebastianbergmann", 1578 | "type": "github" 1579 | } 1580 | ], 1581 | "time": "2020-09-28T06:45:17+00:00" 1582 | }, 1583 | { 1584 | "name": "sebastian/type", 1585 | "version": "3.2.1", 1586 | "source": { 1587 | "type": "git", 1588 | "url": "https://github.com/sebastianbergmann/type.git", 1589 | "reference": "75e2c2a32f5e0b3aef905b9ed0b179b953b3d7c7" 1590 | }, 1591 | "dist": { 1592 | "type": "zip", 1593 | "url": "https://api.github.com/repos/sebastianbergmann/type/zipball/75e2c2a32f5e0b3aef905b9ed0b179b953b3d7c7", 1594 | "reference": "75e2c2a32f5e0b3aef905b9ed0b179b953b3d7c7", 1595 | "shasum": "" 1596 | }, 1597 | "require": { 1598 | "php": ">=7.3" 1599 | }, 1600 | "require-dev": { 1601 | "phpunit/phpunit": "^9.5" 1602 | }, 1603 | "type": "library", 1604 | "extra": { 1605 | "branch-alias": { 1606 | "dev-master": "3.2-dev" 1607 | } 1608 | }, 1609 | "autoload": { 1610 | "classmap": [ 1611 | "src/" 1612 | ] 1613 | }, 1614 | "notification-url": "https://packagist.org/downloads/", 1615 | "license": [ 1616 | "BSD-3-Clause" 1617 | ], 1618 | "authors": [ 1619 | { 1620 | "name": "Sebastian Bergmann", 1621 | "email": "sebastian@phpunit.de", 1622 | "role": "lead" 1623 | } 1624 | ], 1625 | "description": "Collection of value objects that represent the types of the PHP type system", 1626 | "homepage": "https://github.com/sebastianbergmann/type", 1627 | "support": { 1628 | "issues": "https://github.com/sebastianbergmann/type/issues", 1629 | "source": "https://github.com/sebastianbergmann/type/tree/3.2.1" 1630 | }, 1631 | "funding": [ 1632 | { 1633 | "url": "https://github.com/sebastianbergmann", 1634 | "type": "github" 1635 | } 1636 | ], 1637 | "time": "2023-02-03T06:13:03+00:00" 1638 | }, 1639 | { 1640 | "name": "sebastian/version", 1641 | "version": "3.0.2", 1642 | "source": { 1643 | "type": "git", 1644 | "url": "https://github.com/sebastianbergmann/version.git", 1645 | "reference": "c6c1022351a901512170118436c764e473f6de8c" 1646 | }, 1647 | "dist": { 1648 | "type": "zip", 1649 | "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/c6c1022351a901512170118436c764e473f6de8c", 1650 | "reference": "c6c1022351a901512170118436c764e473f6de8c", 1651 | "shasum": "" 1652 | }, 1653 | "require": { 1654 | "php": ">=7.3" 1655 | }, 1656 | "type": "library", 1657 | "extra": { 1658 | "branch-alias": { 1659 | "dev-master": "3.0-dev" 1660 | } 1661 | }, 1662 | "autoload": { 1663 | "classmap": [ 1664 | "src/" 1665 | ] 1666 | }, 1667 | "notification-url": "https://packagist.org/downloads/", 1668 | "license": [ 1669 | "BSD-3-Clause" 1670 | ], 1671 | "authors": [ 1672 | { 1673 | "name": "Sebastian Bergmann", 1674 | "email": "sebastian@phpunit.de", 1675 | "role": "lead" 1676 | } 1677 | ], 1678 | "description": "Library that helps with managing the version number of Git-hosted PHP projects", 1679 | "homepage": "https://github.com/sebastianbergmann/version", 1680 | "support": { 1681 | "issues": "https://github.com/sebastianbergmann/version/issues", 1682 | "source": "https://github.com/sebastianbergmann/version/tree/3.0.2" 1683 | }, 1684 | "funding": [ 1685 | { 1686 | "url": "https://github.com/sebastianbergmann", 1687 | "type": "github" 1688 | } 1689 | ], 1690 | "time": "2020-09-28T06:39:44+00:00" 1691 | }, 1692 | { 1693 | "name": "theseer/tokenizer", 1694 | "version": "1.2.1", 1695 | "source": { 1696 | "type": "git", 1697 | "url": "https://github.com/theseer/tokenizer.git", 1698 | "reference": "34a41e998c2183e22995f158c581e7b5e755ab9e" 1699 | }, 1700 | "dist": { 1701 | "type": "zip", 1702 | "url": "https://api.github.com/repos/theseer/tokenizer/zipball/34a41e998c2183e22995f158c581e7b5e755ab9e", 1703 | "reference": "34a41e998c2183e22995f158c581e7b5e755ab9e", 1704 | "shasum": "" 1705 | }, 1706 | "require": { 1707 | "ext-dom": "*", 1708 | "ext-tokenizer": "*", 1709 | "ext-xmlwriter": "*", 1710 | "php": "^7.2 || ^8.0" 1711 | }, 1712 | "type": "library", 1713 | "autoload": { 1714 | "classmap": [ 1715 | "src/" 1716 | ] 1717 | }, 1718 | "notification-url": "https://packagist.org/downloads/", 1719 | "license": [ 1720 | "BSD-3-Clause" 1721 | ], 1722 | "authors": [ 1723 | { 1724 | "name": "Arne Blankerts", 1725 | "email": "arne@blankerts.de", 1726 | "role": "Developer" 1727 | } 1728 | ], 1729 | "description": "A small library for converting tokenized PHP source code into XML and potentially other formats", 1730 | "support": { 1731 | "issues": "https://github.com/theseer/tokenizer/issues", 1732 | "source": "https://github.com/theseer/tokenizer/tree/1.2.1" 1733 | }, 1734 | "funding": [ 1735 | { 1736 | "url": "https://github.com/theseer", 1737 | "type": "github" 1738 | } 1739 | ], 1740 | "time": "2021-07-28T10:34:58+00:00" 1741 | } 1742 | ], 1743 | "aliases": [], 1744 | "minimum-stability": "stable", 1745 | "stability-flags": [], 1746 | "prefer-stable": false, 1747 | "prefer-lowest": false, 1748 | "platform": { 1749 | "php": ">=8.0.9", 1750 | "ext-curl": "*" 1751 | }, 1752 | "platform-dev": [], 1753 | "plugin-api-version": "2.3.0" 1754 | } 1755 | -------------------------------------------------------------------------------- /docs/Makefile: -------------------------------------------------------------------------------- 1 | # Minimal makefile for Sphinx documentation 2 | # 3 | 4 | # You can set these variables from the command line, and also 5 | # from the environment for the first two. 6 | SPHINXOPTS ?= 7 | SPHINXBUILD ?= sphinx-build 8 | SOURCEDIR = source 9 | BUILDDIR = build 10 | 11 | # Put it first so that "make" without argument is like "make help". 12 | help: 13 | @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) 14 | 15 | .PHONY: help Makefile 16 | 17 | # Catch-all target: route all unknown targets to Sphinx using the new 18 | # "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). 19 | %: Makefile 20 | @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) 21 | -------------------------------------------------------------------------------- /docs/make.bat: -------------------------------------------------------------------------------- 1 | @ECHO OFF 2 | 3 | pushd %~dp0 4 | 5 | REM Command file for Sphinx documentation 6 | 7 | if "%SPHINXBUILD%" == "" ( 8 | set SPHINXBUILD=sphinx-build 9 | ) 10 | set SOURCEDIR=source 11 | set BUILDDIR=build 12 | 13 | if "%1" == "" goto help 14 | 15 | %SPHINXBUILD% >NUL 2>NUL 16 | if errorlevel 9009 ( 17 | echo. 18 | echo.The 'sphinx-build' command was not found. Make sure you have Sphinx 19 | echo.installed, then set the SPHINXBUILD environment variable to point 20 | echo.to the full path of the 'sphinx-build' executable. Alternatively you 21 | echo.may add the Sphinx directory to PATH. 22 | echo. 23 | echo.If you don't have Sphinx installed, grab it from 24 | echo.http://sphinx-doc.org/ 25 | exit /b 1 26 | ) 27 | 28 | %SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% 29 | goto end 30 | 31 | :help 32 | %SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% 33 | 34 | :end 35 | popd 36 | -------------------------------------------------------------------------------- /docs/source/api.rst: -------------------------------------------------------------------------------- 1 | API 2 | === 3 | 4 | .. autosummary:: 5 | :toctree: generated 6 | 7 | discord-webhook-php 8 | -------------------------------------------------------------------------------- /docs/source/conf.py: -------------------------------------------------------------------------------- 1 | # Configuration file for the Sphinx documentation builder. 2 | 3 | # -- Project information 4 | 5 | project = 'discord-webhook-php' 6 | copyright = '2022, Atakan' 7 | author = 'Atakan' 8 | 9 | release = '0.1' 10 | version = '0.1.0' 11 | 12 | # -- General configuration 13 | 14 | extensions = [ 15 | 'sphinx.ext.duration', 16 | 'sphinx.ext.doctest', 17 | 'sphinx.ext.autodoc', 18 | 'sphinx.ext.autosummary', 19 | 'sphinx.ext.intersphinx', 20 | ] 21 | 22 | intersphinx_mapping = { 23 | 'python': ('https://docs.python.org/3/', None), 24 | 'sphinx': ('https://www.sphinx-doc.org/en/master/', None), 25 | } 26 | intersphinx_disabled_domains = ['std'] 27 | 28 | templates_path = ['_templates'] 29 | 30 | # -- Options for HTML output 31 | 32 | html_theme = 'sphinx_rtd_theme' 33 | 34 | # -- Options for EPUB output 35 | epub_show_urls = 'footnote' 36 | -------------------------------------------------------------------------------- /docs/source/index.rst: -------------------------------------------------------------------------------- 1 | Welcome to discord-webhook-php's documentation! 2 | =================================== 3 | 4 | **discord-webhook-php** is a A php package for sending message to discord with webhook. 5 | 6 | Check out the :doc:`usage` section for further information, including 7 | how to :ref:`installation` the project. 8 | 9 | .. note:: 10 | 11 | This project is under active development. 12 | 13 | Contents 14 | -------- 15 | 16 | .. toctree:: 17 | 18 | usage 19 | api 20 | -------------------------------------------------------------------------------- /docs/source/usage.rst: -------------------------------------------------------------------------------- 1 | Usage 2 | ===== 3 | 4 | .. _installation: 5 | 6 | Installation 7 | ------------ 8 | 9 | To use discord-webhook-php, first install it using composer: 10 | 11 | .. code-block:: php 12 | 13 | composer require atakde/discord-webhook-php 14 | 15 | For example: 16 | 17 | .. code-block:: php 18 | 19 | composer require atakde/discord-webhook-php 20 | 21 | require 'vendor/autoload.php'; 22 | 23 | use Atakde\DiscordWebhook\DiscordWebhook; 24 | use Atakde\DiscordWebhook\Message\MessageFactory; 25 | 26 | $messageFactory = new MessageFactory(); 27 | $textMessage = $messageFactory->create('text'); 28 | $textMessage->setUsername("John Doe"); 29 | $textMessage->setContent("Hello World!"); 30 | 31 | $webhook = new DiscordWebhook($textMessage); 32 | $webhook->setWebhookUrl("https://discord.com/api/..."); 33 | $webhook->send(); 34 | 35 | 36 | -------------------------------------------------------------------------------- /index.rst: -------------------------------------------------------------------------------- 1 | .. meta:: 2 | :description: A php package for sending message to discord with webhook. 3 | :keywords: php, discord, discord-webhook, discord-webhook-php, webhook, webhook-php 4 | 5 | .. discord-webhook-php 6 | 7 | ================= 8 | discord-webhook-php 9 | ================= 10 | 11 | .. image:: https://readthedocs.org/projects/discord-webhook-php/badge/?version=latest 12 | :target: https://readthedocs.org/projects/discord-webhook-php/?badge=latest 13 | :alt: Documentation Status 14 | -------------------------------------------------------------------------------- /phpunit.xml: -------------------------------------------------------------------------------- 1 | 2 | 12 | 13 | 14 | ./tests/ 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /src/DiscordWebhook.php: -------------------------------------------------------------------------------- 1 | message = $message; 38 | } 39 | 40 | public function setWebhookUrl(string $webhookUrl): void 41 | { 42 | $this->webhookUrl = $webhookUrl; 43 | } 44 | 45 | // is multipart/form-data 46 | public function isMultipart(): bool 47 | { 48 | return $this->message->isMultipart(); 49 | } 50 | 51 | public function setDebug(bool $debug): void 52 | { 53 | $this->debug = $debug; 54 | } 55 | 56 | public function send(): bool 57 | { 58 | try { 59 | $ch = curl_init($this->webhookUrl); 60 | // is multipart/form-data 61 | if ($this->isMultipart()) { 62 | curl_setopt($ch, CURLOPT_POSTFIELDS, $this->message->toArray()); 63 | curl_setopt($ch, CURLOPT_HTTPHEADER, ['Content-Type: multipart/form-data']); 64 | } else { 65 | curl_setopt($ch, CURLOPT_POSTFIELDS, $this->message->toJson()); 66 | curl_setopt($ch, CURLOPT_HTTPHEADER, array( 67 | 'Content-Type: application/json', 68 | 'Content-Length: ' . strlen($this->message->toJson()) 69 | )); 70 | } 71 | 72 | $response = curl_exec($ch); 73 | $responseCode = curl_getinfo($ch, CURLINFO_HTTP_CODE); 74 | curl_close($ch); 75 | 76 | if ($responseCode >= 200 && $responseCode < 300) { 77 | return true; 78 | } else { 79 | $decodedResponse = json_decode($response, true); 80 | throw new InvalidResponseException($decodedResponse["message"] ?? "Error ocurred!", $responseCode); 81 | } 82 | } catch (\Exception $e) { 83 | // suppress exception if debug is false 84 | if ($this->debug) { 85 | throw $e; 86 | } 87 | return false; 88 | } 89 | } 90 | } 91 | -------------------------------------------------------------------------------- /src/Exception/InvalidResponseException.php: -------------------------------------------------------------------------------- 1 | title = $title; 30 | return $this; 31 | } 32 | 33 | /** 34 | * @param string|null $description 35 | * @return EmbedMessage 36 | */ 37 | public function setDescription(?string $description): self 38 | { 39 | $this->description = $description; 40 | return $this; 41 | } 42 | 43 | /** 44 | * @param string|null $color 45 | * @return EmbedMessage 46 | */ 47 | public function setColor(?string $color): self 48 | { 49 | $this->color = $color; 50 | return $this; 51 | } 52 | 53 | /** 54 | * @param string|null $footerIcon 55 | * @return EmbedMessage 56 | */ 57 | public function setFooterIcon(?string $footerIcon): self 58 | { 59 | $this->footerIcon = $footerIcon; 60 | return $this; 61 | } 62 | 63 | /** 64 | * @param string|null $footerText 65 | * @return EmbedMessage 66 | */ 67 | public function setFooterText(?string $footerText): self 68 | { 69 | $this->footerText = $footerText; 70 | return $this; 71 | } 72 | 73 | /** 74 | * @param string|null $thumbnailUrl 75 | * @return EmbedMessage 76 | */ 77 | public function setThumbnailUrl(?string $thumbnailUrl): self 78 | { 79 | $this->thumbnailUrl = $thumbnailUrl; 80 | return $this; 81 | } 82 | 83 | /** 84 | * @param string|null $url 85 | * @return EmbedMessage 86 | */ 87 | public function setUrl(?string $url): self 88 | { 89 | $this->url = $url; 90 | return $this; 91 | } 92 | 93 | /** 94 | * @param string|null $imageUrl 95 | * @return EmbedMessage 96 | */ 97 | public function setImageUrl(?string $imageUrl): self 98 | { 99 | $this->imageUrl = $imageUrl; 100 | return $this; 101 | } 102 | 103 | /** 104 | * @param string|null $timestamp 105 | * @return EmbedMessage 106 | */ 107 | public function setTimestamp(?string $timestamp): self 108 | { 109 | $this->timestamp = $timestamp; 110 | return $this; 111 | } 112 | 113 | /** 114 | * @param string|null $authorName 115 | * @return EmbedMessage 116 | */ 117 | public function setAuthorName(?string $authorName): self 118 | { 119 | $this->authorName = $authorName; 120 | return $this; 121 | } 122 | 123 | /** 124 | * @param string|null $authorUrl 125 | * @return EmbedMessage 126 | */ 127 | public function setAuthorUrl(?string $authorUrl): self 128 | { 129 | $this->authorUrl = $authorUrl; 130 | return $this; 131 | } 132 | 133 | /** 134 | * @param string|null $authorIcon 135 | * @return EmbedMessage 136 | */ 137 | public function setAuthorIcon(?string $authorIcon): self 138 | { 139 | $this->authorIcon = $authorIcon; 140 | return $this; 141 | } 142 | 143 | /** 144 | * @param array $fields 145 | * @return EmbedMessage 146 | */ 147 | public function setFields(array $fields): self 148 | { 149 | $this->fields = $fields; 150 | return $this; 151 | } 152 | 153 | public function toJson(): string 154 | { 155 | return json_encode($this->toArray()); 156 | } 157 | 158 | public function toArray(): array 159 | { 160 | return [ 161 | 'username' => $this->username, 162 | 'content' => $this->content, 163 | 'avatar_url' => $this->avatarUrl, 164 | 'tts' => $this->tts, 165 | 'embeds' => [ 166 | [ 167 | 'title' => $this->title, 168 | 'description' => $this->description, 169 | 'url' => $this->url, 170 | 'timestamp' => $this->timestamp, 171 | 'color' => $this->color, 172 | 'footer' => [ 173 | 'text' => $this->footerText, 174 | 'icon_url' => $this->footerIcon 175 | ], 176 | 'thumbnail' => [ 177 | 'url' => $this->thumbnailUrl 178 | ], 179 | 'image' => [ 180 | 'url' => $this->imageUrl 181 | ], 182 | 'author' => [ 183 | 'name' => $this->authorName, 184 | 'url' => $this->authorUrl, 185 | 'icon_url' => $this->authorIcon 186 | ], 187 | 'fields' => $this->fields 188 | ] 189 | ] 190 | ]; 191 | } 192 | } 193 | -------------------------------------------------------------------------------- /src/Message/FileMessage.php: -------------------------------------------------------------------------------- 1 | file = $file; 23 | return $this; 24 | } 25 | 26 | public function toJson(): string 27 | { 28 | return json_encode($this->toArray()); 29 | } 30 | 31 | public function toArray(): array 32 | { 33 | $data = [ 34 | 'tts' => json_encode($this->tts), 35 | 'content' => $this->content, 36 | 'file' => $this->prepareFile(), 37 | 'username' => $this->username, 38 | 'avatar_url' => $this->avatarUrl, 39 | ]; 40 | 41 | // if any value has null value, remove it 42 | $data = array_filter($data, function ($value) { 43 | return $value !== null; 44 | }); 45 | 46 | return $data; 47 | } 48 | 49 | private function prepareFile(): CURLFile 50 | { 51 | $finfo = new finfo(FILEINFO_MIME_TYPE); 52 | $mime = $finfo->file($this->file->getRealPath()); 53 | $fileName = $this->file->getFilename(); 54 | 55 | // Get the default extension based on mime type 56 | $defaultExtension = $this->getDefaultExtension($mime); 57 | 58 | // if file name does not contain extension, add it 59 | if (strpos($fileName, '.') === false) { 60 | $fileName .= '.' . (!empty($defaultExtension) ? $defaultExtension : 'dat'); 61 | } 62 | 63 | return curl_file_create( 64 | $this->file->getRealPath(), 65 | $mime, 66 | $fileName 67 | ); 68 | } 69 | 70 | private function getDefaultExtension($mime): ?string 71 | { 72 | $mimeToExtensionMap = [ 73 | 'application/andrew-inset' => 'ez', 74 | 'application/applixware' => 'aw', 75 | 'application/atom+xml' => 'atom', 76 | 'application/atomcat+xml' => 'atomcat', 77 | 'application/atomsvc+xml' => 'atomsvc', 78 | 'application/ccxml+xml' => 'ccxml', 79 | 'application/cdmi-capability' => 'cdmia', 80 | 'application/cdmi-container' => 'cdmic', 81 | 'application/cdmi-domain' => 'cdmid', 82 | 'application/cdmi-object' => 'cdmio', 83 | 'application/cdmi-queue' => 'cdmiq', 84 | 'application/cu-seeme' => 'cu', 85 | 'application/davmount+xml' => 'davmount', 86 | 'application/docbook+xml' => 'dbk', 87 | 'application/dssc+der' => 'dssc', 88 | 'application/dssc+xml' => 'xdssc', 89 | 'application/ecmascript' => 'ecma', 90 | 'application/emma+xml' => 'emma', 91 | 'application/epub+zip' => 'epub', 92 | 'application/exi' => 'exi', 93 | 'application/font-tdpfr' => 'pfr', 94 | 'application/gml+xml' => 'gml', 95 | 'application/gpx+xml' => 'gpx', 96 | 'application/gxf' => 'gxf', 97 | 'application/hyperstudio' => 'stk', 98 | 'application/inkml+xml' => 'ink', 99 | 'application/ipfix' => 'ipfix', 100 | 'application/java-archive' => 'jar', 101 | 'application/java-serialized-object' => 'ser', 102 | 'application/java-vm' => 'class', 103 | 'application/javascript' => 'js', 104 | 'application/json' => 'json', 105 | 'application/jsonml+json' => 'jsonml', 106 | 'application/lost+xml' => 'lostxml', 107 | 'application/mac-binhex40' => 'hqx', 108 | 'application/mac-compactpro' => 'cpt', 109 | 'application/mads+xml' => 'mads', 110 | 'application/marc' => 'mrc', 111 | 'application/marcxml+xml' => 'mrcx', 112 | 'application/mathematica' => 'ma', 113 | 'application/mathml+xml' => 'mathml', 114 | 'application/mbox' => 'mbox', 115 | 'application/mediaservercontrol+xml' => 'mscml', 116 | 'application/metalink+xml' => 'metalink', 117 | 'application/metalink4+xml' => 'meta4', 118 | 'application/mets+xml' => 'mets', 119 | 'application/mods+xml' => 'mods', 120 | 'application/mp21' => 'm21', 121 | 'application/mp4' => 'mp4s', 122 | 'application/msword' => 'doc', 123 | 'application/mxf' => 'mxf', 124 | 'application/octet-stream' => 'bin', 125 | 'application/oda' => 'oda', 126 | 'application/oebps-package+xml' => 'opf', 127 | 'application/ogg' => 'ogx', 128 | 'application/omdoc+xml' => 'omdoc', 129 | 'application/onenote' => 'onetoc', 130 | 'application/oxps' => 'oxps', 131 | 'application/patch-ops-error+xml' => 'xer', 132 | 'application/pdf' => 'pdf', 133 | 'application/pgp-encrypted' => 'pgp', 134 | 'application/pgp-signature' => 'asc', 135 | 'application/pics-rules' => 'prf', 136 | 'application/pkcs10' => 'p10', 137 | 'application/pkcs7-mime' => 'p7m', 138 | 'application/pkcs7-signature' => 'p7s', 139 | 'application/pkcs8' => 'p8', 140 | 'application/pkix-attr-cert' => 'ac', 141 | 'application/pkix-cert' => 'cer', 142 | 'application/pkix-crl' => 'crl', 143 | 'application/pkix-pkipath' => 'pkipath', 144 | 'application/pkixcmp' => 'pki', 145 | 'application/pls+xml' => 'pls', 146 | 'application/postscript' => 'ai', 147 | 'application/prs.cww' => 'cww', 148 | 'application/pskc+xml' => 'pskcxml', 149 | 'application/rdf+xml' => 'rdf', 150 | 'application/reginfo+xml' => 'rif', 151 | 'application/relax-ng-compact-syntax' => 'rnc', 152 | 'application/resource-lists+xml' => 'rl', 153 | 'application/resource-lists-diff+xml' => 'rld', 154 | 'application/rls-services+xml' => 'rs', 155 | 'application/rpki-ghostbusters' => 'gbr', 156 | 'application/rpki-manifest' => 'mft', 157 | 'application/rpki-roa' => 'roa', 158 | 'application/rsd+xml' => 'rsd', 159 | 'application/rss+xml' => 'rss', 160 | 'application/rtf' => 'rtf', 161 | 'application/sbml+xml' => 'sbml', 162 | 'application/scvp-cv-request' => 'scq', 163 | 'application/scvp-cv-response' => 'scs', 164 | 'application/scvp-vp-request' => 'spq', 165 | 'application/scvp-vp-response' => 'spp', 166 | 'application/sdp' => 'sdp', 167 | 'application/set-payment-initiation' => 'setpay', 168 | 'application/set-registration-initiation' => 'setreg', 169 | 'application/shf+xml' => 'shf', 170 | 'application/smil+xml' => 'smi', 171 | 'application/sparql-query' => 'rq', 172 | 'application/sparql-results+xml' => 'srx', 173 | 'application/srgs' => 'gram', 174 | 'application/srgs+xml' => 'grxml', 175 | 'application/sru+xml' => 'sru', 176 | 'application/ssdl+xml' => 'ssdl', 177 | 'application/ssml+xml' => 'ssml', 178 | 'application/tei+xml' => 'tei', 179 | 'application/thraud+xml' => 'tfi', 180 | 'application/timestamped-data' => 'tsd', 181 | 'application/vnd.3gpp.pic-bw-large' => 'plb', 182 | 'application/vnd.3gpp.pic-bw-small' => 'psb', 183 | 'application/vnd.3gpp.pic-bw-var' => 'pvb', 184 | 'application/vnd.3gpp2.tcap' => 'tcap', 185 | 'application/vnd.3m.post-it-notes' => 'pwn', 186 | 'application/vnd.accpac.simply.aso' => 'aso', 187 | 'application/vnd.accpac.simply.imp' => 'imp', 188 | 'application/vnd.acucobol' => 'acu', 189 | 'application/vnd.acucorp' => 'atc', 190 | 'application/vnd.adobe.air-application-installer-package+zip' => 'air', 191 | 'application/vnd.adobe.formscentral.fcdt' => 'fcdt', 192 | 'application/vnd.adobe.fxp' => 'fxp', 193 | 'application/vnd.adobe.xdp+xml' => 'xdp', 194 | 'application/vnd.adobe.xfdf' => 'xfdf', 195 | 'application/vnd.ahead.space' => 'ahead', 196 | 'application/vnd.airzip.filesecure.azf' => 'azf', 197 | 'application/vnd.airzip.filesecure.azs' => 'azs', 198 | 'application/vnd.amazon.ebook' => 'azw', 199 | 'application/vnd.americandynamics.acc' => 'acc', 200 | 'application/vnd.amiga.ami' => 'ami', 201 | 'application/vnd.android.package-archive' => 'apk', 202 | 'application/vnd.anser-web-certificate-issue-initiation' => 'cii', 203 | 'application/vnd.anser-web-funds-transfer-initiation' => 'fti', 204 | 'application/vnd.antix.game-component' => 'atx', 205 | 'application/vnd.apple.installer+xml' => 'mpkg', 206 | 'application/vnd.apple.mpegurl' => 'm3u8', 207 | 'application/vnd.aristanetworks.swi' => 'swi', 208 | 'application/vnd.astraea-software.iota' => 'iota', 209 | 'application/vnd.audiograph' => 'aep', 210 | 'application/vnd.blueice.multipass' => 'mpm', 211 | 'application/vnd.bmi' => 'bmi', 212 | 'application/vnd.businessobjects' => 'rep', 213 | 'application/vnd.chemdraw+xml' => 'cdxml', 214 | 'application/vnd.chipnuts.karaoke-mmd' => 'mmd', 215 | 'application/vnd.cinderella' => 'cdy', 216 | 'application/vnd.claymore' => 'cla', 217 | 'application/vnd.cloanto.rp9' => 'rp9', 218 | 'application/vnd.clonk.c4group' => 'c4g', 219 | 'application/vnd.cluetrust.cartomobile-config' => 'c11amc', 220 | 'application/vnd.cluetrust.cartomobile-config-pkg' => 'c11amz', 221 | 'application/vnd.commonspace' => 'csp', 222 | 'application/vnd.contact.cmsg' => 'cdbcmsg', 223 | 'application/vnd.cosmocaller' => 'cmc', 224 | 'application/vnd.crick.clicker' => 'clkx', 225 | 'application/vnd.crick.clicker.keyboard' => 'clkk', 226 | 'application/vnd.crick.clicker.palette' => 'clkp', 227 | 'application/vnd.crick.clicker.template' => 'clkt', 228 | 'application/vnd.crick.clicker.wordbank' => 'clkw', 229 | 'application/vnd.criticaltools.wbs+xml' => 'wbs', 230 | 'application/vnd.ctc-posml' => 'pml', 231 | 'application/vnd.cups-ppd' => 'ppd', 232 | 'application/vnd.curl.car' => 'car', 233 | 'application/vnd.curl.pcurl' => 'pcurl', 234 | 'application/vnd.dart' => 'dart', 235 | 'application/vnd.data-vision.rdz' => 'rdz', 236 | 'application/vnd.dece.data' => 'uvf', 237 | 'application/vnd.dece.ttml+xml' => 'uvt', 238 | 'application/vnd.dece.unspecified' => 'uvx', 239 | 'application/vnd.dece.zip' => 'uvz', 240 | 'application/vnd.denovo.fcselayout-link' => 'fe_launch', 241 | 'application/vnd.dna' => 'dna', 242 | 'application/vnd.dolby.mlp' => 'mlp', 243 | 'application/vnd.dpgraph' => 'dpg', 244 | 'application/vnd.dreamfactory' => 'dfac', 245 | 'application/vnd.ds-keypoint' => 'kpxx', 246 | 'application/vnd.dvb.ait' => 'ait', 247 | 'application/vnd.dvb.service' => 'svc', 248 | 'application/vnd.dynageo' => 'geo', 249 | 'application/vnd.ecowin.chart' => 'mag', 250 | 'application/vnd.enliven' => 'nml', 251 | 'application/vnd.epson.esf' => 'esf', 252 | 'application/vnd.epson.msf' => 'msf', 253 | 'application/vnd.epson.quickanime' => 'qam', 254 | 'application/vnd.epson.salt' => 'slt', 255 | 'application/vnd.epson.ssf' => 'ssf', 256 | 'application/vnd.eszigno3+xml' => 'es3', 257 | 'application/vnd.ezpix-album' => 'ez2', 258 | 'application/vnd.ezpix-package' => 'ez3', 259 | 'application/vnd.fdf' => 'fdf', 260 | 'application/vnd.fdsn.mseed' => 'mseed', 261 | 'application/vnd.fdsn.seed' => 'seed', 262 | 'application/vnd.flographit' => 'gph', 263 | 'application/vnd.fluxtime.clip' => 'ftc', 264 | 'application/vnd.framemaker' => 'fm', 265 | 'application/vnd.frogans.fnc' => 'fnc', 266 | 'application/vnd.frogans.ltf' => 'ltf', 267 | 'application/vnd.fsc.weblaunch' => 'fsc', 268 | 'application/vnd.fujitsu.oasys' => 'oas', 269 | 'application/vnd.fujitsu.oasys2' => 'oa2', 270 | 'application/vnd.fujitsu.oasys3' => 'oa3', 271 | 'application/vnd.fujitsu.oasysgp' => 'fg5', 272 | 'application/vnd.fujitsu.oasysprs' => 'bh2', 273 | 'application/vnd.fujixerox.ddd' => 'ddd', 274 | 'application/vnd.fujixerox.docuworks' => 'xdw', 275 | 'application/vnd.fujixerox.docuworks.binder' => 'xbd', 276 | 'application/vnd.fuzzysheet' => 'fzs', 277 | 'application/vnd.genomatix.tuxedo' => 'txd', 278 | 'application/vnd.geogebra.file' => 'ggb', 279 | 'application/vnd.geogebra.tool' => 'ggt', 280 | 'application/vnd.geometry-explorer' => 'gex', 281 | 'application/vnd.geonext' => 'gxt', 282 | 'application/vnd.geoplan' => 'g2w', 283 | 'application/vnd.geospace' => 'g3w', 284 | 'application/vnd.gmx' => 'gmx', 285 | 'application/vnd.google-earth.kml+xml' => 'kml', 286 | 'application/vnd.google-earth.kmz' => 'kmz', 287 | 'application/vnd.grafeq' => 'gqf', 288 | 'application/vnd.groove-account' => 'gac', 289 | 'application/vnd.groove-help' => 'ghf', 290 | 'application/vnd.groove-identity-message' => 'gim', 291 | 'application/vnd.groove-injector' => 'grv', 292 | 'application/vnd.groove-tool-message' => 'gtm', 293 | 'application/vnd.groove-tool-template' => 'tpl', 294 | 'application/vnd.groove-vcard' => 'vcg', 295 | 'application/vnd.hal+xml' => 'hal', 296 | 'application/vnd.handheld-entertainment+xml' => 'zmm', 297 | 'application/vnd.hbci' => 'hbci', 298 | 'application/vnd.hhe.lesson-player' => 'les', 299 | 'application/vnd.hp-hpgl' => 'hpgl', 300 | 'application/vnd.hp-hpid' => 'hpid', 301 | 'application/vnd.hp-hps' => 'hps', 302 | 'application/vnd.hp-jlyt' => 'jlt', 303 | 'application/vnd.hp-pcl' => 'pcl', 304 | 'application/vnd.hp-pclxl' => 'pclxl', 305 | 'application/vnd.hydrostatix.sof-data' => 'sfd-hdstx', 306 | 'application/vnd.ibm.minipay' => 'mpy', 307 | 'application/vnd.ibm.modcap' => 'afp', 308 | 'application/vnd.ibm.rights-management' => 'irm', 309 | 'application/vnd.ibm.secure-container' => 'sc', 310 | 'application/vnd.iccprofile' => 'icc', 311 | 'application/vnd.igloader' => 'igl', 312 | 'application/vnd.immervision-ivp' => 'ivp', 313 | 'application/vnd.immervision-ivu' => 'ivu', 314 | 'application/vnd.insors.igm' => 'igm', 315 | 'application/vnd.intercon.formnet' => 'xpw', 316 | 'application/vnd.intergeo' => 'i2g', 317 | 'application/vnd.intu.qbo' => 'qbo', 318 | 'application/vnd.intu.qfx' => 'qfx', 319 | 'application/vnd.ipunplugged.rcprofile' => 'rcprofile', 320 | 'application/vnd.irepository.package+xml' => 'irp', 321 | 'application/vnd.is-xpr' => 'xpr', 322 | 'application/vnd.isac.fcs' => 'fcs', 323 | 'application/vnd.jam' => 'jam', 324 | 'application/vnd.jcp.javame.midlet-rms' => 'rms', 325 | 'application/vnd.jisp' => 'jisp', 326 | 'application/vnd.joost.joda-archive' => 'joda', 327 | 'application/vnd.kahootz' => 'ktz', 328 | 'application/vnd.kde.karbon' => 'karbon', 329 | 'application/vnd.kde.kchart' => 'chrt', 330 | 'application/vnd.kde.kformula' => 'kfo', 331 | 'application/vnd.kde.kivio' => 'flw', 332 | 'application/vnd.kde.kontour' => 'kon', 333 | 'application/vnd.kde.kpresenter' => 'kpr', 334 | 'application/vnd.kde.kspread' => 'ksp', 335 | 'application/vnd.kde.kword' => 'kwd', 336 | 'application/vnd.kenameaapp' => 'htke', 337 | 'application/vnd.kidspiration' => 'kia', 338 | 'application/vnd.kinar' => 'kne', 339 | 'application/vnd.koan' => 'skp', 340 | 'application/vnd.kodak-descriptor' => 'sse', 341 | 'application/vnd.las.las+xml' => 'lasxml', 342 | 'application/vnd.llamagraphics.life-balance.desktop' => 'lbd', 343 | 'application/vnd.llamagraphics.life-balance.exchange+xml' => 'lbe', 344 | 'application/vnd.lotus-1-2-3' => '123', 345 | 'application/vnd.lotus-approach' => 'apr', 346 | 'application/vnd.lotus-freelance' => 'pre', 347 | 'application/vnd.lotus-notes' => 'nsf', 348 | 'application/vnd.lotus-organizer' => 'org', 349 | 'application/vnd.lotus-screencam' => 'scm', 350 | 'application/vnd.lotus-wordpro' => 'lwp', 351 | 'application/vnd.macports.portpkg' => 'portpkg', 352 | 'application/vnd.mcd' => 'mcd', 353 | 'application/vnd.medcalcdata' => 'mc1', 354 | 'application/vnd.mediastation.cdkey' => 'cdkey', 355 | 'application/vnd.mfer' => 'mwf', 356 | 'application/vnd.mfmp' => 'mfm', 357 | 'application/vnd.micrografx.flo' => 'flo', 358 | 'application/vnd.micrografx.igx' => 'igx', 359 | 'application/vnd.mif' => 'mif', 360 | 'application/vnd.mobius.daf' => 'daf', 361 | 'application/vnd.mobius.dis' => 'dis', 362 | 'application/vnd.mobius.mbk' => 'mbk', 363 | 'application/vnd.mobius.mqy' => 'mqy', 364 | 'application/vnd.mobius.msl' => 'msl', 365 | 'application/vnd.mobius.plc' => 'plc', 366 | 'application/vnd.mobius.txf' => 'txf', 367 | 'application/vnd.mophun.application' => 'mpn', 368 | 'application/vnd.mophun.certificate' => 'mpc', 369 | 'application/vnd.mozilla.xul+xml' => 'xul', 370 | 'application/vnd.ms-artgalry' => 'cil', 371 | 'application/vnd.ms-cab-compressed' => 'cab', 372 | 'application/vnd.ms-excel' => 'xls', 373 | 'application/vnd.ms-excel.addin.macroenabled.12' => 'xlam', 374 | 'application/vnd.ms-excel.sheet.binary.macroenabled.12' => 'xlsb', 375 | 'application/vnd.ms-excel.sheet.macroenabled.12' => 'xlsm', 376 | 'application/vnd.ms-excel.template.macroenabled.12' => 'xltm', 377 | 'application/vnd.ms-fontobject' => 'eot', 378 | 'application/vnd.ms-htmlhelp' => 'chm', 379 | 'application/vnd.ms-ims' => 'ims', 380 | 'application/vnd.ms-lrm' => 'lrm', 381 | 'application/vnd.ms-officetheme' => 'thmx', 382 | 'application/vnd.ms-pki.seccat' => 'cat', 383 | 'application/vnd.ms-pki.stl' => 'stl', 384 | 'application/vnd.ms-powerpoint' => 'ppt', 385 | 'application/vnd.ms-powerpoint.addin.macroenabled.12' => 'ppam', 386 | 'application/vnd.ms-powerpoint.presentation.macroenabled.12' => 'pptm', 387 | 'application/vnd.ms-powerpoint.slide.macroenabled.12' => 'sldm', 388 | 'application/vnd.ms-powerpoint.slideshow.macroenabled.12' => 'ppsm', 389 | 'application/vnd.ms-powerpoint.template.macroenabled.12' => 'potm', 390 | 'application/vnd.ms-project' => 'mpp', 391 | 'application/vnd.ms-word.document.macroenabled.12' => 'docm', 392 | 'application/vnd.ms-word.template.macroenabled.12' => 'dotm', 393 | 'application/vnd.ms-works' => 'wps', 394 | 'application/vnd.ms-wpl' => 'wpl', 395 | 'application/vnd.ms-xpsdocument' => 'xps', 396 | 'application/vnd.mseq' => 'mseq', 397 | 'application/vnd.musician' => 'mus', 398 | 'application/vnd.muvee.style' => 'msty', 399 | 'application/vnd.mynfc' => 'taglet', 400 | 'application/vnd.neurolanguage.nlu' => 'nlu', 401 | 'application/vnd.nitf' => 'ntf', 402 | 'application/vnd.noblenet-directory' => 'nnd', 403 | 'application/vnd.noblenet-sealer' => 'nns', 404 | 'application/vnd.noblenet-web' => 'nnw', 405 | 'application/vnd.nokia.n-gage.data' => 'ngdat', 406 | 'application/vnd.nokia.n-gage.symbian.install' => 'n-gage', 407 | 'application/vnd.nokia.radio-preset' => 'rpst', 408 | 'application/vnd.nokia.radio-presets' => 'rpss', 409 | 'application/vnd.novadigm.edm' => 'edm', 410 | 'application/vnd.novadigm.edx' => 'edx', 411 | 'application/vnd.novadigm.ext' => 'ext', 412 | 'application/vnd.oasis.opendocument.chart' => 'odc', 413 | 'application/vnd.oasis.opendocument.chart-template' => 'otc', 414 | 'application/vnd.oasis.opendocument.database' => 'odb', 415 | 'application/vnd.oasis.opendocument.formula' => 'odf', 416 | 'application/vnd.oasis.opendocument.formula-template' => 'odft', 417 | 'application/vnd.oasis.opendocument.graphics' => 'odg', 418 | 'application/vnd.oasis.opendocument.graphics-template' => 'otg', 419 | 'application/vnd.oasis.opendocument.image' => 'odi', 420 | 'application/vnd.oasis.opendocument.image-template' => 'oti', 421 | 'application/vnd.oasis.opendocument.presentation' => 'odp', 422 | 'application/vnd.oasis.opendocument.presentation-template' => 'otp', 423 | 'application/vnd.oasis.opendocument.spreadsheet' => 'ods', 424 | 'application/vnd.oasis.opendocument.spreadsheet-template' => 'ots', 425 | 'application/vnd.oasis.opendocument.text' => 'odt', 426 | 'application/vnd.oasis.opendocument.text-master' => 'odm', 427 | 'application/vnd.oasis.opendocument.text-template' => 'ott', 428 | 'application/vnd.oasis.opendocument.text-web' => 'oth', 429 | 'application/vnd.olpc-sugar' => 'xo', 430 | 'application/vnd.oma.dd2+xml' => 'dd2', 431 | 'application/vnd.openofficeorg.extension' => 'oxt', 432 | 'application/vnd.openxmlformats-officedocument.presentationml.presentation' => 'pptx', 433 | 'application/vnd.openxmlformats-officedocument.presentationml.slide' => 'sldx', 434 | 'application/vnd.openxmlformats-officedocument.presentationml.slideshow' => 'ppsx', 435 | 'application/vnd.openxmlformats-officedocument.presentationml.template' => 'potx', 436 | 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' => 'xlsx', 437 | 'application/vnd.openxmlformats-officedocument.spreadsheetml.template' => 'xltx', 438 | 'application/vnd.openxmlformats-officedocument.wordprocessingml.document' => 'docx', 439 | 'application/vnd.openxmlformats-officedocument.wordprocessingml.template' => 'dotx', 440 | 'application/vnd.osgeo.mapguide.package' => 'mgp', 441 | 'application/vnd.osgi.dp' => 'dp', 442 | 'application/vnd.osgi.subsystem' => 'esa', 443 | 'application/vnd.palm' => 'pdb', 444 | 'application/vnd.pawaafile' => 'paw', 445 | 'application/vnd.pg.format' => 'str', 446 | 'application/vnd.pg.osasli' => 'ei6', 447 | 'application/vnd.picsel' => 'efif', 448 | 'application/vnd.pmi.widget' => 'wg', 449 | 'application/vnd.pocketlearn' => 'plf', 450 | 'application/vnd.powerbuilder6' => 'pbd', 451 | 'application/vnd.previewsystems.box' => 'box', 452 | 'application/vnd.proteus.magazine' => 'mgz', 453 | 'application/vnd.publishare-delta-tree' => 'qps', 454 | 'application/vnd.pvi.ptid1' => 'ptid', 455 | 'application/vnd.quark.quarkxpress' => 'qxd', 456 | 'application/vnd.realvnc.bed' => 'bed', 457 | 'application/vnd.recordare.musicxml' => 'mxl', 458 | 'application/vnd.recordare.musicxml+xml' => 'musicxml', 459 | 'application/vnd.rig.cryptonote' => 'cryptonote', 460 | 'application/vnd.rim.cod' => 'cod', 461 | 'application/vnd.rn-realmedia' => 'rm', 462 | 'application/vnd.rn-realmedia-vbr' => 'rmvb', 463 | 'application/vnd.route66.link66+xml' => 'link66', 464 | 'application/vnd.sailingtracker.track' => 'st', 465 | 'application/vnd.seemail' => 'see', 466 | 'application/vnd.sema' => 'sema', 467 | 'application/vnd.semd' => 'semd', 468 | 'application/vnd.semf' => 'semf', 469 | 'application/vnd.shana.informed.formdata' => 'ifm', 470 | 'application/vnd.shana.informed.formtemplate' => 'itp', 471 | 'application/vnd.shana.informed.interchange' => 'iif', 472 | 'application/vnd.shana.informed.package' => 'ipk', 473 | 'application/vnd.simtech-mindmapper' => 'twd', 474 | 'application/vnd.smaf' => 'mmf', 475 | 'application/vnd.smart.teacher' => 'teacher', 476 | 'application/vnd.solent.sdkm+xml' => 'sdkm', 477 | 'application/vnd.spotfire.dxp' => 'dxp', 478 | 'application/vnd.spotfire.sfs' => 'sfs', 479 | 'application/vnd.stardivision.calc' => 'sdc', 480 | 'application/vnd.stardivision.draw' => 'sda', 481 | 'application/vnd.stardivision.impress' => 'sdd', 482 | 'application/vnd.stardivision.math' => 'smf', 483 | 'application/vnd.stardivision.writer' => 'sdw', 484 | 'application/vnd.stardivision.writer-global' => 'sgl', 485 | 'application/vnd.stepmania.package' => 'smzip', 486 | 'application/vnd.stepmania.stepchart' => 'sm', 487 | 'application/vnd.sun.xml.calc' => 'sxc', 488 | 'application/vnd.sun.xml.calc.template' => 'stc', 489 | 'application/vnd.sun.xml.draw' => 'sxd', 490 | 'application/vnd.sun.xml.draw.template' => 'std', 491 | 'application/vnd.sun.xml.impress' => 'sxi', 492 | 'application/vnd.sun.xml.impress.template' => 'sti', 493 | 'application/vnd.sun.xml.math' => 'sxm', 494 | 'application/vnd.sun.xml.writer' => 'sxw', 495 | 'application/vnd.sun.xml.writer.global' => 'sxg', 496 | 'application/vnd.sun.xml.writer.template' => 'stw', 497 | 'application/vnd.sus-calendar' => 'sus', 498 | 'application/vnd.svd' => 'svd', 499 | 'application/vnd.symbian.install' => 'sis', 500 | 'application/vnd.syncml+xml' => 'xsm', 501 | 'application/vnd.syncml.dm+wbxml' => 'bdm', 502 | 'application/vnd.syncml.dm+xml' => 'xdm', 503 | 'application/vnd.tao.intent-module-archive' => 'tao', 504 | 'application/vnd.tcpdump.pcap' => 'pcap', 505 | 'application/vnd.tmobile-livetv' => 'tmo', 506 | 'application/vnd.trid.tpt' => 'tpt', 507 | 'application/vnd.triscape.mxs' => 'mxs', 508 | 'application/vnd.trueapp' => 'tra', 509 | 'application/vnd.ufdl' => 'ufd', 510 | 'application/vnd.uiq.theme' => 'utz', 511 | 'application/vnd.umajin' => 'umj', 512 | 'application/vnd.unity' => 'unityweb', 513 | 'application/vnd.uoml+xml' => 'uoml', 514 | 'application/vnd.vcx' => 'vcx', 515 | 'application/vnd.visio' => 'vsd', 516 | 'application/vnd.visionary' => 'vis', 517 | 'application/vnd.vsf' => 'vsf', 518 | 'application/vnd.wap.wbxml' => 'wbxml', 519 | 'application/vnd.wap.wmlc' => 'wmlc', 520 | 'application/vnd.wap.wmlscriptc' => 'wmlsc', 521 | 'application/vnd.webturbo' => 'wtb', 522 | 'application/vnd.wolfram.player' => 'nbp', 523 | 'application/vnd.wordperfect' => 'wpd', 524 | 'application/vnd.wqd' => 'wqd', 525 | 'application/vnd.wt.stf' => 'stf', 526 | 'application/vnd.xara' => 'xar', 527 | 'application/vnd.xfdl' => 'xfdl', 528 | 'application/vnd.yamaha.hv-dic' => 'hvd', 529 | 'application/vnd.yamaha.hv-script' => 'hvs', 530 | 'application/vnd.yamaha.hv-voice' => 'hvp', 531 | 'application/vnd.yamaha.openscoreformat' => 'osf', 532 | 'application/vnd.yamaha.openscoreformat.osfpvg+xml' => 'osfpvg', 533 | 'application/vnd.yamaha.smaf-audio' => 'saf', 534 | 'application/vnd.yamaha.smaf-phrase' => 'spf', 535 | 'application/vnd.yellowriver-custom-menu' => 'cmp', 536 | 'application/vnd.zul' => 'zir', 537 | 'application/vnd.zzazz.deck+xml' => 'zaz', 538 | 'application/voicexml+xml' => 'vxml', 539 | 'application/widget' => 'wgt', 540 | 'application/winhlp' => 'hlp', 541 | 'application/wsdl+xml' => 'wsdl', 542 | 'application/wspolicy+xml' => 'wspolicy', 543 | 'application/x-7z-compressed' => '7z', 544 | 'application/x-abiword' => 'abw', 545 | 'application/x-ace-compressed' => 'ace', 546 | 'application/x-apple-diskimage' => 'dmg', 547 | 'application/x-authorware-bin' => 'aab', 548 | 'application/x-authorware-map' => 'aam', 549 | 'application/x-authorware-seg' => 'aas', 550 | 'application/x-bcpio' => 'bcpio', 551 | 'application/x-bittorrent' => 'torrent', 552 | 'application/x-blorb' => 'blb', 553 | 'application/x-bzip' => 'bz', 554 | 'application/x-bzip2' => 'bz2', 555 | 'application/x-cbr' => 'cbr', 556 | 'application/x-cdlink' => 'vcd', 557 | 'application/x-cfs-compressed' => 'cfs', 558 | 'application/x-chat' => 'chat', 559 | 'application/x-chess-pgn' => 'pgn', 560 | 'application/x-conference' => 'nsc', 561 | 'application/x-cpio' => 'cpio', 562 | 'application/x-csh' => 'csh', 563 | 'application/x-debian-package' => 'deb', 564 | 'application/x-dgc-compressed' => 'dgc', 565 | 'application/x-director' => 'dir', 566 | 'application/x-doom' => 'wad', 567 | 'application/x-dtbncx+xml' => 'ncx', 568 | 'application/x-dtbook+xml' => 'dtb', 569 | 'application/x-dtbresource+xml' => 'res', 570 | 'application/x-dvi' => 'dvi', 571 | 'application/x-envoy' => 'evy', 572 | 'application/x-eva' => 'eva', 573 | 'application/x-font-bdf' => 'bdf', 574 | 'application/x-font-ghostscript' => 'gsf', 575 | 'application/x-font-linux-psf' => 'psf', 576 | 'application/x-font-otf' => 'otf', 577 | 'application/x-font-pcf' => 'pcf', 578 | 'application/x-font-snf' => 'snf', 579 | 'application/x-font-ttf' => 'ttf', 580 | 'application/x-font-type1' => 'pfa', 581 | 'application/x-font-woff' => 'woff', 582 | 'application/x-freearc' => 'arc', 583 | 'application/x-futuresplash' => 'spl', 584 | 'application/x-gca-compressed' => 'gca', 585 | 'application/x-glulx' => 'ulx', 586 | 'application/x-gnumeric' => 'gnumeric', 587 | 'application/x-gramps-xml' => 'gramps', 588 | 'application/x-gtar' => 'gtar', 589 | 'application/x-hdf' => 'hdf', 590 | 'application/x-install-instructions' => 'install', 591 | 'application/x-iso9660-image' => 'iso', 592 | 'application/x-java-jnlp-file' => 'jnlp', 593 | 'application/x-latex' => 'latex', 594 | 'application/x-lzh-compressed' => 'lzh', 595 | 'application/x-mie' => 'mie', 596 | 'application/x-mobipocket-ebook' => 'prc', 597 | 'application/x-ms-application' => 'application', 598 | 'application/x-ms-shortcut' => 'lnk', 599 | 'application/x-ms-wmd' => 'wmd', 600 | 'application/x-ms-wmz' => 'wmz', 601 | 'application/x-ms-xbap' => 'xbap', 602 | 'application/x-msaccess' => 'mdb', 603 | 'application/x-msbinder' => 'obd', 604 | 'application/x-mscardfile' => 'crd', 605 | 'application/x-msclip' => 'clp', 606 | 'application/x-msdownload' => 'exe', 607 | 'application/x-msmediaview' => 'mvb', 608 | 'application/x-msmetafile' => 'wmf', 609 | 'application/x-msmoney' => 'mny', 610 | 'application/x-mspublisher' => 'pub', 611 | 'application/x-msschedule' => 'scd', 612 | 'application/x-msterminal' => 'trm', 613 | 'application/x-mswrite' => 'wri', 614 | 'application/x-netcdf' => 'nc', 615 | 'application/x-nzb' => 'nzb', 616 | 'application/x-pkcs12' => 'p12', 617 | 'application/x-pkcs7-certificates' => 'p7b', 618 | 'application/x-pkcs7-certreqresp' => 'p7r', 619 | 'application/x-rar-compressed' => 'rar', 620 | 'application/x-rar' => 'rar', 621 | 'application/x-research-info-systems' => 'ris', 622 | 'application/x-sh' => 'sh', 623 | 'application/x-shar' => 'shar', 624 | 'application/x-shockwave-flash' => 'swf', 625 | 'application/x-silverlight-app' => 'xap', 626 | 'application/x-sql' => 'sql', 627 | 'application/x-stuffit' => 'sit', 628 | 'application/x-stuffitx' => 'sitx', 629 | 'application/x-subrip' => 'srt', 630 | 'application/x-sv4cpio' => 'sv4cpio', 631 | 'application/x-sv4crc' => 'sv4crc', 632 | 'application/x-t3vm-image' => 't3', 633 | 'application/x-tads' => 'gam', 634 | 'application/x-tar' => 'tar', 635 | 'application/x-tcl' => 'tcl', 636 | 'application/x-tex' => 'tex', 637 | 'application/x-tex-tfm' => 'tfm', 638 | 'application/x-texinfo' => 'texinfo', 639 | 'application/x-tgif' => 'obj', 640 | 'application/x-ustar' => 'ustar', 641 | 'application/x-wais-source' => 'src', 642 | 'application/x-x509-ca-cert' => 'der', 643 | 'application/x-xfig' => 'fig', 644 | 'application/x-xliff+xml' => 'xlf', 645 | 'application/x-xpinstall' => 'xpi', 646 | 'application/x-xz' => 'xz', 647 | 'application/x-zmachine' => 'z1', 648 | 'application/xaml+xml' => 'xaml', 649 | 'application/xcap-diff+xml' => 'xdf', 650 | 'application/xenc+xml' => 'xenc', 651 | 'application/xhtml+xml' => 'xhtml', 652 | 'application/xml' => 'xml', 653 | 'application/xml-dtd' => 'dtd', 654 | 'application/xop+xml' => 'xop', 655 | 'application/xproc+xml' => 'xpl', 656 | 'application/xslt+xml' => 'xslt', 657 | 'application/xspf+xml' => 'xspf', 658 | 'application/xv+xml' => 'mxml', 659 | 'application/yang' => 'yang', 660 | 'application/yin+xml' => 'yin', 661 | 'application/zip' => 'zip', 662 | 'audio/adpcm' => 'adp', 663 | 'audio/basic' => 'au', 664 | 'audio/midi' => 'mid', 665 | 'audio/mp3' => 'mp3', 666 | 'audio/mp4' => 'mp4a', 667 | 'audio/mpeg' => 'mpga', 668 | 'audio/ogg' => 'oga', 669 | 'audio/s3m' => 's3m', 670 | 'audio/silk' => 'sil', 671 | 'audio/vnd.dece.audio' => 'uva', 672 | 'audio/vnd.digital-winds' => 'eol', 673 | 'audio/vnd.dra' => 'dra', 674 | 'audio/vnd.dts' => 'dts', 675 | 'audio/vnd.dts.hd' => 'dtshd', 676 | 'audio/vnd.lucent.voice' => 'lvp', 677 | 'audio/vnd.ms-playready.media.pya' => 'pya', 678 | 'audio/vnd.nuera.ecelp4800' => 'ecelp4800', 679 | 'audio/vnd.nuera.ecelp7470' => 'ecelp7470', 680 | 'audio/vnd.nuera.ecelp9600' => 'ecelp9600', 681 | 'audio/vnd.rip' => 'rip', 682 | 'audio/webm' => 'weba', 683 | 'audio/x-aac' => 'aac', 684 | 'audio/x-aiff' => 'aif', 685 | 'audio/x-caf' => 'caf', 686 | 'audio/x-flac' => 'flac', 687 | 'audio/x-matroska' => 'mka', 688 | 'audio/x-mpegurl' => 'm3u', 689 | 'audio/x-ms-wax' => 'wax', 690 | 'audio/x-ms-wma' => 'wma', 691 | 'audio/x-pn-realaudio' => 'ram', 692 | 'audio/x-pn-realaudio-plugin' => 'rmp', 693 | 'audio/x-wav' => 'wav', 694 | 'audio/xm' => 'xm', 695 | 'chemical/x-cdx' => 'cdx', 696 | 'chemical/x-cif' => 'cif', 697 | 'chemical/x-cmdf' => 'cmdf', 698 | 'chemical/x-cml' => 'cml', 699 | 'chemical/x-csml' => 'csml', 700 | 'chemical/x-xyz' => 'xyz', 701 | 'image/bmp' => 'bmp', 702 | 'image/x-ms-bmp' => 'bmp', 703 | 'image/cgm' => 'cgm', 704 | 'image/g3fax' => 'g3', 705 | 'image/gif' => 'gif', 706 | 'image/ief' => 'ief', 707 | 'image/jpeg' => 'jpeg', 708 | 'image/pjpeg' => 'jpeg', 709 | 'image/ktx' => 'ktx', 710 | 'image/png' => 'png', 711 | 'image/prs.btif' => 'btif', 712 | 'image/sgi' => 'sgi', 713 | 'image/svg+xml' => 'svg', 714 | 'image/tiff' => 'tiff', 715 | 'image/vnd.adobe.photoshop' => 'psd', 716 | 'image/vnd.dece.graphic' => 'uvi', 717 | 'image/vnd.dvb.subtitle' => 'sub', 718 | 'image/vnd.djvu' => 'djvu', 719 | 'image/vnd.dwg' => 'dwg', 720 | 'image/vnd.dxf' => 'dxf', 721 | 'image/vnd.fastbidsheet' => 'fbs', 722 | 'image/vnd.fpx' => 'fpx', 723 | 'image/vnd.fst' => 'fst', 724 | 'image/vnd.fujixerox.edmics-mmr' => 'mmr', 725 | 'image/vnd.fujixerox.edmics-rlc' => 'rlc', 726 | 'image/vnd.ms-modi' => 'mdi', 727 | 'image/vnd.ms-photo' => 'wdp', 728 | 'image/vnd.net-fpx' => 'npx', 729 | 'image/vnd.wap.wbmp' => 'wbmp', 730 | 'image/vnd.xiff' => 'xif', 731 | 'image/webp' => 'webp', 732 | 'image/x-3ds' => '3ds', 733 | 'image/x-cmu-raster' => 'ras', 734 | 'image/x-cmx' => 'cmx', 735 | 'image/x-freehand' => 'fh', 736 | 'image/x-icon' => 'ico', 737 | 'image/x-mrsid-image' => 'sid', 738 | 'image/x-pcx' => 'pcx', 739 | 'image/x-pict' => 'pic', 740 | 'image/x-portable-anymap' => 'pnm', 741 | 'image/x-portable-bitmap' => 'pbm', 742 | 'image/x-portable-graymap' => 'pgm', 743 | 'image/x-portable-pixmap' => 'ppm', 744 | 'image/x-rgb' => 'rgb', 745 | 'image/x-tga' => 'tga', 746 | 'image/x-xbitmap' => 'xbm', 747 | 'image/x-xpixmap' => 'xpm', 748 | 'image/x-xwindowdump' => 'xwd', 749 | 'message/rfc822' => 'eml', 750 | 'model/iges' => 'igs', 751 | 'model/mesh' => 'msh', 752 | 'model/vnd.collada+xml' => 'dae', 753 | 'model/vnd.dwf' => 'dwf', 754 | 'model/vnd.gdl' => 'gdl', 755 | 'model/vnd.gtw' => 'gtw', 756 | 'model/vnd.mts' => 'mts', 757 | 'model/vnd.vtu' => 'vtu', 758 | 'model/vrml' => 'wrl', 759 | 'model/x3d+binary' => 'x3db', 760 | 'model/x3d+vrml' => 'x3dv', 761 | 'model/x3d+xml' => 'x3d', 762 | 'text/cache-manifest' => 'appcache', 763 | 'text/calendar' => 'ics', 764 | 'text/css' => 'css', 765 | 'text/csv' => 'csv', 766 | 'text/html' => 'html', 767 | 'text/n3' => 'n3', 768 | 'text/plain' => 'txt', 769 | 'text/prs.lines.tag' => 'dsc', 770 | 'text/richtext' => 'rtx', 771 | 'text/rtf' => 'rtf', 772 | 'text/sgml' => 'sgml', 773 | 'text/tab-separated-values' => 'tsv', 774 | 'text/troff' => 't', 775 | 'text/turtle' => 'ttl', 776 | 'text/uri-list' => 'uri', 777 | 'text/vcard' => 'vcard', 778 | 'text/vnd.curl' => 'curl', 779 | 'text/vnd.curl.dcurl' => 'dcurl', 780 | 'text/vnd.curl.scurl' => 'scurl', 781 | 'text/vnd.curl.mcurl' => 'mcurl', 782 | 'text/vnd.dvb.subtitle' => 'sub', 783 | 'text/vnd.fly' => 'fly', 784 | 'text/vnd.fmi.flexstor' => 'flx', 785 | 'text/vnd.graphviz' => 'gv', 786 | 'text/vnd.in3d.3dml' => '3dml', 787 | 'text/vnd.in3d.spot' => 'spot', 788 | 'text/vnd.sun.j2me.app-descriptor' => 'jad', 789 | 'text/vnd.wap.wml' => 'wml', 790 | 'text/vnd.wap.wmlscript' => 'wmls', 791 | 'text/x-asm' => 's', 792 | 'text/x-c' => 'c', 793 | 'text/x-fortran' => 'f', 794 | 'text/x-pascal' => 'p', 795 | 'text/x-java-source' => 'java', 796 | 'text/x-opml' => 'opml', 797 | 'text/x-nfo' => 'nfo', 798 | 'text/x-setext' => 'etx', 799 | 'text/x-sfv' => 'sfv', 800 | 'text/x-uuencode' => 'uu', 801 | 'text/x-vcalendar' => 'vcs', 802 | 'text/x-vcard' => 'vcf', 803 | 'video/3gpp' => '3gp', 804 | 'video/3gpp2' => '3g2', 805 | 'video/h261' => 'h261', 806 | 'video/h263' => 'h263', 807 | 'video/h264' => 'h264', 808 | 'video/jpeg' => 'jpgv', 809 | 'video/jpm' => 'jpm', 810 | 'video/mj2' => 'mj2', 811 | 'video/mp4' => 'mp4', 812 | 'video/mpeg' => 'mpeg', 813 | 'video/ogg' => 'ogv', 814 | 'video/quicktime' => 'qt', 815 | 'video/vnd.dece.hd' => 'uvh', 816 | 'video/vnd.dece.mobile' => 'uvm', 817 | 'video/vnd.dece.pd' => 'uvp', 818 | 'video/vnd.dece.sd' => 'uvs', 819 | 'video/vnd.dece.video' => 'uvv', 820 | 'video/vnd.dvb.file' => 'dvb', 821 | 'video/vnd.fvt' => 'fvt', 822 | 'video/vnd.mpegurl' => 'mxu', 823 | 'video/vnd.ms-playready.media.pyv' => 'pyv', 824 | 'video/vnd.uvvu.mp4' => 'uvu', 825 | 'video/vnd.vivo' => 'viv', 826 | 'video/webm' => 'webm', 827 | 'video/x-f4v' => 'f4v', 828 | 'video/x-fli' => 'fli', 829 | 'video/x-flv' => 'flv', 830 | 'video/x-m4v' => 'm4v', 831 | 'video/x-matroska' => 'mkv', 832 | 'video/x-mng' => 'mng', 833 | 'video/x-ms-asf' => 'asf', 834 | 'video/x-ms-vob' => 'vob', 835 | 'video/x-ms-wm' => 'wm', 836 | 'video/x-ms-wmv' => 'wmv', 837 | 'video/x-ms-wmx' => 'wmx', 838 | 'video/x-ms-wvx' => 'wvx', 839 | 'video/x-msvideo' => 'avi', 840 | 'video/x-sgi-movie' => 'movie', 841 | 'video/x-smv' => 'smv', 842 | 'x-conference/x-cooltalk' => 'ice' 843 | ]; 844 | 845 | return $mimeToExtensionMap[$mime] ?? null; 846 | } 847 | 848 | public function isMultiPart(): bool 849 | { 850 | return true; 851 | } 852 | 853 | public function setFileFromURL(string $url): self 854 | { 855 | $tempFile = tempnam(sys_get_temp_dir(), 'file_'); 856 | file_put_contents($tempFile, file_get_contents($url)); 857 | $this->setFile(new SplFileObject($tempFile)); 858 | 859 | return $this; 860 | } 861 | } 862 | -------------------------------------------------------------------------------- /src/Message/Message.php: -------------------------------------------------------------------------------- 1 | tts = $tts; 30 | return $this; 31 | } 32 | 33 | /** 34 | * @param string $content 35 | * @return FileMessage 36 | */ 37 | 38 | public function setContent(string $content): self 39 | { 40 | $this->content = $content; 41 | return $this; 42 | } 43 | 44 | /** 45 | * @param string|null $username 46 | * @return EmbedMessage 47 | */ 48 | public function setUsername(?string $username): self 49 | { 50 | $this->username = $username; 51 | return $this; 52 | } 53 | 54 | /** 55 | * @param string|null $avatarUrl 56 | * @return EmbedMessage 57 | */ 58 | public function setAvatarUrl(?string $avatarUrl): self 59 | { 60 | $this->avatarUrl = $avatarUrl; 61 | return $this; 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /src/Message/MessageFactory.php: -------------------------------------------------------------------------------- 1 | new TextMessage(), 19 | 'embed' => new EmbedMessage(), 20 | 'file' => new FileMessage(), 21 | default => throw new InvalidArgumentException('Invalid message type'), 22 | }; 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /src/Message/TextMessage.php: -------------------------------------------------------------------------------- 1 | toArray()); 12 | } 13 | 14 | public function toArray(): array 15 | { 16 | return [ 17 | 'username' => $this->username, 18 | 'content' => $this->content, 19 | 'avatar_url' => $this->avatarUrl, 20 | 'tts' => $this->tts, 21 | ]; 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /tests/MessageFactoryTest.php: -------------------------------------------------------------------------------- 1 | create("text"); 15 | $embedMessage = $messageFactory->create("embed"); 16 | 17 | $this->assertInstanceOf(TextMessage::class, $textMessage); 18 | $this->assertInstanceOf(EmbedMessage::class, $embedMessage); 19 | } 20 | } 21 | --------------------------------------------------------------------------------