当前位置: 首页>>代码示例>>PHP>>正文


PHP Scheduler::getWsNamePostList方法代码示例

本文整理汇总了PHP中Scheduler::getWsNamePostList方法的典型用法代码示例。如果您正苦于以下问题:PHP Scheduler::getWsNamePostList方法的具体用法?PHP Scheduler::getWsNamePostList怎么用?PHP Scheduler::getWsNamePostList使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Scheduler的用法示例。


在下文中一共展示了Scheduler::getWsNamePostList方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1:

}
if (file_exists(dirname(__FILE__) . '/utils/xml.class.php')) {
    include_once "utils/xml.class.php";
}
if (file_exists(dirname(__FILE__) . '/utils/scheduler.class.php')) {
    include_once "utils/scheduler.class.php";
}
if (file_exists(dirname(__FILE__) . '/utils/forceRequest.class.php')) {
    include_once "utils/forceRequest.class.php";
}
/* Init log default type */
Log::setDefaultType($CONF_default_log);
/* Init of scheduler */
Scheduler::initTimer($CONF_WsGetReqList, $CONF_WsPostReqList, $CONF_CachetimeLbl, $CONF_LastrequestLbl);
/* Init of forceRequest (used to test only one request) */
ForceRequest::initForceRequest(Scheduler::getWsNameGetList(), Scheduler::getWsNamePostList());
if (ForceRequest::isForcedRequest() && isset($_GET['log'])) {
    Log::setDefaultType($_GET['log']);
}
/*
 * Execute POST requests
 */
Log::write("###### DO POST REQUESTS ######", "info");
$listPOST = '';
for ($i = 0; $i < sizeof($CONF_WsPostReqList); $i++) {
    $listPOST .= $i == 0 ? $CONF_WsPostReqList[$i] : ' - ' . $CONF_WsPostReqList[$i];
}
Log::write("Webservices to call : " . $listPOST, "info");
include "postSynchCtrl.php";
Log::write("###### END POST REQUESTS / TREATMENTS ######<br /><br />", "info");
/*
开发者ID:rtajmahal,项目名称:PrestaShop-modules,代码行数:31,代码来源:cron.php

示例2: Dao

$dao = new Dao();
$postOSIReq = new PostActionRequests(GlobalConfig::getWsUrl(), GlobalConfig::getWsPort(), 20, GlobalConfig::getWsLogin(), GlobalConfig::getWsPasswd(), GlobalConfig::getServiceCode(), GlobalConfig::getWebSiteCode());
/* WebService infos values */
$wSOInfosList = Scheduler::getWsInfosList();
/* POST requests */
if (ForceRequest::isForcedRequest()) {
    /* Send only one POST request */
    $wsName = ForceRequest::getWsName();
    $dateFrom = ForceRequest::getDateFrom() . " " . ForceRequest::getTimeFrom();
    $dateFrom = date::dateTimeFr2DateTimeBdd($dateFrom);
    $dateTo = ForceRequest::getDateTo() . " " . ForceRequest::getTimeTo();
    $dateTo = date::dateTimeFr2DateTimeBdd($dateTo);
    doPostSynch($wsName, $dateFrom, $dateTo);
} else {
    /* Send all POST requests in function of the scheduler permissions */
    $wSOList = Scheduler::getWsNamePostList();
    foreach ($wSOList as $wsName) {
        $dateFrom = $wSOInfosList[$CONF_LastrequestLbl . $wsName];
        $dateFrom = DATE::timestamp2DateTimeBdd($dateFrom);
        $dateTo = Scheduler::getTimeOnInit();
        $dateTo = DATE::timestamp2DateTimeBdd($dateTo);
        doPostSynch($wsName, $dateFrom, $dateTo);
    }
}
/* POST synchronisations */
function doPostSynch($wsName, $dateFrom, $dateTo)
{
    global $dao, $postOSIReq, $CONF_LastrequestLbl, $isOkResponses, $nbChildrenProducts, $nbResponse200, $nbResponseError, $nbResponse409, $nbNoReference;
    /* Check if allow to get this request */
    $isAllow = Scheduler::isAllowedToRequest($wsName);
    if (!ForceRequest::isForcedRequest() && !$isAllow) {
开发者ID:rtajmahal,项目名称:PrestaShop-modules,代码行数:31,代码来源:postSynchCtrl.php


注:本文中的Scheduler::getWsNamePostList方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。