Hot answers tagged

1

Don't use JUri for fetching local files. It returns the web address of your site. Fetching files over HTTP is extremely slow compared to fetching files locally. Use one of JPATH constants to get a local filesystem path, e.g.: $json = JPATH_BASE . '/modules/mod_kou_stack_exchange/media/js/sites.json'; $json = file_get_contents($json); https://docs.joomla....


1

Use the filepath: JUri::base() . '/modules/mod_kou_stack_exchange/media/js/sites.json' The filesystem equivalent of, eg. /public_html/yoursite/modules/... or /htdocs/yoursite/modules/... where Joomla is installed in yoursite directory.


Only top voted, non community-wiki answers of a minimum length are eligible