PHPackages                             dco-ai/php-jina - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. dco-ai/php-jina

ActiveLibrary

dco-ai/php-jina
===============

A PHP Client for the Jina-ai framework.

v1.1.6(3y ago)2391Apache-2.0PHP

Since Oct 26Pushed 3y agoCompare

[ Source](https://github.com/Dco-ai/php-jina)[ Packagist](https://packagist.org/packages/dco-ai/php-jina)[ RSS](/packages/dco-ai-php-jina/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (10)Dependencies (1)Versions (11)Used By (0)

A PHP Client for Jina
=====================

[](#a-php-client-for-jina)

A tool to connect to Jina with PHP. This client will not work without a running Jina installation.

To see how that is set up go here: [Jina Installation](https://docs.jina.ai/get-started/install/)

Jina Documentation
------------------

[](#jina-documentation)

For more information about Jina go here: [Jina](https://docs.jina.ai)

Install with composer command
-----------------------------

[](#install-with-composer-command)

```
    composer require dco-ai/php-jina
```

Install using composer.json
---------------------------

[](#install-using-composerjson)

### from GitHub directly:

[](#from-github-directly)

Add this to your `composer.json` file or create the file and put this in it.

```
{
  "name":  "dco-ai/php-jina",
  "repositories": [
    {
      "type": "svn",
      "url": "https://github.com/Dco-ai/php-jina.git"
    }
  ],
  "require": {
    "dco-ai/php-jina": "main"
  }
}
```

### or from Packagist:

[](#or-from-packagist)

```
{
  "require": {
    "dco-ai/php-jina": "v1.*"
  }
}
```

now run composer with `composer update`

Configuration
-------------

[](#configuration)

This client needs to know a few things about your Jina project to make the connection.

The configuration is an associative array with the following fields:

Attribute

Type

Description

url (required)

string

The endpoint of your Jina application. This can be a public URL or a private one if this client is used on the same network.

port (required)

string

The port used in your Jina application

endpoints (required)

associative array

This is how this client knows what endpoint uses which method when making the curl request. Since Jina allows you to make custom endpoints we need to know how to handle them. The default is `GET` so if your endpoint is not set here then it will attempt the call using `GET`.

dataStore (optional)

associative array

This is an optional configuration used to identify the Data Store being used. Interaction between Data Stores inside of DocArray differs so this client needs to know in order to handle certain functionality accordingly. If no dataStore is identified then the default functions will be used which may cause unintended results.

Usage
-----

[](#usage)

A small example is `src/example.php`. This shows you how to load the class and then create/update Jina's Document and DocumentArray structures.

First include the package in the header:

```
