1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

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

Discussion in 'Closed Suggestions' started by xf_phantom, Apr 17, 2013.

  1. xf_phantom

    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();
     
  2. Mike

    Mike XenForo Developer Staff Member

    What are you changing in the front controller?
     
  3. Rigel Kentaurus

    Rigel Kentaurus Well-Known Member

    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
     
    xf_phantom likes this.
  4. xf_phantom

    xf_phantom Well-Known Member

    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.
     
  5. xf_phantom

    xf_phantom Well-Known Member

    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:
     

Share This Page