Download the PHP package kengineering/sonar-api-client without Composer

On this page you can find all versions of the php package kengineering/sonar-api-client. 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 sonar-api-client

PHP Sonar API Client

An object-oriented client for Sonar ISP management software's API. This client enables you to interact with Sonar's GraphQL API using PHP objects, supporting both individual and concurrent operations through queries and mutations.

Installation

Install the package via composer:

Requirements

Before making any requests, your application must have environment variables initialized. The client requires two specific variables in your .env file:

Usage

The client provides two primary approaches for interacting with the Sonar API:

  1. Direct object interaction through classes in Kengineering\Sonar\Objects\ for single operations
  2. Batch operations using Kengineering\Sonar\Request for concurrent queries or mutations

Basic Queries

The client provides straightforward methods for retrieving data:

Complex Queries

For more complex data requirements, you can build queries that fetch related data in a single request:

The query structure follows Sonar's GraphQL schema as a node tree. Use addToParent() to query related parent objects, addToChild() for child objects, and end() when you need to traverse multiple relationship layers.

Searching In Queries

Every query instance provides search capabilities through its search property. You can apply various search filters:

Relation Searching

To search through related models, use reverseRelationSearch. This method accepts the relation name and a callback to define search criteria:

Saving Objects

Objects can be created in Sonar in two ways. You can either set properties after instantiation or pass them through the constructor:

Updating Objects

When updating existing objects, the client automatically determines the operation type based on the object's state. Simply modify the properties and call save():

Deleting Objects

Objects can be removed from Sonar using the delete() method. The operation will throw an error if Sonar has restrictions preventing deletion:

Batching Queries

For scenarios requiring multiple queries in a single request, use the Request class. Results are returned in the same order as the queries, or by name if specified:

Named queries provide clearer access to results:

Batching Mutations

Mutations can be batched similarly to queries. Pass true to the batch_request parameter of mutation operations to prepare them for batching:

Object Functions

Many objects provide helper functions to streamline common operations. These functions automatically fetch required related data if not already loaded:

Objects also include functions for managing relationships, which can be included in batch operations:


All versions of sonar-api-client with dependencies

PHP Build Version
Package Version
Requires php Version ^8.0
guzzlehttp/guzzle Version ^7.9
vlucas/phpdotenv Version ^5.6
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 kengineering/sonar-api-client contains the following files

Loading the files please wait ....