Trying to understand Joomla! 1.5 codes from scratch

Have a programming question regarding your component, plug-in, extension or core hacks? Have an interesting tidbit, FAQ or programming tip you’d like to share? This is the place for you.

Moderators: tjay, seadap, Rogue4ngel, matthewhayashida

Post Reply
jserver
Joomla! Apprentice
Joomla! Apprentice
Posts: 12
Joined: Tue Aug 07, 2007 5:53 pm
Location: India
Contact:

Trying to understand Joomla! 1.5 codes from scratch

Post by jserver » Mon Aug 27, 2007 3:51 am

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
Sukalyan Banga

MvBrakel
Joomla! Apprentice
Joomla! Apprentice
Posts: 9
Joined: Mon Aug 27, 2007 7:40 am

Re: Trying to understand Joomla! 1.5 codes from scratch

Post by MvBrakel » Mon Aug 27, 2007 7:59 am

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.

User avatar
moijafcor
Joomla! Apprentice
Joomla! Apprentice
Posts: 6
Joined: Thu Mar 02, 2006 9:41 am
Location: Santo Domingo, Dominican Republic
Contact:

Re: Trying to understand Joomla! 1.5 codes from scratch

Post by moijafcor » Sat Sep 01, 2007 9:14 pm

_JEXEC_ is a constant initialized in order prevent unauthorized access (inclusions) to package' files. As MvBrakel said you find it everywhere in Joomla!
Nicht mehr!
Los acentos en castellano omitidos intencionalmente. | Les accents et les signes en français omis intentionnellement.
http://bio.moisesjafet.com

User avatar
moijafcor
Joomla! Apprentice
Joomla! Apprentice
Posts: 6
Joined: Thu Mar 02, 2006 9:41 am
Location: Santo Domingo, Dominican Republic
Contact:

Re: Trying to understand Joomla! 1.5 codes from scratch

Post by moijafcor » Sat Sep 01, 2007 10:49 pm

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.
Nicht mehr!
Los acentos en castellano omitidos intencionalmente. | Les accents et les signes en français omis intentionnellement.
http://bio.moisesjafet.com

jserver
Joomla! Apprentice
Joomla! Apprentice
Posts: 12
Joined: Tue Aug 07, 2007 5:53 pm
Location: India
Contact:

Re: Trying to understand Joomla! 1.5 codes from scratch

Post by jserver » Sun Sep 02, 2007 6:02 am

Thanks to all, Now I moving towards next step.
;D
Sukalyan Banga


Post Reply