<?php /** * The Doctrine Config file * * @author Aaron Saray */ use Doctrine\ORM\Tools\Console\ConsoleRunner; require 'bootstrap.php'; return ConsoleRunner::createHelperSet(\AboutBrowser\Util\Di::getInstance()['entityManager']);
$id = $visitorService->storeNewVisitor($_SERVER); $url = $app->urlFor('viewer_route', array('id' => $id)); $app->response->redirect($url, 302); }); // returning visitor, shared link or source of redirect $app->get('/me/:id', function ($id) use($app) { $visitorService = Di::getInstance()['visitorService']; $visitor = $visitorService->findByPublicID($id); if ($visitor) { $app->render('display.php', array('visitor' => $visitor)); } else { notFoundHandler($app); } })->name('viewer_route'); // update the javascript values $app->post('/me/:id/js', function ($id) use($app) { $visitorService = Di::getInstance()['visitorService']; $visitor = $visitorService->findByPublicID($id); if ($visitor) { $visitor->setJavascriptData($app->request->post()); $visitorService->save($visitor); } }); // found message - most likely an expired item $app->notFound(function () use($app) { notFoundHandler($app); }); /** * Finally run app. */ $app->run();