Beispiel #1
0
 /**
  * Engine run method
  * @param array $params - run parameters
  */
 public final function run($params = array())
 {
     try {
         $f = fopen(Magmi_StateManager::getTraceFile(), "w");
         fclose($f);
         $enginf = $this->getEngineInfo();
         $this->log("MAGMI by dweeves - version:" . Magmi_Version::$version, "title");
         $this->log("Running {$enginf["name"]} v{$enginf["version"]} by {$enginf["author"]}", "startup");
         if (!$this->_initialized) {
             $this->initialize($params);
         }
         $this->connectToMagento();
         $this->engineInit($params);
         $this->engineRun($params);
         $this->disconnectFromMagento();
     } catch (Exception $e) {
         $this->disconnectFromMagento();
         $this->handleException($e);
     }
 }
Beispiel #2
0
<?php

require_once "../inc/magmi_statemanager.php";
$tid = $_REQUEST["traceid"];
$tracefile = Magmi_StateManager::getTraceFile();
$f = fopen($tracefile, "r");
$display = false;
$startout = false;
while (!feof($f)) {
    $line = fgets($f);
    if (preg_match("/--- TRACE :\\s+(\\d+).*?/", $line, $match)) {
        $trid = $match[1];
        if ($trid == $tid) {
            $startout = true;
            $display = true;
        }
    }
    if (preg_match("/--- ENDTRACE :\\s+(\\d+).*?/", $line, $match)) {
        $startout = false;
        break;
    }
    if ($startout) {
        echo '<p class="trace">' . $line . "</p>";
    }
}
fclose($f);
if (!$display) {
    echo "Trace not found";
}