MLM Bonus Cronjob

时间:2018-01-12 18:25:19

标签: php pdo cron hook silex

我正在处理这个MLM脚本。虽然这个项目最初并不是我的,但我正在为客户修改。我设置了一个cron作业来执行每日奖金,但是cron作业返回抱歉找不到。但是,当我以管理员身份登录时,函数execute_bonus通过url http://mydomain/bonus/go运行(仅当我以管理员身份登录时)。我是oop的初学者,我现在一直试图调试这个。互联网避风港也没有帮助。 project是用带有钩子和PDO的silex mframework编写的。

更多信息:脚本在CloudLinus 6.x操作系统上运行。错误详细信息是404错误,但如果我没有以管理员身份登录,那就是错误。我包括cron job电子邮件通知。点击https://trade.xperttradeoptions.com/bonus/go查看错误,然后尝试使用cyber和123456登录https://trade.xperttradeoptions.com并再次尝试https://trade.xperttradeoptions.com/bonus/go

目前,我以管理员身份登录后,以http://mydomain/bonus/go方式手动运行cron作业。 execute_bonus函数以这种方式运行顺畅,但是cron job GET,CURL等等。 下面是代码;

<?php
global $hooks;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
$hooks->add_action('silex_action','execute_bonus');
function execute_bonus() {
    global $app;
    $app->get('/bonus/go', function() { 
    global $hooks;
    $tgL = date('Y-m-d',strtotime('-1 day'));
    if(!isWeekend($tgL)&&!isHariLibur($tgL)&&!sudahEksekusi()){ 
    $hooks->do_action('hitung_bonus');
    recordEksekusi();
    echo "DONE!";
    }else{
    echo "BEGIN TODAY PREVIOUS BONUS TODAY!";  
    }
    return "";
    }); 
}
function sudahEksekusi(){
    global $db;
    $db->bind('date',date('Y-m-d',strtotime('-1 day')));
    $log = $db->query("SELECT * FROM bonus_date_logs WHERE date = :date;");
    return (count($log)>0?true:false);
}
function recordEksekusi(){
    global $db;
    $db->query('INSERT INTO bonus_date_logs(date) VALUES (:date);',array("date"=>date("Y-m-d",strtotime('-1 day'))));
}

// Bonus Pairing
include 'bonus.pairing.php';

// Bonus Devident
include 'bonus.devident.php';

cron daemon

<input type='hidden' id='token' name='token' value='MTUxNTczMzI0MzpBQUFBQUFBUEFBQUxBQTBBSUFUQThIQUFBS0JsQUFCWUJnQUFBQVRnQ3dBTElRNEFBT3Z3REFDdzRQQUVzQUJRQlBFQUFEREE0UEFBS2dBUUFBb05BQT09OlkvcUVYU0Fvd3RQalE2ZTZ1OGlwSU9ZY0ZUYnl6blcwRzVTMkE0MWdLZ1pEeVZVSGVjamFFQTJUV3psY09zcHBpNGUzRkM1aHpvdEU4M3pkbXhUQ0N3PT0='

消息被截断

trace + .trace { margin-top: 30px; }
        .trace-head .trace-class { color: #222; font-size: 18px; font-weight: bold; line-height: 1.3; margin: 0; position: relative; }

        .trace-message { font-size: 14px; font-weight: normal; margin: .5em 0 0; }

        .trace-file-path, .trace-file-path a { color: #222; margin-top: 3px; font-size: 13px; }
        .trace-class { color: #B0413E; }
        .trace-type { padding: 0 2px; }
        .trace-method { color: #B0413E; font-weight: bold; }
        .trace-arguments { color: #777; font-weight: normal; padding-left: 2px; }

        @media (min-width: 575px) {
            .hidden-xs-down { display: initial; }
        }</style>
</head>
<body>
                <div class="exception-summary">
            <div class="container">
                <div class="exception-message-wrapper">
                    <h1 class="break-long-words exception-message">Sorry, the page you are looking for could not be found.</h1>
                    <div class="exception-illustration hidden-xs-down"><svg viewBox="0 0 136 81" xmlns="http://www.w3.org/2000/svg" fill-rule="evenodd" clip-rule="evenodd" stroke-linejoin="round" stroke-miterlimit="1.414"><path d="M92.358 20.403a23.168 23.168 0 0 1 9.003 1.881 23.67 23.67 0 0 1 5.197 3.079 24.257 24.257 0 0 1 3.457 3.296 24.771 24.771 0 0 1 5.042 9.396c.486 1.72.78 3.492.895 5.28l.008.142.028.158.015.246v13.875c.116.034.232.065.348.098.

消息被截断

0 个答案:

没有答案