Update to use as cli

This commit is contained in:
Michael RICOIS 2017-09-18 11:19:03 +02:00
parent ae65d25d88
commit 339f661c7b

View File

@ -2,6 +2,13 @@
error_reporting(E_ALL);
ini_set('display_errors', 1);
// Cli
$executeCli = false;
if (php_sapi_name() === 'cli') {
$executeCli = true;
$_SERVER['REMOTE_ADDR'] = '127.0.0.1';
}
// Vendors
require_once 'ripcord/ripcord.php';
require '../config/config.inc.php';
@ -9,10 +16,7 @@ require 'ErpTools.php';
require 'config.php';
// Var to exec from cli
$executeCli = false;
if (php_sapi_name() === 'cli') {
$executeCli = true;
$_SERVER['REMOTE_ADDR'] = '127.0.0.1';
if ($executeCli === true) {
$_GET['token'] = ERP_SCRIPT_TOKEN;
}