Ejemplo n.º 1
0
 /**
  * Renders serialized rules
  */
 function serialize()
 {
     $document =& JFactory::getDocument();
     $viewName = JRequest::getVar('view', 'serialize');
     $viewType = $document->getType();
     $view =& $this->getView($viewName, $viewType);
     // JRequest::getVar('data', '', 'post', 'string', JREQUEST_ALLOWRAW);
     $data = JRequest::getVar('data', NULL);
     if ($viewType == 'raw' && $data != NULL) {
         // TODO: why serialize (JREQUEST_ALLOWRAW) ?
         $toSolve = str_replace('\\"', '"', $_POST['data']);
         //var_dump($toSolve);
         //session_start();
         $sr = new SerializeRulesQueryByAR();
         //$sr = new SerializeRulesTaskSetting();
         //$sr = new SerializeRulesARQuery();
         $view->assignRef('value', $sr->serializeRules($toSolve));
     }
     $view->display();
 }
Ejemplo n.º 2
0
<?php

require_once 'sources/models/JSON.php';
require_once 'sources/models/serializeRules/AncestorSerializeRules.php';
require_once 'sources/models/serializeRules/SerializeRulesBackgroundAssociationRules.php';
require_once 'sources/models/serializeRules/SerializeRulesARQuery.php';
require_once 'sources/models/serializeRules/SerializeRulesTaskSetting.php';
require_once 'sources/models/serializeRules/SerializeRulesQueryByAR.php';
require_once 'sources/models/Utils.php';
session_start();
$toSolve = $_POST['data'];
$toSolve = str_replace("\\\"", "\"", $toSolve);
//echo $toSolve;
//$sr = new SerializeRulesBackgroundAssociationRules();
//$sr = new SerializeRulesTaskSetting();
//$sr = new SerializeRulesARQuery();
$sr = new SerializeRulesQueryByAR();
echo $sr->serializeRules($toSolve);
Ejemplo n.º 3
0
<?php

// wait
sleep(rand(1, 5));
// value
$val = rand(1, 10);
if ($val < 6) {
    echo json_encode(false);
} else {
    echo json_encode(true);
}
die;
require_once '../config/Config.php';
require_once '../lib/Bootstrap.php';
// KBI task
$data = isset($_POST['data']) ? $_POST['data'] : $_GET['data'];
$data = str_replace("\\\"", "\"", $data);
$serializer = new SerializeRulesQueryByAR(DDPath);
echo $serializer->serializeRules($data);