-
Notifications
You must be signed in to change notification settings - Fork 0
/
play.php
59 lines (48 loc) · 1.8 KB
/
play.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
<?php
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\Debug\Debug;
// If you don't want to setup permissions the proper way, just uncomment the following PHP line
// read http://symfony.com/doc/current/book/installation.html#configuration-and-setup for more information
//umask(0000);
// This check prevents access to debug front controllers that are deployed by accident to production servers.
// Feel free to remove this, extend it, or make something more sophisticated.
/*if (isset($_SERVER['HTTP_CLIENT_IP'])
|| isset($_SERVER['HTTP_X_FORWARDED_FOR'])
|| !(in_array(@$_SERVER['REMOTE_ADDR'], array('127.0.0.1', 'fe80::1', '::1')) || php_sapi_name() === 'cli-server')
) {
header('HTTP/1.0 403 Forbidden');
exit('You are not allowed to access this file. Check '.basename(__FILE__).' for more information.');
}*/
$loader = require_once __DIR__.'/app/bootstrap.php.cache';
Debug::enable();
require_once __DIR__.'/app/AppKernel.php';
$kernel = new AppKernel('dev', true);
$kernel->loadClassCache();
$request = Request::createFromGlobals();
$kernel->boot();
$container = $kernel->getContainer();
$container->enterScope('request');
$container->set('request', $request);
$templating = $container->get('templating');
//all our setup is done !!!!
/*echo $templating->render(
'FunQBundle:Default:index.html.twig',
array(
'name' => 'Yoda',
'count' => 5,
)
);*/
use FunQ\Bundle\FunQBundle\Entity\User;
$user = new User ();
$user->setFirstName('John');
$user->setLastName('Doe');
$user->setBirthdate( new \DateTime ('1993-01-10'));
$user->setClass('C1');
$user->setGender('M');
$user->setIQ(0);
$user->setSchool('Allman Town Primary');
$user->setUsername('JohnDoe');
$user->setPassword('password');
$em = $container->get('doctrine')->getManager();
$em->persist($user);
$em->flush();