You are here

public function CmisConnectionApi::checkClient in CMIS API 8

Check if cmis exists in drupal root vendor.

The module use php-cmis-client library but the current version 1.0 depend the guzzle 5 version. Drupal use the guzzle 6 version. In order to we able using this client we need install it to module vendor folder.

To install temporary to time when will ready new version of cmis client you need to go to cmis module root folder (eg. modules/cmis or modules/contrib/cmis) and call the next command: composer require dkd/php-cmis

1 call to CmisConnectionApi::checkClient()
CmisConnectionApi::__construct in src/CmisConnectionApi.php

File

src/CmisConnectionApi.php, line 84

Class

CmisConnectionApi
Description of CmisConnectionApi

Namespace

Drupal\cmis

Code

public function checkClient() {

  // If not exists load it from cmis module vendor folder.
  if (!class_exists('BindingType')) {

    // Load CMIS using classes if composer not able to install them
    // to root vendor folder because guzzle 5 dependency.
    $path = drupal_get_path('module', 'cmis');
    if (file_exists($path . '/vendor/autoload.php')) {
      require_once $path . '/vendor/autoload.php';
    }
    else {
      throw new \Exception('Php CMIS Client library is not properly installed.');
    }
  }
}