Page 1 of 1

Trying to understand Joomla! 1.5 codes from scratch

Posted: Mon Aug 27, 2007 3:51 am
by jserver
I am new at joomla code understanding and trying to understand from scratch.
I think this may also help other new comer at joomla 1.5
Small explanation from any joomla development expert will works a lot.
First from first,

Any body please explain in short, 

define( '_JEXEC', 1 );


What is the importence of  _JEXEC

Thanks a lot

Re: Trying to understand Joomla! 1.5 codes from scratch

Posted: Mon Aug 27, 2007 7:59 am
by MvBrakel
The _JEXEC variable is used for source code protection.

The variable is set when the site is initialized.
In several important files there is a check for this variable to be set to 1. If it is not set, the application is not initialized. 

For example if you approach the template file (yoursite.com/templates/template/index.php) directly in your browser, it would give a notice that the file cannot be accessed directly.

This way files cannot be accessed directly but only from within the application.

Re: Trying to understand Joomla! 1.5 codes from scratch

Posted: Sat Sep 01, 2007 9:14 pm
by moijafcor
_JEXEC_ is a constant initialized in order prevent unauthorized access (inclusions) to package' files. As MvBrakel said you find it everywhere in Joomla!

Re: Trying to understand Joomla! 1.5 codes from scratch

Posted: Sat Sep 01, 2007 10:49 pm
by moijafcor
Please note Joomla! also feature the JPATH_BASE constant, "to ensure this file is within the rest of the framework". Two different approaches, same result.

Greetings.

Re: Trying to understand Joomla! 1.5 codes from scratch

Posted: Sun Sep 02, 2007 6:02 am
by jserver
Thanks to all, Now I moving towards next step.
;D