PHP code example of xpmotors / namor-php-client

1. Go to this page and download the library: Download xpmotors/namor-php-client library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

xpmotors / namor-php-client example snippets


#!/usr/bin/env php

lient\NamorClient;

$server = getenv('CONFIG_SERVER');
$appId = getenv('APPID');
$namespacesStr = getenv('NAMESPACE');
$namespacesStr = $namespacesStr ?: 'application,system'; // set up the default values 
$namespaces = explode(',', $namespacesStr); // get namespaces from env

$namor = new NamorClient($server, $appId, $namespaces);

if ($clientIp = getenv('CLIENTIP')) {
    $namor->setClientIp($clientIp);
}

ini_set('memory_limit','128M');
$pid = getmypid();
echo "start [$pid]\n";
$restart = true; //auto start if failed
do {
    $error = $namor->start();
    if ($error) echo('error:'.$error."\n");
}while($error && $restart);
bash
$ composer 
bash
$ composer