Esempio n. 1
0
File: cap.php Progetto: pr1001/CAP
        return uniqid();
    }
}
// start our session and go through the data sent to us, seeing if we should call any of the registered callbacks
session_start();
CAP::$__results = new BFArray();
$k = 0;
foreach ($_REQUEST as $scope => $values) {
    CAP::$results = new BFArray();
    foreach ($values as $id => $value) {
        if (array_key_exists($id, $_SESSION[$scope]) && $_SESSION[$scope][$id]['type'] == 'closure') {
            $b = new SerializableClosure(function () {
            });
            try {
                $b->unserialize($_SESSION[$scope][$id]['function']);
                // call the unserialized closure with the appropriate input
                CAP::$__results[$scope][$id] = $b($value);
                CAP::$results[$id] = CAP::$__results[$scope][$id];
            } catch (Exception $e) {
            }
            // keep the session clean
            unset($_SESSION[$scope][$id]);
            $k++;
        }
    }
    // keep the session clean
    unset($_SESSION[$scope]);
}
unset($k);
CAP::$results = NULL;
CAP::$__results = NULL;