Download the PHP package kneu/api without Composer

On this page you can find all versions of the php package kneu/api. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package api

PHP client for KNEU RESTful API Service

This PHP Library provide programmatic user-friendly interface to work with the KNEU RESTful API and OAuth 2.0.

Ця PHP-бібліотека забезпечує зручний програмний інтерфейс для роботи з КНЕУ RESTful API та протоколом OAuth 2.0.

Встановлення

Додати бібліотеку до Вашого проекту за допомогою Composer

composer require kneu/api

Опис методів

$api = Kneu\Api::createWithOauthToken($client_id, $client_secret, $code, $redirect_uri): Kneu\Api

Завершити процедуру oauth - отримати access_token на основі отриманого від клієнта значення code.

$api = Kneu\Api::createWithServerToken($client_id, $client_secret): Kneu\Api

Авторизація стороннього серверу для роботи з API (імпорту списку факультетів, кафедр, викладачів, академічних груп, спеціальностей).

getAccessToken(): ?string

Отримати access_token, який був отриманний після createWithServerToken або createWithOauthToken.

setReturnAssociative()

За замовчуванням, методи повертають дані як об'єкти stdClass. Метод setReturnAssociative() дозволяє змінити тип данних на асоціативний массив.

getUser()

Отримати інформацію про поточного користувача з поточним access_token. Інформація про користувача доступна лише після виклику oauthToken(). При використанні авторизації серверу (serverToken()) - інформація про користувача не надається.

getFaculties([array $filters = [],] [[integer $offset = null,] integer $limit = null]): Generator

Отримати перелік факультетів

getDepartments([array $filters = [],] [[integer $offset = null,] integer $limit = null]): Generator

Отримати перелік кафедр Дозволяє отримати перелік кафедр. Надає перелік:

Об'єкт Кафедра надається разом з даними по зв'язанному об'єкту Факультет.

getTeachers([array $filters = [],] [[integer $offset = null,] integer $limit = null]): Generator

Дозволяє отримати перелік викладачів. Надає перелік:

Увага! Обєкт User є необов'язковий. Присутний лише в разі, коли викладач вже зар'єструвався на сайті.

Внутрішня реалізація метода автоматично робить потрібну кількисть запитів до сервера, щоб отримати повний список викладачів.

getSpecialties([array $filters = [],] [[integer $offset = null,] integer $limit = null]): Generator

Дозволяє отримати перелік спеціальностей. Надає перелік:

Надається разом із даними зв'язаного об'єкту Факультет. Внутрішня реалізація метода автоматично робить потрібну кількисть запитів до сервера, щоб отримати повний список спеціальностей.

getGroups([array $filters = [],] [[integer $offset = null,] integer $limit = null]): Generator

Дозволяє отримати перелік академічних груп. Надає перелік:

Об'єкт група надається разом із зв'заним об'єктом спеціальність.

getStudents([array $filters = [],] [[integer $offset = null,] integer $limit = null]): Generator

Дозволяє отримати перелік студентів. Надає перелік:

Якщо студент зарєстрованний на сайті, додатково до додається інформацію про звязанну сутність користувач (User). Якщо студент не зарєстрованний на сайті - інформація про User відсутня у результаті. Внутрішня реалізація метода автоматично робить потрібну кількисть запитів до сервера, щоб отримати повний список груп.

getFaculty(integer $id)

Отримати факультет зі вказаним id

getDepartment(integer $id)

Отримати кафедру зі вказаним id

getTeacher(integer $id)

Отримати викладача зі вказаним id

getSpecialty(integer $id)

Отримати спеціальність зі вказаним id

getGroup(integer $id)

Отримати групу зі вказаним id

getStudent(integer $id)

Отримати студента зі вказаним id

request($method, array $params = array())

Виклик довільного API-методу.

getContentRange($key)

Дозволяє отримати Meta-інформацію про загальну кількість об'єктів певної сутності (для переліку викладачів, спеціальностей, факультетів тощо). Інформація надається із заголовку Content-Range, тому метод getContentRange() може надати інформацію лише після виконання методу (запиту) на отримання переліку об'єктів певної сутності. Наприклад, метод getContentRange() доцільно викликати після виконання методів getTeachers(), getGroups(), getSpecialities() тощо. Детальніше застосування методу getContentRange() подано в прикладі коду нижче (у розділі Авторизація серверу та імпорт бази даних).

Приклад використання

Авторизація користувача та імпорт даних про користувача

Авторизація серверу та імпорт бази даних


All versions of api with dependencies

PHP Build Version
Package Version
Requires php Version >=5.5
ext-curl Version *
ext-json Version *
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package kneu/api contains the following files

Loading the files please wait ....