SHARE
TWEET

Untitled

a guest Jun 25th, 2019 54 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2.  
  3. use Workerman\Worker;
  4. use PHPSocketIO\SocketIO;
  5. use Workerman\WebServer;
  6. use Workerman\Autoloader;
  7.  
  8. require_once 'vendor/autoload.php';
  9.  
  10. $io = new SocketIO(4000);
  11.  
  12. $io->on('connection', function($socket)use($io){
  13.  
  14.         require_once '../../config.core.php';
  15.         define('MODX_API_MODE', true);
  16.         require_once MODX_CORE_PATH.'model/modx/modx.class.php';
  17.  
  18.         $modx = new modX();
  19.         $modx->initialize('web');
  20.         $modx->getService('error','error.modError', '', '');
  21.  
  22.         echo $modx->user->get('id');
  23.        
  24.         $modx->log(1, print_r($_SERVER, 1), "FILE");
  25.         $modx->log(1, print_r($_COOKIE, 1), "FILE");
  26.        
  27.         unset($modx);
  28.  
  29.  
  30.     $socket->on('disconnect', function($socket)use($io){
  31.  
  32.     });
  33. });
  34.  
  35. Worker::runAll();
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top