Exemplo n.º 1
0
<?php

require '../classes/StreamRepository.php';
header('Content-type: application/json');
echo ")]}'\n";
//if ( isset( $_GET['name'] ) && is_string( $_GET['stream_id'] ) && isset( $_GET['countryCode'] ) && is_string( $_GET['countryCode'] ) ) {
if (isset($_GET['name']) && isset($_GET['stream_id']) && isset($_GET['stream_data'])) {
    StreamRepository::addStream($_GET['name'], $_GET['stream_id'], $_GET['stream_data']);
    echo json_encode(true);
}
Exemplo n.º 2
0
<?php

require '../classes/StreamRepository.php';
require '../classes/UFAPI.php';
// We're expecting JSON from this service, set the header accordingly
header('Content-type: application/json');
// prevent JSON hijacking.. technically makes the JSON invalid but Angular strips it out
echo ")]}'\n";
$widgets = StreamRepository::getWidgets();
echo json_encode($widgets);
Exemplo n.º 3
0
<?php

require '../classes/StreamRepository.php';
header('Content-type: application/json');
//header( 'Content-type: application/x-www-form-urlencoded' );
//var_dump(json_encode($_POST['name']));
$data = file_get_contents("php://input");
$decodedData = json_decode($data);
$wid = $decodedData->wid;
$stitle = $decodedData->stitle;
$fSid = $decodedData->fSid;
$wtitle = $decodedData->wtitle;
$num_cards = $decodedData->num_cards;
$link_text = $decodedData->link_text;
$purl = $decodedData->purl;
$sharer = $decodedData->sharer;
$textnotes = $decodedData->textnotes;
$widget_data = $decodedData->data;
//var_dump($stream_data);
echo ")]}'\n";
if (isset($wid) && isset($fSid) && isset($wtitle)) {
    StreamRepository::addWidget($wid, $stitle, $fSid, $wtitle, $num_cards, $link_text, $purl, $sharer, $textnotes, $widget_data);
    echo json_encode(true);
}
Exemplo n.º 4
0
<?php

require '../classes/StreamRepository.php';
// We're expecting JSON from this service, set the header accordingly
header('Content-type: application/json');
// prevent JSON hijacking.. technically makes the JSON invalid but Angular strips it out
echo ")]}'\n";
// Retrieve array of streams from our static StreamRepository class
$streams = StreamRepository::getStreams();
echo json_encode($streams);
Exemplo n.º 5
0
<?php

require_once 'classes/StreamRepository.php';
StreamRepository::init();
// careful, this drops tables
?>

DB is ready!
Exemplo n.º 6
0
<?php

require '../classes/StreamRepository.php';
header('Content-type: application/json');
//header( 'Content-type: application/x-www-form-urlencoded' );
//var_dump(json_encode($_POST['name']));
$data = file_get_contents("php://input");
$decodedData = json_decode($data);
$name = $decodedData->name;
$stream_id = $decodedData->stream_id;
$stream_data = $decodedData->stream_data;
//var_dump($stream_data);
echo ")]}'\n";
if (isset($name) && isset($stream_id) && isset($stream_data)) {
    StreamRepository::addStream($name, $stream_id, $stream_data);
    echo json_encode(true);
}