Exemplo n.º 1
0
 public function isActive()
 {
     $pid = ProcessHandler::getPID();
     if ($pid == null) {
         $ret = false;
     } else {
         $ret = posix_kill($pid, 0);
     }
     if ($ret == false) {
         ProcessHandler::activate();
     }
     return $ret;
 }
****************************************************************************/
set_time_limit(0);
error_reporting(E_ALL ^ (E_NOTICE | E_WARNING));
include dirname(__FILE__) . "/lib/admin.defines.php";
include dirname(__FILE__) . "/lib/ProcessHandler.php";
if (!defined('PID')) {
    define("PID", "/var/run/a2billing/a2billing_subscription_fee_pid.php");
}
// CHECK IF THE CRONT PROCESS IS ALREADY RUNNING
$pH = new ProcessHandler();
if ($pH->isActive()) {
    die;
    // Already running!
} else {
    $pH->activate();
}
$verbose_level = 1;
$groupcard = 5000;
$A2B = new A2Billing();
$A2B->load_conf($agi, NULL, 0, $idconfig);
write_log(LOGFILE_CRONT_SUBSCRIPTIONFEE, basename(__FILE__) . ' line:' . __LINE__ . "[#### BATCH BEGIN ####]");
if (!$A2B->DbConnect()) {
    echo "[Cannot connect to the database]\n";
    write_log(LOGFILE_CRONT_SUBSCRIPTIONFEE, basename(__FILE__) . ' line:' . __LINE__ . "[Cannot connect to the database]");
    exit;
}
$instance_table = new Table();
/*
    Pay_Status :
        0 : First USE
Exemplo n.º 3
0
set_time_limit(0);
error_reporting(E_ALL ^ (E_NOTICE | E_WARNING));

include (dirname(__FILE__) . "/lib/admin.defines.php");
include (dirname(__FILE__) . "/lib/ProcessHandler.php");

if (!defined('PID')) {
	define("PID", "/var/run/a2billing/a2billing_batch_billing_pid.php");
}

// CHECK IF THE CRONT PROCESS IS ALREADY RUNNING
if (ProcessHandler :: isActive()) {
	die(); // Already running!
} else {
	ProcessHandler :: activate();
}


//Flag to show the debuging information
$verbose_level = 0;

$groupcard = 5000;
$oneday = 24 * 60 * 60;

$A2B = new A2Billing();
$A2B->load_conf($agi, NULL, 0, $idconfig);

write_log (LOGFILE_CRONT_INVOICE, basename(__FILE__) . ' line:' . __LINE__ . "[#### CRONT BILLING BEGIN ####]");

if (!$A2B->DbConnect()) {
****************************************************************************/
set_time_limit(120);
error_reporting(E_ALL ^ (E_NOTICE | E_WARNING));
include dirname(__FILE__) . "/lib/admin.defines.php";
include dirname(__FILE__) . "/lib/ProcessHandler.php";
if (!defined('PID')) {
    define("PID", "/var/run/a2billing/currencies_update_yahoo_pid.php");
}
// CHECK IF THE CRONT PROCESS IS ALREADY RUNNING
$prcHandler = new ProcessHandler();
if ($prcHandler->isActive()) {
    die;
    // Already running!
} else {
    $prcHandler->activate();
}
$FG_DEBUG = 0;
$A2B = new A2Billing();
$A2B->load_conf($agi, DEFAULT_A2BILLING_CONFIG, 1);
// DEFINE FOR THE DATABASE CONNECTION
define("BASE_CURRENCY", strtoupper($A2B->config["global"]['base_currency']));
$A2B->load_conf($agi, NULL, 0, $idconfig);
write_log(LOGFILE_CRONT_CURRENCY_UPDATE, basename(__FILE__) . ' line:' . __LINE__ . "[#### START CURRENCY UPDATE ####]");
if (!$A2B->DbConnect()) {
    echo "[Cannot connect to the database]\n";
    write_log(LOGFILE_CRONT_CURRENCY_UPDATE, basename(__FILE__) . ' line:' . __LINE__ . "[Cannot connect to the database]");
    exit;
}
$instance_table = new Table();
$A2B->set_instance_table($instance_table);