Exemplo n.º 1
0
 function __construct($model, $session = "0", $clock = 0)
 {
     $this->clock = $clock;
     //0;
     wfDebugLog('p2p', $this->clock . ' - function logootEngine::__construct ');
     if (isset($model)) {
         $this->model = $model;
     } else {
         $this->model = manager::getNewBoModel();
     }
     $this->sessionid = $session;
 }
Exemplo n.º 2
0
    /**
     *
     * @param <String> $rev_id Revision id
     * @return boModel
     */
    static function loadModel($rev_id)
    {
        try {
            if ($rev_id != 0) {
                $dao = new dao();
                return $dao->loadModel($rev_id);
            } else {
                return manager::getNewBoModel();
            }
        } catch (Exception $e) {
            throw new MWException(__METHOD__ . ' db access problems,
if this page existed before the DSMW installation,
maybe it has not been processed by DSMW');
        }
    }
Exemplo n.º 3
0
 function test3()
 {
     // Test Undo de la thèse
     $model = manager::getNewBoModel();
     $logoot = manager::getNewEngine($model, 3);
     $this->patch[1] = $logoot->generate($this->texte1, $this->texte2);
     $this->patch[2] = $logoot->generate($this->texte2, $this->texte3);
     $this->patch[3] = $logoot->generate($this->texte3, $this->texte4);
     $this->assertEquals($this->texte4, $model->getText());
     $txt1 = $model->getText();
     $invPatch = $logoot->undoPatch($this->patch[2]);
     $logoot->integrate($invPatch);
     $invinvPatch = $logoot->undoPatch($invPatch);
     $logoot->integrate($invinvPatch);
     $txt2 = $model->getText();
     $this->assertEquals(4, count($model->getPositionList()));
     $this->assertEquals(4, count($model->getLineList()));
     $this->assertEquals($this->texte4, $model->getText());
     $this->assertEquals($txt1, $txt2);
 }