Beispiel #1
0
 public function validateToken($type, $token)
 {
     $dataFetcher = new Data_Fetcher();
     $entityData = $dataFetcher->fetchData($this->Interface . "/type/" . $type . "/token/" . $token, array());
     $entity = new TokensEntity();
     if ($entityData['status'] == 200) {
         return true;
     }
     return false;
 }
Beispiel #2
0
 public function fetchStatuses($dataFilter = array())
 {
     $dataFetcher = new Data_Fetcher();
     $data = $dataFetcher->fetchData($this->Interface, $dataFilter);
     $array = array();
     if (isset($data['results'])) {
         $data = $data['results'];
         for ($var = 0; $var < count($data); $var++) {
             $entity = new Nodes_StatusEntity();
             $entity->exchangeArray($data[$var]);
             array_push($array, $entity);
         }
     }
     return $array;
 }
Beispiel #3
0
 public function checkSession($sessionKey)
 {
     $dataFetcher = new Data_Fetcher();
     $data = $dataFetcher->fetchData($this->Interface . "/sessions", array("Session_Key" => $sessionKey));
     if ($data['status'] == 201) {
         $sessionEntity = new SessionEntity();
         $sessionEntity->exchangeArray($data['results']);
         return $sessionEntity;
     }
     return null;
 }
Beispiel #4
0
<?php

/**
 * Created by PhpStorm.
 * User: Samer
 * Date: 2015-05-16
 * Time: 1:20 AM
 */
namespace install;

require_once dirname(dirname(__FILE__)) . '/Data_Building/Data_Query/Data_Fetcher.php';
require_once dirname(dirname(__FILE__)) . '/Data_Building/Exceptions/FailedDatabaseConnection.php';
use Data_Building\Data_Query\Data_Fetcher;
use Data_Building\Exceptions\FailedDatabaseConnection;
$fetcher = new Data_Fetcher();
try {
    $fetcher->fetchData("anyInterface");
    if (file_exists("../Configuration/internal_data.json")) {
        header("Location: ..");
    }
} catch (FailedDatabaseConnection $e) {
    // Failed to find a 'good' db system. They should be able to rebuild.
}
?>
<!doctype html>
<html class="no-js" lang="">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
    <title>Installation</title>
 public function fetchApplicationsSupportedByOS($os)
 {
     $dataFetcher = new Data_Fetcher();
     $data = $dataFetcher->fetchData($this->Interface . "/os/" . $os, array());
     $array = array();
     if (isset($data['results'])) {
         $data = $data['results'];
         for ($var = 0; $var < count($data); $var++) {
             $entity = new ApplicationSupportedEntity();
             $entity->exchangeArray($data[$var]);
             array_push($array, $entity);
         }
     } else {
         $array = $data;
     }
     return $array;
 }