Hi,
I have installed a third party library (Google api PHP Client) with composer and now I don’t know how to include it in my plugin. (Piwik version is 3.0.2, PHP 7.1.x)
Under the plugin directory I run:
composer require google/apiclient:^2.0
The question: how can I use/include Google_Client class into Controller.php class? What’s the class path?
My Controller.php
<?php
namespace Piwik\Plugins\MyPlugin;
use Piwik\View;
require __DIR__ . "/vendor/autoload.php"; //autoloader
class Controller extends \Piwik\Plugin\Controller
{
public function index()
{
$client = new Google_Client(); //test Goggle_Client class
return $this->renderTemplate('index', array(
'answerToLife' => 42
));
}
}
The error returned is:
The following error just broke Piwik (v3.0.2): Class ‘Piwik\Plugins\MyPlugin\Google_Client’ not found
Thanks in advance!