コード例 #1
0
ファイル: get.php プロジェクト: hisapi/his
<?php

if ((!isset($_GET['uid']) && !isset($_GET['secret']) || !isset($_POST['uid']) && !isset($_POST['secret'])) && !isset($_COOKIE["hisdata"])) {
    echo trim(iconv('UTF-8', 'ASCII//IGNORE', "ERROR: GET parameters 'uid' and 'secret' must be defined"));
    exit;
}
if (!isset($_GET['job'])) {
    echo trim(iconv('UTF-8', 'ASCII//IGNORE', "ERROR: GET parameter 'job' must be defined"));
    exit;
}
if (!isset($_GET['return'])) {
    echo trim(iconv('UTF-8', 'ASCII//IGNORE', "ERROR: GET parameter 'return' must be defined"));
    exit;
}
include "version.php";
include "demos.php";
include "controller.guard.php";
$find_job = new job_id_user();
$find_job->get_from_hashrange($u->id_user, $_GET['job']);
if ($find_job->id != "undefined") {
    if ($_GET['return'] == "status") {
        echo trim(iconv('UTF-8', 'ASCII//IGNORE', $find_job->id_status));
    }
    if ($_GET['return'] == "output") {
        $find_job->build(array("obj_rqdata", "obj_response", "obj_ad", "obj_hf", "obj_user"));
        // 302
        header("Location: " . $find_job->obj_output->val);
    }
} else {
    echo trim(iconv('UTF-8', 'ASCII//IGNORE', "undefined"));
}
コード例 #2
0
ファイル: index.php プロジェクト: hisapi/his
                 $all_messages .= "received a wrong message: " . htmlspecialchars($message);
                 // we collected a message from anoth/er job - re-post the message to the queue so we don't end up stealing other jobs' responses
                 $collected_job_id->send("replyfrom_" . $selected_job_server_name, $message);
             }
         } else {
             $new_job_id->get_from_hashrange($u->id_user, $new_job_id->id);
         }
         if ($new_job_id->id_status != 'running' && $new_job_id->id_status != 'new' && $new_job_id->id_status != 'paused') {
             // JOB IS DONE
             break;
         } else {
             sleep(1);
         }
     }
     // END WHILE (WAIT FOR JOB TO FINISH)
     $new_job_id->build();
     $gather_from = "obj_response";
     if ($mode_xml || $mode_cxml) {
         $gather_from = "obj_output";
     }
     $original_html = $new_job_id->{$gather_from}->val;
     $new_job_id->{$gather_from}->build();
     $remote_content_collected = $new_job_id->{$gather_from}->body;
 }
 // END IF (WAIT MODE)
 // THIS IS NO-WAIT
 if ($refresh_cache && $mode_edit && intval($q->int_wait) == 0) {
     $latest_content = getTranslation("time behavior fast", $settings);
     $q->update(array("str_cache_latest" => $latest_content));
     $q->build();
     $original_html = "";
コード例 #3
0
ファイル: controller.server.php プロジェクト: hisapi/his
             break;
         }
         //print_r($CHILD_JOB);
         $CHILD_JOB->build(array("obj_rqdata", "obj_response", "obj_ad", "obj_hf", "obj_user"));
         $EACH_PLACEHOLDER['output'] = $CHILD_JOB->obj_output->body;
         $ALL_PLACEHOLDERS_WITH_JOB_RESPONSE[] = $EACH_PLACEHOLDER;
     } else {
         //logger( "\t\t\t" . "EMPTY PLACE WTF\n");
     }
     $this_placeholder = $this_placeholder + 1;
 }
 // END FOREACH
 logger("\t\t\t" . "ALL JOBS COMPLETED - MAKE PLACEHOLDER REPLACEMENTS\n");
 $PARENT_JOB = new job_id_user();
 $PARENT_JOB->get_from_hashrange($JOB->id_user, $PARENT_JID);
 $PARENT_JOB->build(array("obj_rqdata", "obj_response", "obj_ad", "obj_hf", "obj_user"));
 logger("\n\t\tORIGINAL PARENT URL:\n\t\t\t" . $PARENT_JOB->obj_output->val . "\n");
 $PARENT_RESPONSE_WITH_PLACEHOLDERS = $PARENT_JOB->obj_output->body;
 logger("\tPARENT BEFORE REPLACEMENTS: " . substr($PARENT_RESPONSE_WITH_PLACEHOLDERS, 0, min(500, strlen($PARENT_RESPONSE_WITH_PLACEHOLDERS))) . "\n");
 // ALL JOBS HAVE BEEN COMPLETED
 // EXECUTE PLACEHOLDER REPLACEMENT
 foreach ($ALL_PLACEHOLDERS_WITH_JOB_RESPONSE as $PLACEHOLDER) {
     $PLACEHOLDER_KEYWORD = $PLACEHOLDER['placeholder'];
     $PLACEHOLDER_FINAL_VALUE = $PLACEHOLDER['output'];
     logger("\t\tA PLACEHOLDER VALUE: " . substr($PLACEHOLDER_FINAL_VALUE, 0, min(200, strlen($PLACEHOLDER_FINAL_VALUE))) . "\n");
     $PARENT_RESPONSE_WITH_PLACEHOLDERS = str_replace($PLACEHOLDER_KEYWORD, $PLACEHOLDER_FINAL_VALUE, $PARENT_RESPONSE_WITH_PLACEHOLDERS);
 }
 // end foreach
 logger("\t\t\t\t" . count($ALL_PLACEHOLDERS_WITH_JOB_RESPONSE) . " REPLACEMENTS MADE\n");
 $bucket_name = $GLOBALS['settings'][$APP['fs']->kind][$APP['fs']->bucket_syntax()]['@attributes']['value'];
 $keyname = $APP['fs']->url_to_key($bucket_name, $PARENT_JOB->obj_output->val);