示例#1
0
 /**
  * Load the required resources
  *
  * @param $instance
  */
 public function __construct($instance = null)
 {
     // Package Version
     if (!defined('GIGAAI_VERSION')) {
         define('GIGAAI_VERSION', '2.0.3');
     }
     // Setup the configuration data
     $this->config = Config::getInstance();
     if (!empty($config)) {
         $this->config->set($config);
     }
     // Make a Request instance. Not required but it will help user use $bot->request syntax
     $this->request = Request::getInstance();
     // Make a Session instance. Not required but it will help user use $bot->session syntax
     $this->conversation = Conversation::getInstance();
     // Load the storage
     $this->storage = new Storage();
     // Load the model
     $this->model = new Model();
     // We need to serialize Closure for dynamic data and intended actions
     $this->serializer = new Serializer();
     // Boot the subscription feature
     $this->subscription = Subscription::getInstance();
 }