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

Get root path (or path to data dir) from application?

Discussion in 'XenForo Development Discussions' started by RickM, Oct 30, 2010.

  1. RickM

    RickM Well-Known Member

    Hi,

    I'm trying to retreive the path to the /data directory as we've got a custom mod on our server which loads up screenshots of websites. Basically I need to be able to delete screenshots from this mod and to do that need to be able to get into the /data directory.

    I noticed in the /library/XenForo/Application.php file there is a '_rootdir' option however it cant be accessed from my application, and also has a value of '.' - obviously I need the actual server path (e.g /home/user/pulbic_html/).

    I can do this with PHP, however was wondering if XF (or zend) has a function for this already?

    Cheers :)
     
  2. Kier

    Kier XenForo Developer Staff Member

    In beta 2:
    XenForo_Application::getInstance()->getRootDir() . '/data'

    In beta 3:
    XenForo_Helper_File::getExternalDataPath()
     
  3. RickM

    RickM Well-Known Member

    Cheers Kier :)
     

Share This Page