public function __construct(Logger $logger, Profiler $profiler, $serverName, $serverUrl, $token, $timeout = 0) { $this->logger = $logger; $this->profiler = $profiler; $this->name = $serverName; $this->token = $token; $this->userToken = null; $this->configureCurl($serverUrl, $timeout); $this->profiler->debug('api_client.' . $this->getName(), sprintf('Api server initialized [name: %s, url: %s, timeout: %s, token: %s]', $serverName, $serverUrl, $timeout, $token)); $this->logger->debug(sprintf('Api client %s: initialized [url: %s, timeout: %s, token: %s]', $serverName, $serverUrl, $timeout, $token)); $this->newUserTokenListeners = []; }
public function set($name, $value = null) { if (is_null($value)) { $this->profiler->debug('session.remove.' . $name); $this->session->remove($value); } else { if ($value instanceof Entity) { $value = $value->export(); } $this->profiler->debug('session.set.' . $name, $value); $this->session->set($name, $value); } }