Skip to content

Commit 2ac3ac1

Browse files
committed
added base project files (based on symfony standard distribution)
1 parent c524982 commit 2ac3ac1

21 files changed

+2205
-0
lines changed

.gitignore

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
.idea
2+
/app/cache
3+
/app/logs
4+
/vendor

.gitmodules

Whitespace-only changes.

app/AppCache.php

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<?php
2+
3+
require_once __DIR__.'/AppKernel.php';
4+
5+
use Symfony\Bundle\FrameworkBundle\HttpCache\HttpCache;
6+
7+
class AppCache extends HttpCache
8+
{
9+
}

app/AppKernel.php

+47
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
<?php
2+
3+
use Symfony\Component\HttpKernel\Kernel;
4+
use Symfony\Component\Config\Loader\LoaderInterface;
5+
6+
abstract class AppKernel extends Kernel
7+
{
8+
public function registerBundles()
9+
{
10+
$bundles = array(
11+
new Symfony\Bundle\FrameworkBundle\FrameworkBundle(),
12+
new Symfony\Bundle\SecurityBundle\SecurityBundle(),
13+
new Symfony\Bundle\TwigBundle\TwigBundle(),
14+
new Symfony\Bundle\MonologBundle\MonologBundle(),
15+
new Symfony\Bundle\SwiftmailerBundle\SwiftmailerBundle(),
16+
new Symfony\Bundle\DoctrineBundle\DoctrineBundle(),
17+
new Symfony\Bundle\AsseticBundle\AsseticBundle(),
18+
new Sensio\Bundle\FrameworkExtraBundle\SensioFrameworkExtraBundle(),
19+
new JMS\SecurityExtraBundle\JMSSecurityExtraBundle(),
20+
);
21+
22+
if (in_array($this->getEnvironment(), array('dev', 'test'))) {
23+
$bundles[] = new Symfony\Bundle\WebProfilerBundle\WebProfilerBundle();
24+
$bundles[] = new Sensio\Bundle\DistributionBundle\SensioDistributionBundle();
25+
$bundles[] = new Sensio\Bundle\GeneratorBundle\SensioGeneratorBundle();
26+
}
27+
28+
return $bundles;
29+
}
30+
31+
public function registerContainerConfiguration(LoaderInterface $loader)
32+
{
33+
$loader->load(__DIR__.'/config/config_'.$this->getEnvironment().'.yml');
34+
}
35+
36+
protected function getKernelParameters()
37+
{
38+
return array_merge(parent::getKernelParameters(), array(
39+
'kernel.config_dir' => realpath(__DIR__.'/../src/Gamz/'.ucfirst(GAME).'Bundle/Resources/config'),
40+
));
41+
}
42+
43+
public function getCacheDir()
44+
{
45+
return $this->rootDir.'/cache/'.GAME.'/'.$this->environment;
46+
}
47+
}

app/autoload.php

+45
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
<?php
2+
3+
use Symfony\Component\ClassLoader\UniversalClassLoader;
4+
use Doctrine\Common\Annotations\AnnotationRegistry;
5+
6+
$loader = new UniversalClassLoader();
7+
$loader->registerNamespaces(array(
8+
'Symfony' => array(__DIR__.'/../vendor/symfony/src', __DIR__.'/../vendor/bundles'),
9+
'Sensio' => __DIR__.'/../vendor/bundles',
10+
'JMS' => __DIR__.'/../vendor/bundles',
11+
'Doctrine\\Common' => __DIR__.'/../vendor/doctrine-common/lib',
12+
'Doctrine\\DBAL' => __DIR__.'/../vendor/doctrine-dbal/lib',
13+
'Doctrine' => __DIR__.'/../vendor/doctrine/lib',
14+
'Monolog' => __DIR__.'/../vendor/monolog/src',
15+
'Assetic' => __DIR__.'/../vendor/assetic/src',
16+
'Metadata' => __DIR__.'/../vendor/metadata/src',
17+
));
18+
$loader->registerPrefixes(array(
19+
'Twig_Extensions_' => __DIR__.'/../vendor/twig-extensions/lib',
20+
'Twig_' => __DIR__.'/../vendor/twig/lib',
21+
));
22+
23+
// intl
24+
if (!function_exists('intl_get_error_code')) {
25+
require_once __DIR__.'/../vendor/symfony/src/Symfony/Component/Locale/Resources/stubs/functions.php';
26+
27+
$loader->registerPrefixFallbacks(array(__DIR__.'/../vendor/symfony/src/Symfony/Component/Locale/Resources/stubs'));
28+
}
29+
30+
$loader->registerNamespaceFallbacks(array(
31+
__DIR__.'/../src',
32+
));
33+
$loader->register();
34+
35+
AnnotationRegistry::registerLoader(function($class) use ($loader) {
36+
$loader->loadClass($class);
37+
return class_exists($class, false);
38+
});
39+
AnnotationRegistry::registerFile(__DIR__.'/../vendor/doctrine/lib/Doctrine/ORM/Mapping/Driver/DoctrineAnnotations.php');
40+
41+
// Swiftmailer needs a special autoloader to allow
42+
// the lazy loading of the init file (which is expensive)
43+
require_once __DIR__.'/../vendor/swiftmailer/lib/classes/Swift.php';
44+
Swift::registerAutoload(__DIR__.'/../vendor/swiftmailer/lib/swift_init.php');
45+

0 commit comments

Comments
 (0)