This commit is contained in:
Romain Neutron
2012-04-26 00:55:53 +02:00
parent edbfff226e
commit ade22295ad
631 changed files with 92375 additions and 101763 deletions

View File

@@ -28,53 +28,50 @@ use Silex\ControllerCollection;
class PathFileTest implements ControllerProviderInterface
{
public function connect(Application $app)
{
$controllers = new ControllerCollection();
public function connect(Application $app)
{
$controllers = new ControllerCollection();
$controllers->get('/path/', function() use ($app)
{
$path = $app['request']->get('path');
$controllers->get('/path/', function() use ($app) {
$path = $app['request']->get('path');
$Serializer = $app['Core']['Serializer'];
$Serializer = $app['Core']['Serializer'];
return new Response(
$Serializer->serialize(
array(
'exists' => file_exists($path)
, 'file' => is_file($path)
, 'dir' => is_dir($path)
, 'readable' => is_readable($path)
, 'writeable' => is_writable($path)
, 'executable' => is_executable($path)
)
, 'json'
)
, 200
, array('content-type' => 'application/json')
);
return new Response(
$Serializer->serialize(
array(
'exists' => file_exists($path)
, 'file' => is_file($path)
, 'dir' => is_dir($path)
, 'readable' => is_readable($path)
, 'writeable' => is_writable($path)
, 'executable' => is_executable($path)
)
, 'json'
)
, 200
, array('content-type' => 'application/json')
);
});
$controllers->get('/url/', function() use ($app)
{
$url = $app['request']->get('url');
$controllers->get('/url/', function() use ($app) {
$url = $app['request']->get('url');
$Serializer = $app['Core']['Serializer'];
$Serializer = $app['Core']['Serializer'];
return new Response(
$Serializer->serialize(
array(
'code' => \http_query::getHttpCodeFromUrl($url)
)
, 'json'
)
, 200
, array('content-type' => 'application/json')
);
return new Response(
$Serializer->serialize(
array(
'code' => \http_query::getHttpCodeFromUrl($url)
)
, 'json'
)
, 200
, array('content-type' => 'application/json')
);
});
return $controllers;
}
return $controllers;
}
}