Skip to content

Instantly share code, notes, and snippets.

@graste
Last active August 29, 2015 13:57
Show Gist options
  • Save graste/9663294 to your computer and use it in GitHub Desktop.
Save graste/9663294 to your computer and use it in GitHub Desktop.
Agavi Routing Options Presets

Agavi gen_options_presets

$route = $this->getContext()->getRouting()->gen('', array(), 'websocket_server');

Result:

ws://project.host.local:8080/

Gen-Options-Presets in app/config/factories.xml

<routing class="AgaviWebRouting">                                                                                   
    <ae:parameter name="gen_options_presets">
        <ae:parameter name="websocket_server">
            <ae:parameter name="omit_defaults">true</ae:parameter>
            <ae:parameter name="relative">false</ae:parameter>
            <ae:parameter name="authority"></ae:parameter>
            <ae:parameter name="scheme">ws</ae:parameter>
            <ae:parameter name="port">%event_pub.web_socket.port%</ae:parameter>
            <ae:parameter name="prefix"></ae:parameter>
            <ae:parameter name="fragment"></ae:parameter>
        </ae:parameter>
    </ae:parameter>
</routing>

Websocket server port specified in app/config/settings.xml:

<settings prefix="event_pub.">
    <setting name="web_socket.port">8080</setting>
</settings>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment