{"id":19671454,"url":"https://github.com/multitheftauto/mtasa-php-sdk","last_synced_at":"2025-04-29T00:33:39.462Z","repository":{"id":35098659,"uuid":"165022776","full_name":"multitheftauto/mtasa-php-sdk","owner":"multitheftauto","description":"The official PHP SDK for the Multi Theft Auto Web Interface.","archived":false,"fork":false,"pushed_at":"2023-08-01T11:29:37.000Z","size":416,"stargazers_count":19,"open_issues_count":2,"forks_count":7,"subscribers_count":6,"default_branch":"master","last_synced_at":"2024-04-14T05:11:58.830Z","etag":null,"topics":["composer","httplug","multi-theft-auto","php","sdk"],"latest_commit_sha":null,"homepage":"https://multitheftauto.com","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/multitheftauto.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null}},"created_at":"2019-01-10T08:40:16.000Z","updated_at":"2023-08-25T17:07:52.000Z","dependencies_parsed_at":"2023-02-17T04:45:52.923Z","dependency_job_id":"2c516fb9-4493-4cf3-a8e8-661130413ede","html_url":"https://github.com/multitheftauto/mtasa-php-sdk","commit_stats":{"total_commits":235,"total_committers":10,"mean_commits":23.5,"dds":0.5191489361702128,"last_synced_commit":"145d6bc4fb1112bb1559175daedb7e569de1ead9"},"previous_names":[],"tags_count":13,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/multitheftauto%2Fmtasa-php-sdk","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/multitheftauto%2Fmtasa-php-sdk/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/multitheftauto%2Fmtasa-php-sdk/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/multitheftauto%2Fmtasa-php-sdk/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/multitheftauto","download_url":"https://codeload.github.com/multitheftauto/mtasa-php-sdk/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223774951,"owners_count":17200440,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["composer","httplug","multi-theft-auto","php","sdk"],"created_at":"2024-11-11T17:08:50.778Z","updated_at":"2024-11-11T17:08:51.337Z","avatar_url":"https://github.com/multitheftauto.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# MTA:SA PHP SDK \n![PHP Composer](https://github.com/multitheftauto/mtasa-php-sdk/workflows/PHP%20Composer/badge.svg?branch=master)\n\nYou can access the MTA Web Interface from almost any programming language that can request web pages. PHP can do this very easily.\n\nThis SDK provides one function call that will allow you to call any exported script functions on any server that you have access to.\n\nSee the [official wiki page](https://wiki.multitheftauto.com/wiki/PHP_SDK) for further information.\n\n## Installation\n\n### Prerequisites\n\nThis SDK requires PHP 7.4 or greater.\n\n### HTTPlug client abstraction\n\nAs this SDK uses HTTPlug, you will have to require some libraries for get it working. See [\"HTTPlug for library users\"](http://docs.php-http.org/en/latest/httplug/users.html) for more info.\n\n**Quick installation (Fixed from HTTPlug documentation)**\n```\ncomposer require php-http/curl-client guzzlehttp/psr7 php-http/message http-interop/http-factory-guzzle\n```\n\n:warning: **Note**: If you don't follow this requirement before require the SDK, composer will throw you an error.\n\n### Setup\n\nThe only supported installation method is via [Composer](https://getcomposer.org). Run the following command to require this SDK in your project:\n\n```\ncomposer require multitheftauto/mtasa-php-sdk\n```\n\n## A simple example\n\nThere are three ways to call an MTA server's exported functions, as shown in the following example:\n\n```php\n\u003c?php\n\nrequire_once('vendor/autoload.php');\n\nuse MultiTheftAuto\\Sdk\\Mta;\nuse MultiTheftAuto\\Sdk\\Model\\Server;\nuse MultiTheftAuto\\Sdk\\Model\\Authentication;\n\n$server = new Server('127.0.0.1', 22005);\n$auth = new Authentication('myUser', 'myPassword');\n$mta = new Mta($server, $auth);\n\n$response = $mta-\u003egetResource('someResource')-\u003ecall('callableFunction', $arg1, $arg2, $arg3, ...);\n// or\n$response = $mta-\u003egetResource('someResource')-\u003ecall-\u003ecallableFunction($arg1, $arg2, $arg3, ...);\n\nvar_dump($response);\n```\n\n# Development environment setup\n\n**Prerequisites**:\n- [docker-compose](https://docs.docker.com/compose/install/)\n\nFirst, we need to build the local docker image. To do this, run the following command:\n\n    $ docker-compose build\n\nWe will be using an alias for executing the development commands.\n\n    $ alias dcli='docker-compose -f docker-compose.cli.yml run --rm'\n\n**Install dependencies**:\n\n    $ dcli composer install\n\n## Running tests\n\nTo run the project tests and validate the coding standards:\n\n    $ dcli composer test\n\nTo run all unit tests you can use:\n\n    $ dcli phpunit\n\nTo run specific unit test you can use --filter option:\n\n    $ dcli phpunit --filter=ClassName::MethodName\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmultitheftauto%2Fmtasa-php-sdk","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmultitheftauto%2Fmtasa-php-sdk","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmultitheftauto%2Fmtasa-php-sdk/lists"}