Certificated magento

2.1) Describe the steps for application initialization

 We have finished Magento Basics with 9 articles which guide you about fundamentals, configuration XML, and multi-language… in Magento. Today, I will start the next step of Magento Certificate Preparation. You will be introduced the first topic – Application initialization consisting of two parts:

 
Describe the steps for the application initialization.
Change a website from within index.php.
 
I. Describe the steps for application initialization
 
Run the file index.php
Include Mage.php
● If not existing => redirect to the downloader of  magento
● If existing a file Mage.php => Conduct the command: Mage::run($mageRunCode, $mageRunType);
App::run($mageRunCode, $mageRunType)
● Load configuration files in app/etc/modules
● Load configuration files in the module (app/code/core/Mage/Customer/etc/config.xml)
● Update/create version of modules in core_resource
● Update/create database of modules
Mage_Core_Controller_Varien_Front::dispatch()
● Use routers to define the controller and action requested
● Call dispatch() of the controller that is requested
● Call action of the controller that is requested
● Return HTML code for the browser
 
II. Change a website from within index.php
 
Change the website and uses of index.php by the following steps:
 
Step 1: Create Website
 
Generate catalog, root category (Catalog > Manage Categories)
Manage store, create website, store and store view (System > Manage Stores)
Configure Base Url for the website which has been created (System > Configuration tab Web)
 
Step 2: Insert the code below into index.php before the command: Mage::run($mageRunCode, $mageRunType);
switch($_SERVER['HTTP_HOST']) {
  case 'name_domain_1':
  case 'name_domain_n':
  $mageRunCode = 'website_code';
  $mageRunType = 'website';
  break;
  }
 Hope this post will give you great helps! 

 

0 Bình luận

Trở về
  • 1.12) Set up a cron job
  • 1.12) Set up a cron job

    Let’s start with server setup.   As any complex system, Magento has a lot of tasks that need to be executed...