{"id":15017623,"url":"https://github.com/socialconnect/vk","last_synced_at":"2025-04-12T12:33:20.298Z","repository":{"id":19557990,"uuid":"22806850","full_name":"SocialConnect/vk","owner":"SocialConnect","description":"ВКонтакте Social Network SDK","archived":false,"fork":false,"pushed_at":"2015-11-10T17:54:46.000Z","size":676,"stargazers_count":17,"open_issues_count":0,"forks_count":7,"subscribers_count":8,"default_branch":"master","last_synced_at":"2025-04-10T18:47:38.057Z","etag":null,"topics":["php","sdk","vk","vkontakte","vkontakte-api","vkontakte-client","vkontakte-sdk"],"latest_commit_sha":null,"homepage":"http://sc.dmtry.me/","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"andrew867/timeclock","license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/SocialConnect.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}},"created_at":"2014-08-10T10:40:34.000Z","updated_at":"2023-12-29T01:49:47.000Z","dependencies_parsed_at":"2022-07-22T12:02:15.251Z","dependency_job_id":null,"html_url":"https://github.com/SocialConnect/vk","commit_stats":null,"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SocialConnect%2Fvk","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SocialConnect%2Fvk/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SocialConnect%2Fvk/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SocialConnect%2Fvk/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/SocialConnect","download_url":"https://codeload.github.com/SocialConnect/vk/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248566753,"owners_count":21125714,"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":["php","sdk","vk","vkontakte","vkontakte-api","vkontakte-client","vkontakte-sdk"],"created_at":"2024-09-24T19:50:46.129Z","updated_at":"2025-04-12T12:33:20.272Z","avatar_url":"https://github.com/SocialConnect.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# \u003cimg src=\"https://socialconnect.github.io/assets/icons/vk.png\" width=\"27\"\u003e ВКонтакте SDK\r\n\r\n[![Latest Stable Version](https://poser.pugx.org/SocialConnect/vk-sdk/v/stable.svg)](https://packagist.org/packages/SocialConnect/vk-sdk)\r\n[![Build Status](https://travis-ci.org/SocialConnect/vk.svg?branch=master)](https://travis-ci.org/SocialConnect/vk)\r\n[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/SocialConnect/vk/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/SocialConnect/vk/?branch=master)\r\n[![Code Coverage](https://scrutinizer-ci.com/g/SocialConnect/vk/badges/coverage.png?b=master)](https://scrutinizer-ci.com/g/SocialConnect/vk/?branch=master)\r\n[![License](https://poser.pugx.org/SocialConnect/vk/license.svg)](https://packagist.org/packages/SocialConnect/vk)\r\n\r\nLibrary for work with VK API.\r\n\r\nInstallation\r\n------------\r\n\r\nAdd a requirement to your `composer.json`:\r\n\r\n```json\r\n{\r\n    \"require\": {\r\n        \"socialconnect/vk\": \"~0.4\"\r\n    }\r\n}\r\n```\r\n\r\nRun the composer installer:\r\n\r\n```bash\r\nphp composer.phar install\r\n```\r\n\r\nHow to use\r\n----------\r\n\r\nFirst you need to create service:\r\n\r\n```php\r\n// Your Vk Application Settings\r\n$appId = 123456;\r\n$appSecret = 'secret';\r\n\r\n$vkService = new \\SocialConnect\\Vk\\Client($appId, $appSecret);\r\n$vkService-\u003esetHttpClient(new \\SocialConnect\\Common\\Http\\Client\\Curl());\r\n```\r\n\r\n## Get user with specified $id:\r\n\r\n```php\r\n$user = $vkService-\u003egetUser(1);\r\nvar_dump($user);\r\n```\r\n\r\n## Get users with specified array $ids:\r\n\r\n```php\r\n$users = $vkService-\u003egetUsers([1, 2]);\r\nvar_dump($users);\r\n```\r\n\r\n## Customs methods\r\n\r\n```php\r\n$parameters = [];\r\n$result = $vkService-\u003erequest('method/CustomMethod', $parameters);\r\nif ($result) {\r\n    var_dump($result);\r\n}\r\n```\r\n\r\n## Custom entities\r\n\r\n```php\r\nclass MyUserEntitiy extends \\SocialConnect\\Vk\\Entity\\User {\r\n    public function myOwnMethod()\r\n    {\r\n        //do something\r\n    }\r\n}\r\n\r\n$vkService-\u003egetEntityUser(new MyUserEntitiy());\r\n$user = $vkService-\u003egetUser(1);\r\n\r\nif ($user) {\r\n    $user-\u003emyOwnMethod();\r\n}\r\n```\r\n\r\nLicense\r\n-------\r\n\r\nThis project is open-sourced software licensed under the MIT License. See the LICENSE file for more information.\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsocialconnect%2Fvk","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsocialconnect%2Fvk","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsocialconnect%2Fvk/lists"}