library/Rediska/Command/Publish.php
public function create($channelOrChannels, $message)
    {
        $channels = array();
        if (!is_array($channelOrChannels)) {
            $channels = array($channelOrChannels);
        } else {
            $channels = $channelOrChannels;
        }

        // TODO: Param may be a Rediska_PubSub_Channel object

        $execs = array();
        foreach($channels as $channel) {
            $connection = $this->_rediska->getConnectionByKeyName($channel);

            $command = array('PUBLISH');
            $command[] = $this->_rediska->getOption('namespace') . $channel;
            $command[] = $this->_rediska->getSerializer()->serialize($message);

            $execs[] = new Rediska_Connection_Exec($connection, $command);
        }

        return $execs;
    }
public function create($channelOrChannels, $message)
    {
        $channels = array();
        if (!is_array($channelOrChannels)) {
            $channels = array($channelOrChannels);
        } else {
            $channels = $channelOrChannels;
        }

        // TODO: Param may be a Rediska_PubSub_Channel object

        $execs = array();
        foreach($channels as $channel) {
            $connection = $this->_rediska->getConnectionByKeyName($channel);

            $command = array('PUBLISH');
            $command[] = $this->_rediska->getOption('namespace') . $channel;
            $command[] = $this->_rediska->getSerializer()->serialize($message);

            $execs[] = new Rediska_Connection_Exec($connection, $command);
        }

        return $execs;
    }
Create command

@param array|string $channelOrChannels Channel or array of channels
@param mixed        $message           Message
@return Rediska_Connection_Exec