/**
  * @param Settings $settings
  *
  * @return \RemoteObjects\Client|\stdClass
  */
 public function createEndpoint(Settings $settings)
 {
     $url = parse_url($settings->getPath());
     // local call
     if (empty($url['scheme']) || $url['scheme'] == 'file') {
         $endpoint = new Endpoint($settings);
     } else {
         $transport = new CurlClient($settings->getPath());
         $encoder = new JsonRpc20Encoder();
         if ($settings->isEncryptionEnabled()) {
             $encoder = new RsaEncoder($encoder, $settings->getRsaRemotePublicKey(), $settings->getRsaLocalPrivateKey());
         }
         $client = new Client($transport, $encoder);
         $endpoint = $client->castAsRemoteObject();
     }
     return $endpoint;
 }
 protected function prepareLocalconfig()
 {
     if ($this->localconfig !== null) {
         return true;
     }
     if ($this->prepareFilesystemAccess()) {
         $localconfigFile = $this->contaoInstallation->getFile('system/config/localconfig.php');
         if (!$localconfigFile->exists()) {
             $this->errors[] = sprintf('system/config/localconfig.php is missing, maybe %s is not a contao installation or not configured yet?!', $this->settings->getPath());
         } else {
             $this->localconfig = $localconfigFile->getContents();
             return true;
         }
     }
     return false;
 }