Post by bhavani » Thu Sep 20, 2012 3:18 am

Hi,

I am new to Opencart development and new to OOPS in PHP. I would like to know how opencart loads startup.php. What it is used for ?

Pls bear with me if the questions are a bit dumb which you might encounter as I try to understand the system completely.

thanks
bhavani.
Last edited by bhavani on Thu Sep 20, 2012 6:30 pm, edited 1 time in total.

Newbie

Posts

Joined
Fri Aug 19, 2011 11:18 pm

Post by Axansh » Thu Sep 20, 2012 2:37 pm

Hi,

If you want to learn then just open index.php and go though - line by line code.

From that you can understand flow of opencart system.

Thanks and Best Regards,
Axansh Sheth

Our Opencart Module
All in ONE SEO |
Multi-purpose pop |
Restaurant theme |
Store time save module


User avatar
Active Member

Posts

Joined
Mon Feb 06, 2012 3:07 pm

Post by bhavani » Wed Sep 26, 2012 12:29 pm

Hi,

thanks for replying. As directed, I started going through index.php The following code is defined in index.php in mywebsite.com/admin/ folder. Could you please explain in detail what the following code actually does ? I would like to know how it actually works.

// Registry
$registry = new Registry();

// Loader
$loader = new Loader($registry);
$registry->set('load', $loader);

Regards.
bh.

Newbie

Posts

Joined
Fri Aug 19, 2011 11:18 pm

Post by Axansh » Thu Sep 27, 2012 3:50 pm

Hi,

// Registry
$registry = new Registry();

$registry saves all the necessary objects in its $data relational array,

and system pass $registry as argument to all other class for accessing that object.

// Loader
$loader = new Loader($registry);
$registry->set('load', $loader);

In loader.php, model.php and controller.php (system/engine folder),

they all defined and $registry member, which is initiated in the constructor by passing type Registry object.

Please refer system->library and system->helper files to understand it.

Thanks and Best Regards,
Axansh Sheth

Our Opencart Module
All in ONE SEO |
Multi-purpose pop |
Restaurant theme |
Store time save module


User avatar
Active Member

Posts

Joined
Mon Feb 06, 2012 3:07 pm
Who is online

Users browsing this forum: No registered users and 11 guests