Skip to content

Instantly share code, notes, and snippets.

@parap
Created March 22, 2013 08:22
Show Gist options
  • Save parap/5219737 to your computer and use it in GitHub Desktop.
Save parap/5219737 to your computer and use it in GitHub Desktop.
test gist
<?php
use Symfony\Component\HttpFoundation\Request;
use frontend\model\Initializer;
include_once('config.php');
include_once('lib/autoload.php');
include_once('app/bootstrap.php');
$initializer = new Initializer();
$initializer->kernel();
$initializer->doctrine();
$kernel = $initializer->getKernel();
$request = Request::createFromGlobals();
try {
$repo = $initializer->getEntityManager()->getRepository('frontend\model\entity\User');
$results = $repo->findAll();
var_dump($results);
$response = $kernel->handle($request);
$response->send();
$kernel->terminate($request, $response);
} catch (Exception $e) {
//TODO: improve 404 handle
echo '404: ' . $e->getMessage();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment