Download the PHP package info-com/econtext-sdk-php without Composer

On this page you can find all versions of the php package info-com/econtext-sdk-php. 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 econtext-sdk-php

A simple PHP client to expose the eContext API.

Installation

We recommending using Composer to include the eContext library in your project. In the composer.json file for your project you can simply include econtext-sdk-php and Composer will handle downloading and including the most recent version for you.

Basic Usage

eContext\Client

The basic client object that wraps in the GuzzleHttp objects. It should be passed to each of the calls that are passed in to the API.

Parameters

The statusCallback can be used to interact during a run. The callback function must receive two parameters. The first is an index number corresponding to the sequence id for that call (e.g. $data[4]). The second is a GuzzleHttp Response object for the call (this is true if the API call is successful or fails).

eContext\Classify\Type\Social

A Social Classification object which interacts with the classify/social endpoint. The data object for the Social object should be a list of social content phrases (e.g. ["this is my first tweet that I want to classify", "this is my second tweet that I want to classify", ...]) and may contain as many elements as you would like. This list will be broken up and sent to the API in separate calls. These calls may be parallelized by setting the concurrency parameter in the $social->classify() call. For example, if you have 10,000 elements to be classified and set concurrency to 5, you should be able to run 5 sets of calls at the same time, each sending over 1000 elements at once, so 5,000 concurrently.

When the calls are completed, you can retrieve them in the order that they were submitted using the object returned from the classify() call.

You may pass in extra parameters to the classification calls as well. For example, in order to specify that only the eContext Rule-Based Classifications should be used, you can call $classify->setParameter('classification_type', 1);

eContext\Classify\Result

The base result object for eContext Classification objects. Each time a result is yielded in the yieldResults() call, a Result object is created and populated with several items. Each of the different classification types extends this object, but the base object is still created and populated with, at least, categories, translate, overlay and inner parameters. Individual categories may be retrieved using $result->getCategory($id) calls and will return an associated category array. The inner parameter contains the entire inner contents of the API call, and can be used for manual exploration of the result object.

eContext\Classify\Results\Social

The result object for Social classification will yieldResults across all of the input data. If you input 10,000 tweets in the data for the $classify object, yieldResults should yield 10,000 result arrays. Each of these arrays will contain an associated array with the inner contents of the API result. When a new page is loaded, for example when you go from post 1000 to post 1001, the object's categories array will change as well to load in the new categories for that page. This means that categories that existed on the first page may no longer be available on the second page.

In addition to the categories, inner, translate, and overlay parameters stored in the generic Result object, the Social Result object will also contain a results object that corresponds to the items yielded in the yieldResults call.

eContext\Classify\Results\Html and eContext\Classify\Results\Url

The results objcet for both HTML and URL classification objects. Each data object passed in to the either the URL or HTML classification objects may contain multiple elements. For example, you may populate the $html_classify object with HTML content from several different pages at once, or several urls at once.

For example:

The output from the above calls should look like this:

Note how the $results->getCategories() object changed with each advance through the iterator, and returns the categories associated with the current page (the current url_result).

Each $url_result object contains three items.


All versions of econtext-sdk-php with dependencies

PHP Build Version
Package Version
Requires guzzlehttp/guzzle Version ^6.1
info-com/econtext-lib-file 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 info-com/econtext-sdk-php contains the following files

Loading the files please wait ...