Download the PHP package benclerc/sophos-xgapi without Composer

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

Sophos XGAPI

Sophos XGAPI is a PHP library for requesting Sophos XG firewalls. This library can :

You can find all supported entities' names on Sophos website.

Table of contents

Getting started

  1. Get Composer.
  2. Install the library using composer composer require benclerc/sophos-xgapi.
  3. Add the following to your application's main PHP file require 'vendor/autoload.php';.
  4. Instanciate the Config class with the firewall's hostname, username and password $configFirewall = new \Sophos\Config('123.123.123.123', 'admin', 'password');.
  5. Use the Config object previously created to instanciate the XGAPI object $firewall = new \Sophos\XGAPI($configFirewall);.
  6. Start using the library $hosts = $firewall->get(['IPHost']);.

Documentation

You can find a full documentation here.

Config class

This Config class is used to prepare the mandatory configuration information to instanciate and use the XGAPI class. In the constructor you must pass :

  1. The firewall's hostname (FQDN)
  2. A valid user's username
  3. The valid user's password

Optional parameters :

Example :

XGAPI class

get()

This method is used to retrieve data from the firewall. You must set which entity/entities you want to retrieve and you can set a filter for each one. Be careful, if you set several filters for the same entity they add up like a 'OR' not an 'AND'. Be careful not all attributes are filterable, see Sophos documentation. Available criterias for filtering :

  1. =
  2. like
  3. !=

Examples :

set()

This method is used to set data on the firewall. You must set all mandatory attributes for each entities you want to add.

Examples :

remove()

This method is used to remove data from the firewall. You must set the entities you want to delete as well as the name of the objects you want to delete, you cannot delete on anything else than the object's name.

Examples :


All versions of sophos-xgapi with dependencies

PHP Build Version
Package Version
Requires php Version >=7.4.0
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 benclerc/sophos-xgapi contains the following files

Loading the files please wait ....