/context/RestDataConnectionProvider.php

http://forceworkbench.googlecode.com/ · PHP · 23 lines · 18 code · 5 blank · 0 comment · 1 complexity · 8825aef87db0cd2ec0aed22ab7d88763 MD5 · raw file

  1. <?php
  2. require_once "context/AbstractConnectionProvider.php";
  3. require_once "restclient/RestClient.php";
  4. class RestDataConnectionProvider extends AbstractConnectionProvider {
  5. function establish(ConnectionConfiguration $connConfig) {
  6. $restConnection = new RestApiClient($this->buildEndpoint($connConfig), $connConfig->getSessionId());
  7. $restConnection->setCompressionEnabled(getConfig("enableGzip"));
  8. $restConnection->setUserAgent(getWorkbenchUserAgent());
  9. $restConnection->setExternalLogReference($_SESSION['restDebugLog']); //TODO: maybe replace w/ its own log?? //TODO: move into ctx
  10. $restConnection->setLoggingEnabled(getConfig("debug") == true);
  11. $restConnection->setProxySettings(getProxySettings());
  12. return $restConnection;
  13. }
  14. protected function getEndpointType() {
  15. return "Soap/u"; // pretend we are Partner, because this is later converted...//TODO: change this, its dumb
  16. }
  17. }
  18. ?>