Level2.lu/src/app/level2/Helpers.php

37 lines
512 B
PHP

<?php
namespace level2;
use Silex\Application;
class Helpers {
static public function JSON2Array ( $URL ) {
return json_decode(
file_get_contents( $URL ),
true
);
}
static public function spaceAPI ( $app ) {
return json_decode(
file_get_contents( $app[ 'spaceAPI' ] ),
true
);
}
static public function saveFile ( $data, $destination ) {
file_put_contents(
$destination,
$data
);
}
}