Skip to content

Installation

  1. Requirements
  2. PHAR
  3. Phive
  4. Composer
  5. Git

Requirements

  • PHP 7.4 or greater
  • ext-json
  • ext-pcre
  • ext-spl

PHAR

The preferred method of installation is to use the PHAR version which can be downloaded from the most recent Github Release. This method ensures you will not have any dependency conflict issue.

[!TIP] When you want to use, load autoloader as follows :

require_once 'phar://' . '/absolute/path/to' . '/sarif-php-sdk.phar/vendor/autoload.php';

Phive

You can install application globally with Phive

phive install llaville/sarif-php-sdk --force-accept-unsigned

To upgrade global installation of the application use the following command:

phive update llaville/sarif-php-sdk --force-accept-unsigned

You can also install application locally to your project with Phive and configuration file .phive/phars.xml

<?xml version="1.0" encoding="UTF-8"?>
<phive xmlns="https://phar.io/phive">
    <phar name="llaville/sarif-php-sdk" version="^1.3" copy="false" />
</phive>
phive install --force-accept-unsigned

Composer

The recommended way to install this library is through composer. If you don't know yet what is composer, have a look on introduction.

composer require bartlett/sarif-php-sdk ^1.3

If you cannot install it because of a dependency conflict, or you prefer to install it for your project, we recommend you to take a look at bamarni/composer-bin-plugin. Example:

composer require --dev bamarni/composer-bin-plugin
composer bin sarif-php-sdk require --dev bartlett/sarif-php-sdk

Git

The SARIF PHP SDK can be directly used from GitHub by cloning the repository into a directory of your choice.

git clone -b 1.3 https://github.com/llaville/sarif-php-sdk.git