Example #1
0
function _loop()
{
    global $roster, $job;
    $job->_updateStatus($job->jobid);
    _run();
}
 * @package     Import
 * @author      Marcel Thiesies <*****@*****.**>
 * @copyright   2015 best it
 * @license     MIT
 * @version     0.1
 * @link        http://www.bestit-online.de/
 * @since       10.08.15 - 08:18
 * @deprecated  Not deprecated
 */
// require helper functions
require __DIR__ . '/functions.php';
/**
 * @param $files
 * @return null
 */
function _run($files)
{
    importLog('START Import');
    foreach ($files as $file) {
        $file = __DIR__ . '/data/types_nested/' . $file;
        importLog($file);
        if (file_exists($file)) {
            postProductTypes($file);
        }
    }
    importLog('DONE Import');
    return null;
}
// import product types
_run(getProductTypes());
Example #3
0
         if (!file_exists($SERVER['root_path'] . $URL) && !$request_handled) {
             if (count(explode(".", $URL)) == 1) {
                 // asume requests with no "." should be re-routed back to main index.
                 // Probably is something that would have used mod_rewrite in a fancy server...
                 $URL = $site_index_page;
             } else {
                 $headers = make_headers(404, $URL);
                 SendDataToClient($client[$i], $headers);
                 SendDataToClient($client[$i], "Error: 404");
                 server_log("[#" . $client[$i]["ID"] . " @ " . $client[$i]["IP"] . "] -> " . "404 [" . (time() - $client[$i]['JoinTime']) . "s]");
                 $request_handled = true;
             }
         }
         if (!$request_handled) {
             if (substr($URL, -4) == ".php") {
                 _run($URL, $OriginalRequestURL, $client[$i]["IP"], $client[$i]["ID"]);
                 $client[$i]["mode"] = "wait";
             } else {
                 $contents = @file_get_contents($SERVER['root_path'] . $URL);
                 if ($contents === false) {
                     $contents = "NO CONTENT";
                 }
                 $headers = make_headers(200, $URL);
                 SendDataToClient($client[$i], $headers);
                 SendDataToClient($client[$i], $contents);
                 server_log("[#" . $client[$i]["ID"] . " @ " . $client[$i]["IP"] . "] -> " . "200 (not php) [" . (time() - $client[$i]['JoinTime']) . "s]");
             }
             $request_handled = true;
         }
     }
 }