JDare / ClankBundle

A Symfony2 Bundle for use with Ratchet WebSocket Server
MIT License
131 stars 31 forks source link

Illegal string offset 'name' #16

Open ansnap opened 10 years ago

ansnap commented 10 years ago

Hello. I've just installed the bundle with provided instructions and I have an error:

"Warning: Illegal string offset 'name' in \vendor\jdare\clank-bundle\JDare\ClankBundle\Server\App\Handler\TopicHandler.php on line 97"

How can I fix this? Is this bundle currently working?

Merk87 commented 10 years ago

Any idea about how to fix this error?

I'm getting the exactly same error following the guide.

jjsaunier commented 9 years ago

It's due to your configuration. The example configuration is wrong.

You need to do something like that :

...
topic:
    - { name: topic_name, service:my_topic_service }

EDIT: After looking more closer, the doc is right, look under topic, see -

    topic:
        -
            name: "acme" #Important! this is the topic namespace used to match to this service!
            service: "acme_hello.topic_sample_service" #The service id.
bourvill commented 9 years ago

Same error, i follow the exemple...

Merk87 commented 9 years ago

I don't remember exactly how I fixed it, but with this config, is working:

clank:
    session_handler:   ~
    web_socket_server:
        port: "%clank_port%"        #The port the socket server will listen on
        host: "%clank_host%"   #(optional) The host ip to bind to
    rpc:
        -
            name: "conversation_service" #Important! this is the network namespace used to match calls to this service!
            service: "acme_message.rpc_chat_service" #The service id.
    topic:
        -
            name: "conversation_topic" #Important! this is the network namespace used to match calls to this service!
            service: "acme_message.rpc_topic_service" #The service id. ```
bourvill commented 9 years ago

oh god, i haven't copied the "-" for topic.

Strange writing, but it work, sorry

Merk87 commented 9 years ago

@bourvill I thought that was my error too!