{"id":15283748,"url":"https://github.com/labi-le/kphp-vk-utils","last_synced_at":"2025-08-21T14:10:18.052Z","repository":{"id":57010512,"uuid":"367679456","full_name":"labi-le/kphp-vk-utils","owner":"labi-le","description":"A set of utilities for working with vk api!","archived":false,"fork":false,"pushed_at":"2024-05-06T19:23:11.000Z","size":113,"stargazers_count":6,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-07-17T16:19:42.796Z","etag":null,"topics":["astaroth-package","attachments","kphp","php","video","vk-utils"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/labi-le.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2021-05-15T16:27:26.000Z","updated_at":"2024-05-06T19:23:14.000Z","dependencies_parsed_at":"2025-04-12T23:09:34.118Z","dependency_job_id":"a91e805d-67ab-4310-9eb5-4402a1d641b1","html_url":"https://github.com/labi-le/kphp-vk-utils","commit_stats":null,"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"purl":"pkg:github/labi-le/kphp-vk-utils","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/labi-le%2Fkphp-vk-utils","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/labi-le%2Fkphp-vk-utils/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/labi-le%2Fkphp-vk-utils/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/labi-le%2Fkphp-vk-utils/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/labi-le","download_url":"https://codeload.github.com/labi-le/kphp-vk-utils/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/labi-le%2Fkphp-vk-utils/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":271493232,"owners_count":24769117,"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","status":"online","status_checked_at":"2025-08-21T02:00:08.990Z","response_time":74,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["astaroth-package","attachments","kphp","php","video","vk-utils"],"created_at":"2024-09-30T14:47:08.432Z","updated_at":"2025-08-21T14:10:18.024Z","avatar_url":"https://github.com/labi-le.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# vk-utils\n\n[![GitHub license](https://img.shields.io/badge/license-BSD-green.svg)](https://github.com/labi-le/kphp-vk-utils/blob/main/LICENSE)\n[![Packagist Stars](https://img.shields.io/packagist/stars/labile/kphp-vk-utils)](https://packagist.org/packages/labile/kphp-vk-utils/stats)\n[![Packagist Stats](https://img.shields.io/packagist/dt/labile/kphp-vk-utils)](https://packagist.org/packages/labile/kphp-vk-utils/stats)\n\n[Документация на русском языке](README_RU.md)\n\n## Installation\n\n`composer require labile/kphp-vk-utils`\n\n## How to use it?\n\n### Simple request\n\n```php\nuse Astaroth\\VkUtils\\Client;\n\n$api = new Client;\n\n$response = $api-\u003erequest('wall.get', ['owner_id' =\u003e 1]);\n```\n\n### Use Request class\n\n```php\nuse Astaroth\\VkUtils\\Client;\nuse Astaroth\\VkUtils\\Requests\\Request;\n\n$api = new Client;\n\n$request = new Request('wall.get', ['owner_id' =\u003e 1]);\n$response = $api-\u003esend($request);\n```\n\n### Use ExecuteRequest class\n\nSending multiple requests at the same time\n\n```php\nuse Astaroth\\VkUtils\\Execute;\nuse Astaroth\\VkUtils\\Requests\\Request;\n\n$api = new Execute;\n$api-\u003esetDefaultToken('PUT ACCESS TOKEN');\n$execute = [\n    new Request('wall.get', ['owner_id' =\u003e 1]),\n    new Request('wall.get', ['owner_id' =\u003e 2]),\n    // ...more request\n    new Request('wall.get', ['owner_id' =\u003e 25]),\n    ];\n\n$response = $api-\u003esend($execute);\n```\n\n### Using the required api version\n\n```php\nuse Astaroth\\VkUtils\\Client;\n\n$api = new Client('5.131');\n```\n\n### Using a token for requests\n\nSet default token in client\n\n```php\nuse Astaroth\\VkUtils\\Client;\n\n$api = new Client();\n\n$api-\u003esetDefaultToken(\"PUT TOKEN\");\n```\n\nor so\n\n```php\nuse Astaroth\\VkUtils\\Requests\\Request;\nuse Astaroth\\VkUtils\\Client;\n\n$api = new Client;\n\n// The token in the request takes precedence over setDefaultToken\n$request = new Request('wall.get', ['owner_id' =\u003e 1], \"some_token\");\n```\n\n### Constructors\n\n#### Attachment upload constructor\n\n```php\nuse Astaroth\\VkUtils\\Builders\\Attachments\\Message\\Graffiti;\nuse Astaroth\\VkUtils\\Builders\\Attachments\\Photo;\nuse Astaroth\\VkUtils\\Builders\\Attachments\\Video;\nuse Astaroth\\VkUtils\\Uploader;\nuse Astaroth\\VkUtils\\Builders\\Attachments\\Message\\AudioMessage;\n\n$uploader = new Uploader();\n$uploader-\u003esetDefaultToken('PUT TOKEN');\n\n$attachments = $uploader-\u003eupload\n(\n    new Photo(\"dog.jpg\"),\n\n    new AudioMessage('meow.mp3'),\n    \n    //downloading from the link temporarily does not work\n    (new Video('https://commondatastorage.googleapis.com/gtv-videos-bucket/sample/ForBiggerEscapes.mp4'))\n        -\u003esetName('4 Biggers Escapes')\n        -\u003esetDescription('The video has nothing interesting, just an example')\n        -\u003esetWallpost(true),\n\n    new Graffiti('cat.png')\n);\n```\n\n#### Builder\n\n```php\n\nuse Astaroth\\VkUtils\\Builders;\nuse Astaroth\\VkUtils\\Builders\\Message;\nuse Astaroth\\VkUtils\\Builders\\Post;\n\n$token = 'PUT TOKEN';\n\n$builder = new \\Astaroth\\VkUtils\\Builder();\n\n$builders[] = (new Message)\n    -\u003esetMessage(\"hi me name is lola! im lol\")\n    -\u003esetPeerId(418618);\n\n$builders[] = (new Post)\n    -\u003esetMessage(\"hello subscribers\")\n\n$response = $builder-\u003ecreate(...$builders)\n);\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flabi-le%2Fkphp-vk-utils","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flabi-le%2Fkphp-vk-utils","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flabi-le%2Fkphp-vk-utils/lists"}