Lack of interest Move dependencies and frontcontroller classname to config.php

This suggestion has been closed automatically because it did not receive enough votes over an extended period of time. If you wish to see this, please search for an open suggestion and, if you don't find any, post a new one.

xf_phantom

Well-known member
If you would move the names to the XenForo_Application::loadDefaultConfig we could use a own Frontcontroller without the need to change the index.php & admin.php on each xenforo upgrade.
Then we could set all the classnames via config.php
ATM i need to patch my files on each xenforo upgrade..:(

PHP:
$startTime = microtime(true);
$fileDir = dirname(__FILE__);
 
require($fileDir . '/library/XenForo/Autoloader.php');
XenForo_Autoloader::getInstance()->setupAutoloader($fileDir . '/library');
 
XenForo_Application::initialize($fileDir . '/library', $fileDir);
XenForo_Application::set('page_start_time', $startTime);
 
$config = XenForo_Application::getConfig();
$dependenciesClassName = $config->dependeciesPublic;
$frontControllerClassName = $config->frontController;
 
$fc = new $frontControllerClassName(new $dependenciesClassName());
$fc->run();
 
Upvote 0
This suggestion has been closed. Votes are no longer accepted.
If you would move the names to the XenForo_Application::loadDefaultConfig we could use a own Frontcontroller without the need to change the index.php & admin.php on each xenforo upgrade.
Then we could set all the classnames via config.php
ATM i need to patch my files on each xenforo upgrade..:(

PHP:
$startTime = microtime(true);
$fileDir = dirname(__FILE__);
 
require($fileDir . '/library/XenForo/Autoloader.php');
XenForo_Autoloader::getInstance()->setupAutoloader($fileDir . '/library');
 
XenForo_Application::initialize($fileDir . '/library', $fileDir);
XenForo_Application::set('page_start_time', $startTime);
 
$config = XenForo_Application::getConfig();
$dependenciesClassName = $config->dependeciesPublic;
$frontControllerClassName = $config->frontController;
 
$fc = new $frontControllerClassName(new $dependenciesClassName());
$fc->run();

For a change like the FrontController, it sounds that you might as well be changing the index.php and be very aware of that fact ...

If you use mod_rewrite or any other kind of rules, you can already kind of do that, create your own index2.hp or index_custom.php and redirect the rules to that script instead of index.php ... the end result will be that it uses your custom index.php with your defined controller that won't break after an update
 
additional to all the informations in the conversation:

if we're not able to set a own FC please add a 3rd. parameter ($controllerResponse) to the front_controller_pre_dispatch event where we're able to set the controllerResponse inside of the event
if it is set, don't run dispatch

PHP:
$controllerResponse = null;
XenForo_CodeEvent::fire('front_controller_pre_dispatch', array($this, &$routeMatch, &$controllerResponse));
if (!$controllerResponse){
$controllerResponse = $this->dispatch($routeMatch);

1. we can use this for "simple & fast returns" where we don't need all the controller: preDispatch actions
2. i could use this for a own dispatch method instead of the default xenforo method.
 
couldn't you add the 1.3 beta3 changes from the cssoutput.php and proxyoutput.php (the dynamc classname) to the index.php too?:D

then we could extend at least the front controller:whistle:
 
Back
Top Bottom