Download the PHP package galafeno/lingo without Composer

On this page you can find all versions of the php package galafeno/lingo. 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 lingo

Lingo

Lingo is a package for Laravel that provides a layer of abstraction to any REST service. so it is possible to encapsulate http communication concepts in a much closer object-oriented design and thus improve developer experience.

Installation

Use the package manager composer to install Lingo.

Usage

Use the command make:lingo to initialize a new Lingo inside your application.

That command creates a class called AwesomeApiLingo within the folder App\Lingos.

To model the API you should add the endpoints inside the sync section into the AwesomeApiLingo class.

After that, you can use your Lingo inside your application like so:

The command method should receive at least one parameter (the command name). In that case it received 2 parameters because the getMovie command has a binding value (marked with the {:?} wildcard).

Custom Headers

Lingo was designed to handle json data type, so it will always append the Content-Type: application/json and Accept: application/json into default headers. To define another headers, create a headers property into your Lingo Class

That will produce the follow headers in every request:

You can also define extra headers in runtime like so:

Query parameters

To define query parameters, create a params property into your Lingo Class

That will insert the follow query parameters in every request:

You can also define extra query parameters in runtime like so:

Body Parameters

To define body parameters, create a data property into your Lingo Class

That will insert the follow body parameters in every request:

You can also define extra body parameters in runtime like so:

Closure Commands

Usually you should use Lingo as a way to map endpoints into commands. But using closure command syntax you can trigger a function instead of a real http request. That is a convenient way to append metadata about your api. To do so, use the keyword function inside your command configuration. Then just add the referred function in your Lingo class.

Handling Authentication

In real world applications REST services implements some type of authentication scheme. If you are dealing with a simple approach like a signature or key into request headers you should simply use the withHeaders command to attach your auth configuration into Lingo. But some services utilizes specifics schemes. To handle it you should define an auth configuration within your lingo class. currently, this package supports apiKeys and oauth2 auth methods.

apiKeys

That method will attach the key configuration as a query parameter.

oauth2

That method will handle the oauth2 flow to retrieve the jwt and cache it using your application cache configuration.

Mockup mode

While testing your application you must define APP_ENV=testing in your .env to activate Lingo mockup mode. While using this mode the package will bypass any real request by a mocked static data. You should define that data within your command configuration section using the shouldReturn key.

You can also set mockup mode in runtime like so:

Lingo use static as default mockup data mode. But you may set function mode with the mockup keyword. with that, Lingo will rely on a function to generate the mockup data.

Async Communication

If your application utilize AWS infrastructure you may configure asynchronous message within your Lingo class. To do so, you must configure your async section.

To send a asynchronous you have to use the async method.

That will push to your sqs queue the payload:

Roadmap

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update tests as appropriate.

License

MIT


All versions of lingo with dependencies

PHP Build Version
Package Version
Requires dusterio/laravel-plain-sqs Version ^0.1.17
guzzlehttp/guzzle Version ~6.0
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 galafeno/lingo contains the following files

Loading the files please wait ....