This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defn rpc-url [path] (str "http://wamptutorial/rpc#" path)) | |
(defn wamp-handler | |
; ... | |
(clj-wamp/http-kit-handler channel | |
{:on-call {(rpc-url "echo") identity}}) | |
; ... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var sess; | |
ab.connect( | |
// ... | |
function (session) { // Connection callback | |
sess = session; | |
sess.prefix("rpc", "http://wamptutorial/rpc#"); | |
}, | |
// ... | |
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defn evt-url [path] (str "http://wamptutorial/event#" path)) | |
(defn wamp-handler | |
; ... | |
(clj-wamp/http-kit-handler channel | |
{:on-subscribe {(evt-url "chat") true} | |
:on-publish {(evt-url "chat") true}}) | |
; ... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var sess; | |
ab.connect( | |
// ... | |
function (session) { // Connection callback | |
sess = session; | |
sess.prefix("event", "http://wamptutorial/event#"); | |
sess.subscribe("event:chat", onChatEvent); | |
}, | |
// ... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defn wamp-handler [req] | |
(wamp/with-channel-validation req channel (:ws-origins-re (conf)) | |
(wamp/http-kit-handler channel | |
{:on-open on-open | |
:on-close on-close | |
:on-call {(rpc-url "echo") identity | |
:on-before on-before-call} | |
:on-subscribe {(evt-url "chat") true} | |
:on-publish {(evt-url "chat") true | |
:on-after on-publish}}))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(ns clj-wamp-example | |
(:require [org.httpkit.server :as http-kit] | |
[clj-wamp.server :as wamp])) | |
; Topic URIs | |
(defn rpc-url [path] (str "http://clj-wamp-example/api#" path)) | |
(defn evt-url [path] (str "http://clj-wamp-example/event#" path)) | |
(defn wamp-websocket-handler [req] | |
(http-kit/with-channel req channel |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public function transferAction() | |
{ | |
$upload = new \Zend\File\Transfer\Transfer(); | |
$upload->setDestination('./data/tmpuploads/'); | |
$upload->addValidator('Extension', false, array('extension' => array('jpg','jpeg','png'))); | |
$upload->addValidator('Count', false, array('max' => 1)); | |
$rtn = array('success' => null); | |
if ($this->getRequest()->isPost()) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Zend Framework (http://framework.zend.com/) | |
* | |
* @link http://github.com/zendframework/ZendSkeletonApplication for the canonical source repository | |
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) | |
* @license http://framework.zend.com/license/new-bsd New BSD License | |
*/ | |
namespace Application\Controller; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Zend Framework (http://framework.zend.com/) | |
* | |
* @link http://github.com/zendframework/ZendSkeletonApplication for the canonical source repository | |
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) | |
* @license http://framework.zend.com/license/new-bsd New BSD License | |
*/ | |
namespace Application\Controller; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$this->navigation()->getPluginManager()->setAllowOverride(true)->setInvokableClass('menu', '\My\Helper'); | |
// In Module.php | |
public function getViewHelperConfig() | |
{ | |
return array( | |
// Change the Navigation View Helper plugins for ALL modules | |
'initializers' => array( |