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

37 lines
512 B
PHP
Raw Normal View History

<?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
);
}
2015-02-26 23:10:22 +01:00
static public function saveFile ( $data, $destination ) {
file_put_contents(
$destination,
$data
);
}
}