2015-02-26 21:58:46 +01:00
|
|
|
<?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
|
|
|
|
);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2015-02-26 21:58:46 +01:00
|
|
|
}
|