Skip to content
This repository has been archived by the owner on Mar 6, 2019. It is now read-only.

Commit

Permalink
RPCs? Yes please!
Browse files Browse the repository at this point in the history
  • Loading branch information
CupOfTea696 committed Apr 19, 2015
1 parent 029aaf6 commit e0da0d5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
7 changes: 4 additions & 3 deletions src/Server/Dispatcher.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ public function onCall(Connection $connection, $id, $topic, array $params) {
$response = $this->handle($connection, $request);

if($response->getStatusCode() == 404){
$msg = config('twostream.rpc.enabled') ? config('twostream.rpc.error.enabled') : config('twostream.rpc.error.disabled');
echo var_dump([config('twostream.rpc.enabled'), config('twostream.rpc.error.enabled'), config('twostream.rpc.error.disabled')]);
$msg = config('twostream.response.rpc.enabled') ?
config('twostream.response.rpc.error.enabled') : config('twostream.response.rpc.error.disabled');
$connection->callError($id, 'wamp.error.no_such_procedure', $msg);
}else{
$content = (array)json_decode($response->getContent(), true);
Expand Down Expand Up @@ -199,11 +199,12 @@ protected function buildRequest($verb, $connection, $topic, $data = [], $params
'protocol' => 'ws://',
'host' => $connection->WebSocket->request->getHost(),
'port' => ':' . config('twostream.websocket.port'),
'path' => '/' . trim($topic->getId(), '/') . (isset($params) ? implode('/', $params) : ''),
'path' => '/' . trim($topic->getId(), '/') . (isset($params) ? '/' . implode('/', $params) : ''),
];
$cookies = $connection->WebSocket->request->getCookies();
array_forget($cookies, config('session.cookie')); // Make sure the normal Session Facade does not contain the client's Session.

echo var_dump(implode($uri));

return Request::createFromBase(
SymfonyRequest::create(
Expand Down
2 changes: 0 additions & 2 deletions src/TwoStreamServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,6 @@ public function register(){
$this->mergeConfigFrom(
__DIR__.'/../config/twostream.php', 'twostream'
);
$t = require __DIR__.'/../config/twostream.php';
echo var_dump(['wtf', $t]);

$this->app->bindShared('CupOfTea\TwoStream\Contracts\Factory', function($app){
$config = $this->app['config']['twostream'];
Expand Down

0 comments on commit e0da0d5

Please sign in to comment.