Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[feature/controller] Controller #995

Closed
wants to merge 101 commits into from
Closed
Changes from all commits
Commits
Show all changes
101 commits
Select commit Hold shift + click to select a range
d1723e6
[feature/controller] Basics of using Symfony as a base of the controller
imkingdavid Sep 12, 2012
5ff4033
[feature/controller] Disable super globals after creating new Symfony…
imkingdavid Sep 13, 2012
ea70937
[feature/controller] Work toward allowing controllers to specify depe…
imkingdavid Sep 13, 2012
f7d9677
[feature/controller] Controller can be set up as a service
imkingdavid Sep 13, 2012
6416b58
[feature/controller] Use the interface as a type hint for EventDispat…
imkingdavid Sep 13, 2012
22e506e
[feature/controller] Use DI Container to get the phpBB Kernel object
imkingdavid Sep 13, 2012
686864f
[feature/controller] Add extension finder and route provider as services
imkingdavid Sep 14, 2012
20421d5
[feature/controller] Use new services set up in the previous commit
imkingdavid Sep 14, 2012
f4c9bd8
[feature/controller] Added controller object tests
imkingdavid Sep 15, 2012
1b7f713
[feature/controller] Slightly logic change in kernel class
imkingdavid Sep 15, 2012
4f15cc6
[feature/controller] Require controllers to be defined as services
imkingdavid Sep 15, 2012
643f0b4
[feature/controller] Added language strings for controller errors
imkingdavid Sep 15, 2012
447ddd6
[feature/controller] Fix file header for new language file
imkingdavid Sep 15, 2012
84e77de
[feature/controller] Move $symfony_request definition to common.php
imkingdavid Sep 15, 2012
f45634c
[feature/controller] Trigger error when non-empty response is given
imkingdavid Sep 15, 2012
5df067e
[feature/controller] Changed copyright dates for new files to 2012
imkingdavid Sep 15, 2012
02e0535
[feature/controller] Fix indentation to use tabs instead of spaces
imkingdavid Sep 15, 2012
51e3882
[feature/controller] Removed extra line break
imkingdavid Sep 15, 2012
267c153
[feature/controller] Use routing like Symfony
imkingdavid Sep 15, 2012
7971f73
[feature/controller] Update routing.yml example
imkingdavid Sep 15, 2012
dc38502
[feature/controller] Miscellaneous fixes and changes. Tests still do …
imkingdavid Sep 16, 2012
f339c03
[feature/controller] Fix template paths for controllers
imkingdavid Sep 16, 2012
de548c9
[feature/controller] Display correct error message with path is not m…
imkingdavid Sep 16, 2012
f2e430f
[feature/controller] Add rewrite for Apache and IIS
imkingdavid Sep 16, 2012
d4b228c
[feature/controller] Updates to documentation about routing
imkingdavid Sep 16, 2012
17c5195
[feature/controller] Update docblock for phpbb_controller_interface::…
imkingdavid Sep 16, 2012
0d8e7b7
[feature/controller] Added new line for code clarity
imkingdavid Sep 16, 2012
1bbf329
[feature/controller] Fix quotation marks in web.config
imkingdavid Sep 17, 2012
7d2bf6e
[feature/controller] Fix tests
imkingdavid Sep 17, 2012
b18f825
[feature/controller] Fix phpbb_controller_provider test
imkingdavid Sep 17, 2012
19f07eb
[feature/controller] Locate core config folder
imkingdavid Sep 17, 2012
8fbbe81
[feature/controller] Remove use statements that we don't... use.
imkingdavid Sep 17, 2012
09cffa2
[feature/controller] Updated language string
imkingdavid Sep 17, 2012
3f28625
[feature/controller] Fix provider to work with multiple routing.yml f…
imkingdavid Sep 17, 2012
7fdbd33
[feature/controller] Send all Exceptions through Kernel as Responses
imkingdavid Sep 19, 2012
3169a74
[feature/controller] Reorganize logic, move method determination to r…
imkingdavid Sep 19, 2012
728c46d
[feature/controller] Send entire compiled output as string to Respons…
imkingdavid Sep 20, 2012
fb0d2cf
[feature/controller] Fix documentation in routing.yml
imkingdavid Sep 20, 2012
d3b344f
[feature/controller] Individual controllers should call the page_foot…
imkingdavid Sep 20, 2012
881d74d
[feature/controller] Correctly determine base path for CSS, Javascrip…
imkingdavid Sep 20, 2012
777ab6e
[feature/controller] Give the class name, not just "object", in error…
imkingdavid Sep 21, 2012
8cc0996
[feature/controller] Make helper class, not base class to extend
imkingdavid Sep 21, 2012
1b4f619
[feature/controller] Fix test
imkingdavid Sep 21, 2012
6c4eb9f
[feature/controller] Move routing logic to Kernel from Controller Res…
imkingdavid Sep 22, 2012
d898bf6
[feature/controller] Fix tests
imkingdavid Sep 22, 2012
ea6abb2
[feature/controller] Condense app.php code
imkingdavid Sep 22, 2012
48a2496
[feature/controller] Properly use RouterListener with EventDispatcher
imkingdavid Sep 23, 2012
2a0a6a8
[feature/controller] Correct front-end paths accessed through control…
imkingdavid Sep 24, 2012
23677cf
[feature/controller] Properly dispatch Kernel events for use by exten…
imkingdavid Sep 24, 2012
3063ad8
[feature/controller] Use dispatch() method directly instead of trigge…
imkingdavid Sep 24, 2012
44c5dd3
[feature/controller] Add $ to variable names in event doc blocks
imkingdavid Sep 25, 2012
7e56e02
[feature/controller] Remove unused variable
imkingdavid Sep 25, 2012
e9a347c
[feature/controller] Correct handle_exceptions() method, remove trail…
imkingdavid Sep 26, 2012
26e73a6
[feature/controller] Remove unused use statement
imkingdavid Sep 27, 2012
49e74b9
[featuer/controller] Don't break tests for append_sid()
imkingdavid Oct 1, 2012
9c4c772
[feature/controller] Merge route provider into controller provider
imkingdavid Oct 1, 2012
b0a530b
[feature/controller] Fix copy/paste fail in doc block for set_paths m…
imkingdavid Oct 1, 2012
a3ef56e
[feature/controller] Define $template property in phpbb_controller_he…
imkingdavid Oct 1, 2012
9030e3a
[feature/controller] Updates to controller tests
imkingdavid Oct 1, 2012
9ebf1ad
[feature/controller] Return response during template rendering
imkingdavid Oct 2, 2012
b4b8ca4
[feature/controller] Prepare page in render() method instead of contr…
imkingdavid Oct 2, 2012
772e725
[feature/controller] Set the status code via the render helper method
imkingdavid Oct 2, 2012
8b00220
[feature/controller] Implement controller forwarding, such as for err…
imkingdavid Oct 3, 2012
59759c2
[feature/controller] Create a shortcut for error pages; first core co…
imkingdavid Oct 3, 2012
de95bda
[feature/controller] Add new error types
imkingdavid Oct 3, 2012
c096821
[feature/controller] Remove legacy controller stuff from extension fo…
imkingdavid Oct 3, 2012
e76a266
[feature/controller] Easily create URLs for controllers with the help…
imkingdavid Oct 9, 2012
d92df20
[feature/controller] Add terminate() method to phpbb_kernel
imkingdavid Oct 9, 2012
9aa428e
[feature/controller] Use terminate() method after sending the response
imkingdavid Oct 9, 2012
584f1af
[feature/controller] Use Symfony's HttpKernel directly
imkingdavid Oct 10, 2012
2783a0e
[feature/controller] Fix tests
imkingdavid Oct 10, 2012
26d6afb
[feature/controller] Empty parentheses for class instantiation withou…
imkingdavid Oct 10, 2012
dc210e1
[feature/controller] Add Symfony Components as services
imkingdavid Oct 10, 2012
fc68058
[feature/controller] Inject the controller provider into route_collec…
imkingdavid Oct 10, 2012
ea37532
[feature/controller] Undo rename of request context
imkingdavid Oct 10, 2012
69cf59f
[feature/controller] Remove forwarding and error stuff for now
imkingdavid Oct 10, 2012
1bcb18a
[feature/controller] Add default value for parameter
imkingdavid Oct 10, 2012
10f670a
[feature/controller] Remove phpbb_kernel class
imkingdavid Oct 10, 2012
df0f2f7
[feature/controller] Add base path setter for extension helper URL me…
imkingdavid Oct 15, 2012
0113aa3
[feature/controller] Add container compiler for kernel event subscribers
imkingdavid Oct 17, 2012
224aa00
[feature/controller] Get it all working properly with event subscribers
imkingdavid Oct 17, 2012
d91206f
[feature/controller] Add proper file headings
imkingdavid Oct 17, 2012
3bed757
[feature/controller] Fix test
imkingdavid Oct 17, 2012
e420948
[feature/controller] Move ContainerBuilder creation and processing to…
imkingdavid Oct 18, 2012
b2d1130
[feature/controller] Use mock container builder in test
imkingdavid Oct 18, 2012
1084b4e
[feature/controller] Use Container Extensions to register services an…
imkingdavid Oct 18, 2012
590ceba
[feature/controller] Move work from __construct() to load()
imkingdavid Oct 19, 2012
5c6d322
[feature/controller] Remove array definition from string property
imkingdavid Oct 19, 2012
ba6a9be
[feature/controller] Remove type checks
imkingdavid Oct 19, 2012
b8075f3
[feature/controller] Don't overwrite a method we don't need to overwrite
imkingdavid Oct 19, 2012
04fd10f
[feature/controller] Use PhpDumper to cache container to class
imkingdavid Oct 19, 2012
8ae330b
[feature/controller] Fix tests
imkingdavid Oct 19, 2012
0d65073
[feature/controller] Remove cached container when purging the cache
imkingdavid Oct 19, 2012
87f663b
[feature/controller] Remove processors from services, other minor adj…
imkingdavid Oct 19, 2012
0a540bd
[feature/controller] Update routing file documentation
imkingdavid Oct 19, 2012
5a93b68
[feature/controller] Remove outdated comment
imkingdavid Oct 19, 2012
e13d558
[feature/controller] Update container creation: file.php, database_up…
imkingdavid Oct 19, 2012
612e347
[feature/controller] Remove install_lock cached file
imkingdavid Oct 19, 2012
317922b
[feature/controller] Make docblock more useful
imkingdavid Oct 19, 2012
06c2f30
[feature/controller] Rename kernel to http_kernel
imkingdavid Oct 19, 2012
b6534bc
[feature/controller] Typehint the ContainerInterface
imkingdavid Oct 19, 2012
File filter...
Filter file types
Jump to…
Jump to file or symbol
Failed to load files and symbols.

Always

Just for now

BIN +69.8 KB (110%) composer.phar
Binary file not shown.
@@ -1,12 +1,17 @@
<IfModule mod_rewrite.c>
RewriteEngine on

#
# Uncomment the statement below if you want to make use of
# HTTP authentication and it does not already work.
# This could be required if you are for example using PHP via Apache CGI.
#
#<IfModule mod_rewrite.c>
#RewriteEngine on
#RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization},L]
#</IfModule>

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ app.php [QSA,L]
</IfModule>

<Files "config.php">
Order Allow,Deny
@@ -0,0 +1,29 @@
<?php
/**
*
* @package phpBB3
* @copyright (c) 2012 phpBB Group
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
*
*/

/**
*/

/**
* @ignore
*/
define('IN_PHPBB', true);
$phpbb_root_path = (defined('PHPBB_ROOT_PATH')) ? PHPBB_ROOT_PATH : './';
$phpEx = substr(strrchr(__FILE__, '.'), 1);
include($phpbb_root_path . 'common.' . $phpEx);

// Start session management
$user->session_begin();
$auth->acl($user->data);
$user->setup('app');

$http_kernel = $phpbb_container->get('http_kernel');
$response = $http_kernel->handle($symfony_request);
$response->send();
$http_kernel->terminate($symfony_request, $response);
@@ -8,9 +8,7 @@
* Minimum Requirement: PHP 5.3.2
*/

use Symfony\Component\Config\FileLocator;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Loader\YamlFileLoader;
use Symfony\Component\HttpFoundation\Request;

/**
*/
@@ -81,8 +79,6 @@

// Include files
require($phpbb_root_path . 'includes/class_loader.' . $phpEx);
require($phpbb_root_path . 'includes/di/processor/interface.' . $phpEx);
require($phpbb_root_path . 'includes/di/processor/config.' . $phpEx);

require($phpbb_root_path . 'includes/functions.' . $phpEx);
require($phpbb_root_path . 'includes/functions_content.' . $phpEx);
@@ -94,20 +90,37 @@
// Set PHP error handler to ours
set_error_handler(defined('PHPBB_MSG_HANDLER') ? PHPBB_MSG_HANDLER : 'msg_handler');

$phpbb_container = new ContainerBuilder();
$loader = new YamlFileLoader($phpbb_container, new FileLocator(__DIR__.'/config'));
$loader->load('services.yml');

$processor = new phpbb_di_processor_config($phpbb_root_path . 'config.' . $phpEx, $phpbb_root_path, $phpEx);
$processor->process($phpbb_container);

// Setup class loader first
$phpbb_class_loader = $phpbb_container->get('class_loader');
$phpbb_class_loader_ext = $phpbb_container->get('class_loader.ext');
$phpbb_class_loader = new phpbb_class_loader('phpbb_', "{$phpbb_root_path}includes/", ".$phpEx");
$phpbb_class_loader->register();
$phpbb_class_loader_ext = new phpbb_class_loader('phpbb_ext_', "{$phpbb_root_path}ext/", ".$phpEx");
$phpbb_class_loader_ext->register();

// Set up container
$phpbb_container = phpbb_create_compiled_container(
array(
new phpbb_di_extension_config($phpbb_root_path . 'config.' . $phpEx),
new phpbb_di_extension_core($phpbb_root_path),
),
array(
new phpbb_event_kernel_compiler_pass(),
),
$phpbb_root_path . 'config.' . $phpEx,
$phpbb_root_path,
$phpEx
);

$phpbb_class_loader->set_cache($phpbb_container->get('cache.driver'));
$phpbb_class_loader_ext->set_cache($phpbb_container->get('cache.driver'));

// set up caching
$cache = $phpbb_container->get('cache');

// Instantiate the Symfony Request object
// This must be done before phpbb_request
// because otherwise globals are disabled
$symfony_request = Request::createFromGlobals();

// Instantiate some basic classes
$phpbb_dispatcher = $phpbb_container->get('dispatcher');
$request = $phpbb_container->get('request');
@@ -130,13 +143,6 @@
$template = $phpbb_container->get('template');
$phpbb_style = $phpbb_container->get('style');

$ids = array_keys($phpbb_container->findTaggedServiceIds('container.processor'));
foreach ($ids as $id)
{
$processor = $phpbb_container->get($id);
$processor->process($phpbb_container);
}

// Add own hook handler
require($phpbb_root_path . 'includes/hooks/index.' . $phpEx);
$phpbb_hook = new phpbb_hook(array('exit_handler', 'phpbb_user_session_handler', 'append_sid', array('phpbb_template', 'display')));
@@ -4,7 +4,9 @@
"symfony/config": "2.1.*",
"symfony/dependency-injection": "2.1.*",
"symfony/event-dispatcher": "2.1.*",
"symfony/yaml": "2.1.*"
"symfony/http-kernel": "2.1.*",
"symfony/yaml": "2.1.*",
"symfony/routing": "2.1.*"
},
"require-dev": {
"fabpot/goutte": "1.0.x-dev"
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.