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
'use strict'; | |
class ParseJson { | |
obj = {} | |
result = [] | |
constructor(obj) { | |
this.obj = JSON.parse(obj) | |
} |
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
function parseObject(obj) { | |
let result = [] | |
let pathesArray = function* inObject(obj, path) { | |
for(let item in obj) { | |
let currentPath = path + '.' + item | |
if (path === '') | |
currentPath = item | |
if (!Array.isArray(obj[item])) { |
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 | |
use Ratchet\Server\IoServer; | |
use Ratchet\Http\HttpServer; | |
use Ratchet\WebSocket\WsServer; | |
use Library\WebsocketWeb\Socket; | |
use Phalcon\CLI\Task; | |
use React\EventLoop\StreamSelectLoop; | |
use Predis\Async\Client as PredisClient; | |
use React\Socket\Server as ReactSocket; |
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 | |
namespace Library\WebsocketWeb; | |
use Ratchet\MessageComponentInterface; | |
use Ratchet\ConnectionInterface; | |
use Library\WebsocketWeb\Channel\Chat; | |
use Library\WebsocketWeb\Channel\ChatBattle; | |
use Library\WebsocketWeb\Channel\Notice; | |
use Library\WebsocketWeb\Logger; | |
use React\EventLoop\LoopInterface; |