SHARE
TWEET

Untitled

a guest Sep 6th, 2019 95 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2.  
  3. require_once 'vendor/autoload.php';
  4.  
  5. use Workerman\Worker;
  6. use PHPSocketIO\SocketIO;
  7.  
  8. $io = new SocketIO(4045);
  9. $io->on('connection', function($socket)use($io){
  10.  
  11.     $socket->on('AUTH', function($msg)use($io,$socket){
  12.        
  13.         require_once '/var/www/config.core.php';
  14.  
  15.         if( !defined( "MODX_API_MODE" )){
  16.             define( "MODX_API_MODE", true );
  17.         }
  18.  
  19.         require_once MODX_CORE_PATH.'model/modx/modx.class.php';
  20.         $modx = new modX();
  21.         $modx->initialize('web');
  22.         $modx->getService('error','error.modError', '', '');
  23.  
  24.            
  25.         echo 'запрос:'.$modx->user->get('id')." || ";
  26.        
  27.         unset($modx);
  28.  
  29.     });
  30. });
  31.  
  32. 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
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top