Exemple #1
0
<?php

require_once '../pascoul.php';
$pascoul = new Pascoul();
$pascoul->client_reconnect = 1;
//the time for the client to reconnect after the connection has lost in seconds. Default: 1.
$pascoul->allow_cors = true;
//Allow cross-domain access? Default: false. If you want others to access this must set to true.
$pascoul->start();
if (isset($_REQUEST['truncate'])) {
    $pascoul->send_message(0, $_REQUEST['truncate'], 5);
}
if (isset($_REQUEST['schema'])) {
    $pascoul->send_message(0, $_REQUEST['schema'], 5);
}
//LONG RUNNING TASK
for ($i = 1; $i <= 10; $i++) {
    $pascoul->send_message($i, 'on iteration ' . $i . ' of 10', $i * 10);
    sleep(1);
}
$pascoul->send_message('CLOSE', 'Process complete');
Exemple #2
0
 public function start()
 {
     global $progress;
     $progress = 0;
     Pascoul::start();
     if (isset($_REQUEST['file'])) {
         $this->setXMIFile($_REQUEST['file']);
     } else {
         $this->setXMIFile("XPlanGML-xmi12-uml14.xml");
     }
     if (isset($_REQUEST['schema'])) {
         $this->setSchema($_REQUEST['schema']);
     } else {
         $this->setSchema("xplan_eatest");
     }
     if (isset($_REQUEST['conf'])) {
         $this->includeConf($_REQUEST['conf']);
     }
     if (isset($_REQUEST['basepackage'])) {
         $this->setBasePackage($_REQUEST['basepackage']);
     } else {
         $this->setBasePackage("XPlanGML 4.1");
     }
     $packages_conf = str_replace("'", "", PACKAGES);
     $packages_conf = explode(";", $packages_conf);
     //Delete single empty value so that array is really eampty when there are no PACKAGES given in database_conf
     //if ($packages_conf[0]=="") $packages_conf = array_filter($packages_conf);
     //Delete sole entry in array ('PACKAGES') which means that there is no package configured, thus the array should be empty.
     if ($packages_conf[0] = 'PACKAGES') {
         unset($packages_conf[0]);
     }
     $this->setConfiguredPackages($packages_conf);
     $this->buildSchema();
     //if Argo Export using ISO19136 Schema, fill stereotypes table
     if ($_REQUEST['argo'] == 1) {
         Pascoul::send_message(0, 'Fülle Stereotypes mit ISO19136 Werten (ArgoUML)', $progress++);
         $this->fillArgoStereotypes();
         Pascoul::send_message(0, 'Fülle Datatypes mit ISO19136 Werten (ArgoUML)', $progress++);
         $this->fillArgoDatatypes();
     }
     $this->getQueries();
 }