I want to use cockpit in another PHP class. What is the best way to get an instance of cockpit? Currently, I am trying the following. However, this is not very object oriented. Can someone suggest a better way to do so?
Project structure is
Project
A.php
cockpit
bootstrap.php
//A.php
class A
{
private $cockpit;
public function __construct()
{
include_once(__DIR__.'/cockpit/bootstrap.php');
$this->cockpit=cockpit();
}
}