Skip to content

Commit 88d72af

Browse files
committed
[task/symfony-structure] Adding an application folder with config and kernel
PHPBB4-3
1 parent 8841888 commit 88d72af

14 files changed

+231
-0
lines changed

phpbb/.htaccess

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
deny from all

phpbb/cache/.symfony

Whitespace-only changes.

phpbb/config/config.php

+48
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
<?php
2+
3+
$container->loadFromExtension('app', 'config', array(
4+
'charset' => 'UTF-8',
5+
'error_handler' => null,
6+
'csrf-secret' => 'xxxxxxxxxx',
7+
'router' => array('resource' => '%kernel.root_dir%/config/routing.php'),
8+
'validation' => array('enabled' => true, 'annotations' => true),
9+
'templating' => array(
10+
'escaping' => 'htmlspecialchars'
11+
#'assets_version' => "SomeVersionScheme",
12+
),
13+
#'user' => array(
14+
# 'default_locale' => "fr",
15+
# 'session' => array(
16+
# 'name' => "SYMFONY",
17+
# 'type' => "Native",
18+
# 'lifetime' => "3600",
19+
# )
20+
#),
21+
));
22+
23+
// Twig Configuration
24+
/*
25+
$container->loadFromExtension('twig', 'config', array('auto_reload' => true));
26+
*/
27+
28+
// Doctrine Configuration
29+
/*
30+
$container->loadFromExtension('doctrine', 'dbal', array(
31+
'dbname' => 'xxxxxxxx',
32+
'user' => 'xxxxxxxx',
33+
'password' => '',
34+
));
35+
$container->loadFromExtension('doctrine', 'orm');
36+
*/
37+
38+
// Swiftmailer Configuration
39+
/*
40+
$container->loadFromExtension('swiftmailer', 'config', array(
41+
'transport' => "smtp",
42+
'encryption' => "ssl",
43+
'auth_mode' => "login",
44+
'host' => "smtp.gmail.com",
45+
'username' => "xxxxxxxx",
46+
'password' => "xxxxxxxx",
47+
));
48+
*/

phpbb/config/config_dev.php

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<?php
2+
3+
$loader->import('config.php');
4+
5+
$container->loadFromExtension('app', 'config', array(
6+
'router' => array('resource' => '%kernel.root_dir%/config/routing_dev.php'),
7+
'profiler' => array('only-exceptions' => false),
8+
));
9+
10+
$container->loadFromExtension('webprofiler', 'config', array(
11+
'toolbar' => true,
12+
'intercept-redirects' => true,
13+
));
14+
15+
$container->loadFromExtension('zend', 'config', array(
16+
'logger' => array(
17+
'priority' => 'info',
18+
'path' => '%kernel.logs_dir%/%kernel.environment%.log',
19+
),
20+
));

phpbb/config/config_prod.php

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
<?php
2+
3+
$loader->import('config.php');

phpbb/config/config_test.php

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<?php
2+
3+
$loader->import('config_dev.php');
4+
5+
$container->loadFromExtension('app', 'config', array(
6+
'error_handler' => false,
7+
'test' => true,
8+
));
9+
10+
$container->loadFromExtension('webprofiler', 'config', array(
11+
'toolbar' => false,
12+
'intercept-redirects' => false,
13+
));
14+
15+
$container->loadFromExtension('zend', 'config', array(
16+
'logger' => array('priority' => 'debug'),
17+
));

phpbb/config/routing.php

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<?php
2+
3+
use Symfony\Component\Routing\RouteCollection;
4+
use Symfony\Component\Routing\Route;
5+
6+
$collection = new RouteCollection();
7+
$collection->addRoute('homepage', new Route('/', array(
8+
'_controller' => 'FrameworkBundle:Default:index',
9+
)));
10+
$collection->addCollection($loader->import("BoardBundle/Resources/config/routing.php"));
11+
12+
return $collection;

phpbb/config/routing_dev.php

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<?php
2+
3+
use Symfony\Component\Routing\RouteCollection;
4+
5+
$collection = new RouteCollection();
6+
$collection->addCollection($loader->import(__DIR__.'/routing.php'));
7+
8+
$collection->addCollection($loader->import("WebProfilerBundle/Resources/config/routing/profiler.xml"), '/_profiler');
9+
10+
return $collection;

phpbb/console

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#!/usr/bin/env php
2+
<?php
3+
4+
require_once __DIR__.'/phpBBKernel.php';
5+
6+
use Symfony\Bundle\FrameworkBundle\Console\Application;
7+
8+
$kernel = new phpBBKernel('dev', true);
9+
10+
$application = new Application($kernel);
11+
$application->run();

phpbb/logs/.symfony

Whitespace-only changes.

phpbb/phpBBCache.php

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

phpbb/phpBBKernel.php

+61
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
<?php
2+
3+
require_once __DIR__.'/../src/autoload.php';
4+
5+
use Symfony\Component\HttpKernel\Kernel;
6+
use Symfony\Component\DependencyInjection\Loader\LoaderInterface;
7+
8+
class phpBBKernel extends Kernel
9+
{
10+
public function registerRootDir()
11+
{
12+
return __DIR__;
13+
}
14+
15+
public function registerBundles()
16+
{
17+
$bundles = array(
18+
new Symfony\Bundle\FrameworkBundle\FrameworkBundle(),
19+
20+
// enable third-party bundles
21+
new Symfony\Bundle\ZendBundle\ZendBundle(),
22+
new Symfony\Bundle\SwiftmailerBundle\SwiftmailerBundle(),
23+
new Symfony\Bundle\DoctrineBundle\DoctrineBundle(),
24+
//new Symfony\Bundle\DoctrineMigrationsBundle\DoctrineMigrationsBundle(),
25+
//new Symfony\Bundle\DoctrineMongoDBBundle\DoctrineMongoDBBundle(),
26+
//new Symfony\Bundle\PropelBundle\PropelBundle(),
27+
//new Symfony\Bundle\TwigBundle\TwigBundle(),
28+
29+
// register your bundles
30+
//new Application\HelloBundle\HelloBundle(),
31+
);
32+
33+
if ($this->isDebug()) {
34+
$bundles[] = new Symfony\Bundle\WebProfilerBundle\WebProfilerBundle();
35+
}
36+
37+
return $bundles;
38+
}
39+
40+
public function registerBundleDirs()
41+
{
42+
return array(
43+
'Application' => __DIR__.'/../src/Application',
44+
'Bundle' => __DIR__.'/../src/Bundle',
45+
'Symfony\\Bundle' => __DIR__.'/../src/vendor/symfony/src/Symfony/Bundle',
46+
);
47+
}
48+
49+
public function registerContainerConfiguration(LoaderInterface $loader)
50+
{
51+
// use YAML for configuration
52+
// comment to use another configuration format
53+
//$loader->load(__DIR__.'/config/config_'.$this->getEnvironment().'.yml');
54+
55+
// uncomment to use XML for configuration
56+
//$loader->load(__DIR__.'/config/config_'.$this->getEnvironment().'.xml');
57+
58+
// uncomment to use PHP for configuration
59+
$loader->load(__DIR__.'/config/config_'.$this->getEnvironment().'.php');
60+
}
61+
}

phpbb/phpunit.xml.dist

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
3+
<phpunit backupGlobals="false"
4+
backupStaticAttributes="false"
5+
colors="false"
6+
convertErrorsToExceptions="true"
7+
convertNoticesToExceptions="true"
8+
convertWarningsToExceptions="true"
9+
processIsolation="true"
10+
stopOnFailure="false"
11+
syntaxCheck="false"
12+
bootstrap="../src/autoload.php"
13+
>
14+
<testsuites>
15+
<testsuite name="Project Test Suite">
16+
<directory>../src/Application/*/Tests</directory>
17+
</testsuite>
18+
</testsuites>
19+
20+
<filter>
21+
<whitelist>
22+
<directory>../src/Application</directory>
23+
<exclude>
24+
<directory>../src/Application/*/Resources</directory>
25+
<directory>../src/Application/*/Tests</directory>
26+
</exclude>
27+
</whitelist>
28+
</filter>
29+
</phpunit>

phpbb/views/layout.twig

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
2+
<html>
3+
<head>
4+
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
5+
<title>{% block title %}phpBB{ endblock %}</title>
6+
</head>
7+
<body>
8+
{% block body %}{% endblock %}
9+
</body>
10+
</html>

0 commit comments

Comments
 (0)