diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..11d1e11 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,5 @@ +# Changelog + +# 2.0 + * Add composer + * Stable release diff --git a/LICENSE b/LICENSE.md similarity index 100% rename from LICENSE rename to LICENSE.md diff --git a/README.md b/README.md index 4c392fb..0f01515 100644 --- a/README.md +++ b/README.md @@ -11,6 +11,26 @@ To work with api you need to perform several actions: 2. Get access_token (see below) 3. Set **client_id** and **secret_key** application. +## USAGE + +With composer + +```php + +``` + +Without + +```php + +``` + ## Get access_token Execute method get_code_token for get link. Go to link and get access app, after you redirected on blank page with access_token on hash url. diff --git a/README_RU.md b/README_RU.md index 729e3a8..31b8b2b 100644 --- a/README_RU.md +++ b/README_RU.md @@ -9,6 +9,27 @@ Vkontakte Api for PHP 2. Получить access_token (об этом ниже) 3. Классу нужно передать **client_id** приложения и секретный ключ который вам даётся при создании приложения +## Использование + +C composer + +```php + +``` + +без + +```php + +``` + + ## Получение access_token Выполним метод get_code_token для получения ссылки которая вернёт нам code diff --git a/composer.json b/composer.json new file mode 100644 index 0000000..94debca --- /dev/null +++ b/composer.json @@ -0,0 +1,20 @@ +{ + "name": "fdcore/vk.api", + "description": "Vk api extension", + "authors": [ + { + "name": "Dmitriy Nyashkin", + "email": "dmitriy@nyashk.in" + } + ], + "version":"2.0", + "require": { + "php":">=5.4.0" + }, + "require-dev": { + "phpunit/phpunit": "~3.7.0" + }, + "autoload": { + "files": ["src/vk.php"] + } +} diff --git a/example/_connect_vk.php b/example/_connect_vk.php index 848df18..4385332 100644 --- a/example/_connect_vk.php +++ b/example/_connect_vk.php @@ -1,6 +1,6 @@ api('wall.delete', array('post_id' => 0)); diff --git a/vk.php b/src/vk.php similarity index 99% rename from vk.php rename to src/vk.php index a3c5da2..1873c86 100644 --- a/vk.php +++ b/src/vk.php @@ -3,7 +3,7 @@ * Class Vk * @author: Dmitriy Nyashkin * @link: https://github.com/fdcore/vk.api - * @version: 2 + * @version: 2.0 */ // Возвращаемые ошибки https://vk.com/dev/errors @@ -12,7 +12,7 @@ class VkException extends Exception {}; class Vk{ - private $v = '5.35'; // версия Api VKontakte @link https://vk.com/dev/versions + private $v = '5.53'; // версия Api VKontakte @link https://vk.com/dev/versions const VERSION = '2.0'; // версия этой библиотеки const CALLBACK_BLANK = 'https://oauth.vk.com/blank.html'; @@ -64,6 +64,7 @@ public function api($method = '', array $vars = []){ $params = http_build_query($vars); $url = $this->http_build_query($method, $params); + print $url; return $this->call($url); } @@ -368,4 +369,3 @@ public function uploadVideosFromArray(array $videos){ return $attached_videos; } } -