Permalink
Browse files

Removing php ws

  • Loading branch information...
1 parent 253f984 commit c67a76ea1c72a5e4390ab2da019d1df18fd3d0ea @ghecquet ghecquet committed Jun 28, 2016
Showing with 6 additions and 2,920 deletions.
  1. +2 −2 core/src/plugins/access.inbox/InboxAccessDriver.php
  2. +4 −6 core/src/plugins/core.access/src/Stream/StreamWrapper.php
  3. +0 −6 core/src/plugins/core.mq/vendor/phpws/.buildpath
  4. +0 −51 core/src/plugins/core.mq/vendor/phpws/.project
  5. +0 −94 core/src/plugins/core.mq/vendor/phpws/client.html
  6. +0 −80 core/src/plugins/core.mq/vendor/phpws/demo.php
  7. +0 −98 core/src/plugins/core.mq/vendor/phpws/demo_ssl.php
  8. +0 −38 core/src/plugins/core.mq/vendor/phpws/democert.pem
  9. +0 −77 core/src/plugins/core.mq/vendor/phpws/tests/framing.test.php
  10. +0 −69 core/src/plugins/core.mq/vendor/phpws/tests/server.test.php
  11. +0 −54 core/src/plugins/core.mq/vendor/phpws/websocket.admin.php
  12. +0 −203 core/src/plugins/core.mq/vendor/phpws/websocket.client.php
  13. +0 −53 core/src/plugins/core.mq/vendor/phpws/websocket.exceptions.php
  14. +0 −296 core/src/plugins/core.mq/vendor/phpws/websocket.framing.php
  15. +0 −216 core/src/plugins/core.mq/vendor/phpws/websocket.functions.php
  16. +0 −180 core/src/plugins/core.mq/vendor/phpws/websocket.message.php
  17. +0 −358 core/src/plugins/core.mq/vendor/phpws/websocket.protocol.php
  18. +0 −77 core/src/plugins/core.mq/vendor/phpws/websocket.resources.php
  19. +0 −467 core/src/plugins/core.mq/vendor/phpws/websocket.server.php
  20. +0 −155 core/src/plugins/core.mq/vendor/phpws/websocket.socket.php
  21. +0 −152 core/src/plugins/core.mq/vendor/phpws/websocket.users.php
  22. +0 −188 core/src/plugins/core.mq/ws-server.php
@@ -161,9 +161,9 @@ public static function getNodes(ContextInterface $parentContext, $checkStats = f
$repoId = $repo->getId();
// DISABLE REMOTE SHARE FOR TESTING
- if(strpos($repoId, "ocs_remote_share_") === 0){
+ /*if(strpos($repoId, "ocs_remote_share_") === 0){
continue;
- }
+ }*/
if(strpos($repoId, "ocs_remote_share_") !== 0){
$touchReposIds[] = $repoId;
@@ -164,11 +164,11 @@ public function rmdir($path, $options) {
return $stream->rmdir();
}
- public function rename($oldname, $newname) {
+ public function rename($oldName, $newName) {
- $stream = self::createStream($oldname);
+ $stream = self::createStream($oldName);
- return $stream->rename(new AJXP_Node($newname));
+ return $stream->rename(new AJXP_Node($newName));
}
public function url_stat($path, $flags) {
@@ -188,8 +188,7 @@ public static function isRemote() {
return true;
}
- public static function getRealFSReference($path, $persistent = false)
- {
+ public static function getRealFSReference($path, $persistent = false) {
$nodeStream = self::createStream($path);
$nodeStream->getContents();
@@ -221,7 +220,6 @@ public static function copyStreamInStream($from, $to) {
}
public static function createStream($path) {
- // TODO - determines this with the config
$node = new AJXP_Node($path);
$repository = $node->getRepository();
$ctx = $node->getContext();
@@ -1,6 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<buildpath>
- <buildpathentry kind="con" path="org.eclipse.dltk.USER_LIBRARY/SimpleTest"/>
- <buildpathentry kind="con" path="org.eclipse.php.core.LANGUAGE"/>
- <buildpathentry kind="src" path=""/>
-</buildpath>
@@ -1,51 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>phpws</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>com.aptana.ide.core.unifiedBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>com.aptana.editor.php.aptanaPhpBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.wst.jsdt.core.javascriptValidator</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.wst.validation.validationbuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.dltk.core.scriptbuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.ManifestBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.SchemaBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.php.core.PHPNature</nature>
- <nature>com.aptana.editor.php.phpNature</nature>
- <nature>com.aptana.projects.webnature</nature>
- <nature>org.eclipse.wst.jsdt.core.jsNature</nature>
- <nature>org.eclipse.pde.PluginNature</nature>
- </natures>
-</projectDescription>
@@ -1,94 +0,0 @@
-<html>
- <head>
- <title>WebSocket TEST</title>
-
- <style>
- html,body{font:normal 0.9em arial,helvetica;}
- #log {width:440px; height:200px; border:1px solid #7F9DB9; overflow:auto;}
- #msg {width:330px;}
- </style>
-
- <script>
-
- String.prototype.repeat = function(num)
- {
- return new Array(num + 1).join(this);
- }
-
-
-
- var socket;
-
-
- function createSocket(host) {
-
- if (window.WebSocket)
- return new WebSocket(host);
- else if (window.MozWebSocket)
- return new MozWebSocket(host);
-
- }
-
- function init() {
- var host = "ws://" + window.location.host + ":12345/echo";
- try {
- socket = createSocket(host);
- log('WebSocket - status ' + socket.readyState);
- socket.onopen = function(msg) {
- log("Welcome - status " + this.readyState);
- };
- socket.onmessage = function(msg) {
- log("Received (" + msg.data.length + " bytes): " + msg.data);
- };
- socket.onclose = function(msg) {
- log("Disconnected - status " + this.readyState);
- };
- }
- catch (ex) {
- log(ex);
- }
- $("msg").focus();
- }
-
- function send() {
-
-
- var msg = document.getElementById('msg').value;
-
- try {
- socket.send(msg);
- log('Sent (' + msg.length + " bytes): " + msg);
- } catch (ex) {
- log(ex);
- }
- }
- function quit() {
- log("Goodbye!");
- socket.close();
- socket = null;
- }
-
- // Utilities
- function $(id) {
- return document.getElementById(id);
- }
- function log(msg) {
- $("log").innerHTML += "<br>" + msg;
- }
- function onkey(event) {
- if (event.keyCode == 13) {
- send();
- }
- }
- </script>
-
- </head>
- <body onload="init()">
- <h3>WebSocket Test</h3>
- <div id="log"></div>
- <input id="msg" type="textbox" onkeypress="onkey(event)"/>
- <button onclick="send()">Send</button>
- <button onclick="quit()">Quit</button>
- <div>Server will echo your response!</div>
- </body>
-</html>
@@ -1,80 +0,0 @@
-#!/php -q
-<?php
-// Run from command prompt > php demo.php
-require_once("websocket.server.php");
-
-/**
- * This demo resource handler will respond to all messages sent to /echo/ on the socketserver below
- *
- * All this handler does is echoing the responds to the user
- * @author Chris
- *
- */
-class DemoEchoHandler extends WebSocketUriHandler {
-
- public function onMessage(IWebSocketConnection $user, IWebSocketMessage $msg) {
- $this->say("[ECHO] " . strlen($msg->getData()) . " bytes");
- // Echo
- $user->sendMessage($msg);
- }
-
- public function onAdminMessage(IWebSocketConnection $user, IWebSocketMessage $obj) {
- $this->say("[DEMO] Admin TEST received!");
-
- $frame = WebSocketFrame::create(WebSocketOpcode::PongFrame);
- $user->sendFrame($frame);
- }
-
-}
-
-/**
- * Demo socket server. Implements the basic eventlisteners and attaches a resource handler for /echo/ urls.
- *
- *
- * @author Chris
- *
- */
-class DemoSocketServer implements IWebSocketServerObserver {
-
- protected $debug = true;
- protected $server;
-
- public function __construct() {
- $this->server = new WebSocketServer("tcp://0.0.0.0:12345", 'superdupersecretkey');
- $this->server->addObserver($this);
-
- $this->server->addUriHandler("echo", new DemoEchoHandler());
- }
-
- public function onConnect(IWebSocketConnection $user) {
- $this->say("[DEMO] {$user->getId()} connected");
- }
-
- public function onMessage(IWebSocketConnection $user, IWebSocketMessage $msg) {
- //$this->say("[DEMO] {$user->getId()} says '{$msg->getData()}'");
- }
-
- public function onDisconnect(IWebSocketConnection $user) {
- $this->say("[DEMO] {$user->getId()} disconnected");
- }
-
- public function onAdminMessage(IWebSocketConnection $user, IWebSocketMessage $msg) {
- $this->say("[DEMO] Admin Message received!");
-
- $frame = WebSocketFrame::create(WebSocketOpcode::PongFrame);
- $user->sendFrame($frame);
- }
-
- public function say($msg) {
- echo "$msg \r\n";
- }
-
- public function run() {
- $this->server->run();
- }
-
-}
-
-// Start server
-$server = new DemoSocketServer();
-$server->run();
@@ -1,98 +0,0 @@
-#!/php -q
-<?php
-// Run from command prompt > php demo.php
-require_once("websocket.server.php");
-
-/**
- * This demo resource handler will respond to all messages sent to /echo/ on the socketserver below
- *
- * All this handler does is echoing the responds to the user
- * @author Chris
- *
- */
-class DemoEchoHandler extends WebSocketUriHandler {
-
- public function onMessage(IWebSocketConnection $user, IWebSocketMessage $msg) {
- $this->say("[ECHO] {$msg->getData()}");
- // Echo
- $user->sendMessage($msg);
- }
-
- public function onAdminMessage(IWebSocketConnection $user, IWebSocketMessage $obj) {
- $this->say("[DEMO] Admin TEST received!");
-
- $frame = WebSocketFrame::create(WebSocketOpcode::PongFrame);
- $user->sendFrame($frame);
- }
-
-}
-
-/**
- * Demo socket server. Implements the basic eventlisteners and attaches a resource handler for /echo/ urls.
- *
- *
- * @author Chris
- *
- */
-class DemoSocketServer implements IWebSocketServerObserver {
-
- protected $debug = true;
- protected $server;
-
- public function __construct() {
- $this->server = new WebSocketServer("ssl://0.0.0.0:12345", 'superdupersecretkey');
- $this->server->addObserver($this);
-
- $this->server->addUriHandler("echo", new DemoEchoHandler());
-
- $this->setupSSL();
- }
-
- private function getPEMFilename() {
- return './democert.pem';
- }
-
- public function setupSSL() {
- $context = stream_context_create();
-
- // local_cert must be in PEM format
- stream_context_set_option($context, 'ssl', 'local_cert', $this->getPEMFilename());
-
- stream_context_set_option($context, 'ssl', 'allow_self_signed', true);
- stream_context_set_option($context, 'ssl', 'verify_peer', false);
-
- $this->server->setStreamContext($context);
- }
-
- public function onConnect(IWebSocketConnection $user) {
- $this->say("[DEMO] {$user->getId()} connected");
- }
-
- public function onMessage(IWebSocketConnection $user, IWebSocketMessage $msg) {
- $this->say("[DEMO] {$user->getId()} says '{$msg->getData()}'");
- }
-
- public function onDisconnect(IWebSocketConnection $user) {
- $this->say("[DEMO] {$user->getId()} disconnected");
- }
-
- public function onAdminMessage(IWebSocketConnection $user, IWebSocketMessage $msg) {
- $this->say("[DEMO] Admin Message received!");
-
- $frame = WebSocketFrame::create(WebSocketOpcode::PongFrame);
- $user->sendFrame($frame);
- }
-
- public function say($msg) {
- echo "$msg \r\n";
- }
-
- public function run() {
- $this->server->run();
- }
-
-}
-
-// Start server
-$server = new DemoSocketServer("ssl://0.0.0.0:12345");
-$server->run();
Oops, something went wrong.

0 comments on commit c67a76e

Please sign in to comment.