예제 #1
0
 public function sendLocal()
 {
     $oClient = new SocketServer_Client(true);
     if ($oClient->isOk()) {
         if ($oClient->sendLocal($this->recordtype, $this->getJSON())) {
             $mReturn = $oClient->response;
         } else {
             // Add LOgic to use the params below, mimics Netsuite
             $this->status = 'failure';
             $record->payload->code = '';
             $record->payload->details = '';
             self::logError($oClient->error);
         }
     }
     $mReturn = strlen($mReturn) > 20 ? json_decode($mReturn) : $mReturn;
     return $mReturn;
 }
<?php

/**
Simple Script to PING the Netsuite Socket Server for Exsistance
*/
//date_default_timezone_set('America/New_York');
//define('APPLICATION_DIR', '/var/www/html/');
spl_autoload_register(function ($sClass) {
    $sClass = str_replace("_", "/", $sClass);
    include APPLICATION_DIR . $sClass . '.php';
});
$mIsAlive = new SocketServer_Client(true);
if ($mIsAlive instanceof SocketServer_Client) {
    $mIsAlive->serverAlive();
    echo $mIsAlive->serverAlive();
    return;
}
echo 0;