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

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 :)
 
In beta 2:
XenForo_Application::getInstance()->getRootDir() . '/data'

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

In beta 3:
XenForo_Helper_File::getExternalDataPath()

I tried to var_dump(XenForo_Application::getInstance()->getRootDir() . '/data' ); in my addon method.
but it gives me error.
 
Back
Top Bottom