1
0
mirror of https://github.com/pattern-lab/patternlab-php.git synced 2025-01-29 11:59:16 +01:00

updating the web socket server server starter-uppers

This commit is contained in:
Dave Olsen 2014-01-20 13:04:17 -05:00
parent 17eb131bfa
commit ffb6442ef7
2 changed files with 21 additions and 27 deletions

View File

@ -1,7 +1,7 @@
<?php
/*!
* Content Sync Server, v0.1
* Auto-Reload Server, v0.2
*
* Copyright (c) 2013-2014 Dave Olsen, http://dmolsen.com
* Licensed under the MIT license
@ -11,15 +11,12 @@
*
*/
// turn errors on or off for debugging purposes
ini_set('display_errors', 0);
error_reporting(E_ALL);
require(__DIR__.'/lib/SplClassLoader.php');
// auto-load classes
require(__DIR__."/lib/SplClassLoader.php");
// load wrench
$classLoader = new SplClassLoader('Wrench',__DIR__.'/lib');
$classLoader->register();
$loader = new SplClassLoader('Wrench', __DIR__.'/lib');
$loader->register();
// parse the main config for the content sync port
if (!($config = @parse_ini_file(__DIR__."/../config/config.ini"))) {
@ -27,18 +24,17 @@ if (!($config = @parse_ini_file(__DIR__."/../config/config.ini"))) {
exit;
}
$port = ($config) ? trim($config['contentSyncPort']) : '8002';
// start the content sync server
$server = new \Wrench\Server('ws://0.0.0.0:'.$port.'/', array());
// register the application
$args = getopt("s");
// give it a default port
$port = ($config) ? trim($config['autoReloadPort']) : '8001';
$args = getopt("s");
$newlines = (isset($args["s"])) ? true : false;
$server->registerApplication('contentsync', new \Wrench\Application\contentSyncBroadcasterApplication($newlines));
// start the content sync server
$server = new \Wrench\Server('ws://0.0.0.0:'.$port.'/', array());
// register the application
$server->registerApplication('autoreload', new \Wrench\Application\AutoReloadApplication($newlines));
$args = getopt("s");
if (!isset($args["s"])) {
print "\n";
print "Auto-reload Server Started...\n";

View File

@ -1,7 +1,7 @@
<?php
/*!
* Nav Sync Server, v0.1
* Page Follow Server, v0.2
*
* Copyright (c) 2013-2014 Dave Olsen, http://dmolsen.com
* Licensed under the MIT license
@ -11,15 +11,12 @@
*
*/
// turn errors on or off for debugging purposes
ini_set('display_errors', 0);
error_reporting(E_ALL);
require(__DIR__.'/lib/SplClassLoader.php');
// auto-load classes
require(__DIR__."/lib/SplClassLoader.php");
// load wrench
$classLoader = new SplClassLoader('Wrench',__DIR__.'/lib');
$classLoader->register();
$loader = new SplClassLoader('Wrench', __DIR__.'/lib');
$loader->register();
// parse the main config for the content sync port
if (!($config = @parse_ini_file(__DIR__."/../config/config.ini"))) {
@ -27,13 +24,14 @@ if (!($config = @parse_ini_file(__DIR__."/../config/config.ini"))) {
exit;
}
$port = ($config) ? trim($config['navSyncPort']) : '8000';
// give it a default port
$port = ($config) ? trim($config['pageFollowPort']) : '8000';
// start the content sync server
$server = new \Wrench\Server('ws://0.0.0.0:'.$port.'/', array());
// register the application & run it
$server->registerApplication('navsync', new \Wrench\Application\navSyncBroadcasterApplication());
$server->registerApplication('pagefollow', new \Wrench\Application\PageFollowApplication());
print "\n";
print "Page Follow Server Started...\n";