Sunday, October 6, 2013

Initialize the Joomla Framework in an external script

Last week i had to write a Joomla code in external file. The code contained joomla database queries n other stuff which I don't wanted to convert into core php. I wanted to run the code in external php file by making few changes only. Searched on Google but i found many links of old code & some snippet posted on stackoverflow didn't work. The code which i found was very large containing configuration file & database details n all unwanted stuff to access Joomla classes. You can use following code when you want to load Joomla framework outside the Joomla.

Using above snippet you can load the necessary files so that you can use Joomla classes in your PHP script. Code properly worked on Joomla 2.5 version.

6 comments:

  1. Webzin
    Infotech has a mission to provide you with the best of web design and
    development services. We aim at helping you create the optimum website which will offer your rival and competition websites the competition they need.

    http://www.webzin.in/web_design_india.html

    ReplyDelete
  2. accessing file frm outside means what?

    ReplyDelete
  3. Patrick, It may be any core php file outside of the Joomla folder.

    ReplyDelete
  4. help me in this: http://stackoverflow.com/questions/28962011/php-warning-file-get-contentshttp-some-ip-test-failed-to-open-stream-conn

    ReplyDelete