Download the PHP package baka/http without Composer

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

Baka Http

PhalconPHP package to create fast RESTful API's providing a simple way to create fast CRUD's

Table of Contents

  1. Testing
  2. REST CRUD
    1. Controller Configuration
  3. QueryParser
  4. QueryParser Extended

Testing

Routes Configuration

To avoid having to create Controller for CRUD api we provide the \Baka\Http\Rest\CrudController

Add to your routes.php

You can also pass params to the routes to disable JWT and in the future assigne a middleware

Controller configuration

Add

QueryParser

Parse GET request for a API , giving the user the correct phalcon model params to perform a search

QueryParser CustomFields (DEPRECATED)

Parse GET request for a API , given the same params as before but with cq (for custom domains) , this give out a normal SQL statement for a raw query

GET - /v1/?q=(searchField1:value1,searchField2:value2)&cq=(member_id:1)&q=(leads_status_id:1) relationship of this model

QueryParser Extended

The extended query parser allows you to append search parameters directly via the controller without having to rewrite the function code.

Features include the ability to search within a model, within a model's custom fields and within a model's descendant relationships.

Parameters are passed in the format field operator value. Valid operators are :, >, <.

Multiple fields can be search by separating them with a ,. You can search a field by several values by separating said values with | (equivalent to SQL's OR).

Query the Model

GET - /v1/model?q=(field1:value1,field2:value2|value3)

Query the Custom Fields

GET - /v1/model?cq=(field1>value1)

Query related Models

Querying related models demands a slightly different structure. Each related model that we want queried must be passed as they are named in the system, _ is used to separate camel cases.

GET - /v1/model?rq[model_name]=(field1<value1|value2)

Between

While between is strictly not supported at this time, you can produce the same result following this procedure:

GET - /v1/model?q=(field1>value1,field1<value2)

Like, Empty or Not

There is another nice feature that you can use to query the model.

Like

Empty

You can tell the query parser to make sure a field is empty. In the case of integer properties, the query parser will ask the model if the default value for a property is 0. If it is, it will include 0 as an empty value.

GET - /v1/model?q=(field1:%%)

Not

This is the opposite of the above Empty.

GET - /v1/model?q=(field1:$$)

One for all, and all for One

You can use all the above described feature together in one query.

GET - /v1/model?q=(field1:value1|value2,field2>value3,field2<value4,field3:$$)&cq=(field4:value5)&rq[model_name]=(field5>value6)

Just remember to escape any special character you want to send through a query string to avoid unwanted results.

Usage

In order to access the extended query parser features your controller has to extend from CrudExtendedController.

To append additional search parameters you simply do this:

This method uses the operators that are passed to the query parser via the URL query. Valid operators are (with their SQL equivalents):

API Custom Fields CRUD

The CRUD handles the default behavior:

In other to use the custom fields you need to extend you controller from CrudCustomFieldsController and define the method onConstruct() on this method you define the model of the custom field and the model of the value of this custom fields

Thats it, your controller now manages the custom fields as if they wher properties of the main class

Normal API CRUD

Just extend your API controller from CrudController and you will have the following functions:

The CRUD handles the default behaviero:

createFields and updateFields are needed to be define in other to create the field


All versions of http with dependencies

PHP Build Version
Package Version
Requires php Version >=7.2
ext-phalcon Version >=3.0.0
vlucas/phpdotenv Version ^2.0
phalcon/incubator Version >=3.0.0
baka/database Version ^0.5
baka/elasticsearch Version ^1.0
elasticsearch/elasticsearch Version ^6.1
guzzlehttp/guzzle Version ^6.3
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 baka/http contains the following files

Loading the files please wait ....