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

Fixed include_path @ autoloader

Discussion in 'Resolved Bug Reports' started by ragtek, Jan 6, 2011.

  1. ragtek

    ragtek Guest

    Why do you overwrite the includepath from php?
    I had big problems including some extern libraries into my xenforo application, until i saw, that the xenforo autoloader resets all the settings:D


    Autoloader.php @ line 70
    PHP:
    set_include_path($this->_rootDir PATH_SEPARATOR '.');
    Wouldn't it be better to have:
    PHP:
    $incPaths = array();
            
    $incPaths[] = $this->_rootDir PATH_SEPARATOR '.';
            
    $incPaths[] = get_include_path();
        
    set_include_path(implode($incPathsPATH_SEPARATOR));
     
    Vincent likes this.
  2. Mike

    Mike XenForo Developer Staff Member

    Including the existing include path is indeed a bit easier. Though on a side note, relying on the include path is usually not that fast. Generally speaking, avoiding it is probably a good thing, though I do see times where it's more convenient to use it.
     
    Vincent likes this.

Share This Page