Download the PHP package nikxphreaker/yii2-hiring-backend without Composer

On this page you can find all versions of the php package nikxphreaker/yii2-hiring-backend. 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 yii2-hiring-backend

Yii 2 RESTful API


++++++++++++++++++++++++++++++++++ Yii2 RESTful API ++++++++++++++++++++++++++++++++++ This API using template from Yii-api-template. This is a a REST API TEMPLATE with Yii2. This template use Yii2-Micro approach so it will be lightweight and easy to deploy.

Installation


Install composer.

Install with git

To directory [app-name]

Setup Database


Setup database configuration from config/db.php.

Create new database


Import database hiring-backend.sql


Running API

Directory Structure


Since this template use MicroFramework approach, directory structure might be a little bit different from Yii2.

  config/             contains application configurations
  controllers/        contains Web controller classes
  models/             contains model classes
  modules/            contains your rest-api versioning (based on modules)
  vendor/             contains dependent 3rd-party packages
  web/                contains the entry script and Web resources

Test Using Postman


Download Postman.

Auth Scenario


This template already have basic endpoint that you can use to start your REST-API. Such as:

Endpoint Type Usage
https://localhost:8080/session GET list all session created
https://localhost:8080/view?id={id} POST View a session
https://localhost:8080/login POST Login with username and password (stored 3 cookies include id, username & token)
https://localhost:8080/signup POST Signup with username, email and password
https://localhost:8080/logout This endpoint must be use if you want to clear your cookies
https://localhost:8080/v1/session GET List all session created (Must Login)
https://localhost:8080/v1/session/create POST Create a new session (Must Login)
https://localhost:8080/v1/session/update?id={id} PUT / PATCH Update a session (Must Login)
https://localhost:8080/v1/session/delete?id={id} DELETE Delete a session (Must Login)
https://localhost:8080/v1/session/view?id={id} GET View a session (Must Login)

This template use modules as versioning pattern. Every version of API saved in a module. This template already have v1 module, so it means if consumer want to use v1 API, it can access https://localhost:8080/v1/endpoint.

API Scenario


Creating User






Login User

Don't forget to save your token






Setting token

Change type authorization to Bearer Token and place your token to Token field






Create Session

Input key and values like an image






Edit Session

Set id on params from exist data Session and edit it throught `x-www-form-urlencoded`






Delete Session

Set id on params from exist data Session






Viewing Detail Session

You need token if you using v1 endpoint






List Session

You need token if you using v1 endpoint






Supported Authentication


This template support 3 most used authentication. (Actually it's not me who make it, Yii2 already support it all :D ).

  1. HTTP Basic Auth: the access token is sent as the username. This should only be used when an access token can be safely stored on the API consumer side. For example, the API consumer is a program running on a server.
  2. Query parameter: the access token is sent as a query parameter in the API URL, e.g., https://example.com/users?access-token=xxxxxxxx. Because most Web servers will keep query parameters in server logs, this approach should be mainly used to serve JSONP requests which cannot use HTTP headers to send access tokens.
  3. OAuth 2: the access token is obtained by the consumer from an authorization server and sent to the API server via HTTP Bearer Tokens, according to the OAuth2 protocol.

Access Token Management


This application manage token via cookie without storing to table or data in database. Access Token have certain expiration based on $tokenExpiration value. Default Token Expiration are in seconds.

This cookies stored to your computer


if you want to delete all of this, you can using logout endpoint like this


API versioning


This template give you versioning scenario based on module application. In Yii2 a module are self-contained software units that consist of model, views, controllers and other supporting components. This template already have v1 module, it means all of endpoint for API v1 created in this module. When you publish a new API version (that break backward compatibility / BBC), you can create a new module. For more information create a module, you can visit this Yii2 Guide on Creating Module.

Screenshoot TEsting







All versions of yii2-hiring-backend with dependencies

PHP Build Version
Package Version
Requires yiisoft/yii2 Version ~2.0.14
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 nikxphreaker/yii2-hiring-backend contains the following files

Loading the files please wait ....