I plan to write a framework to improve my writing structure.

Source: Internet
Author: User

<? PHP

/*************************************** **************************************** **

* Shenphp entry file index. php $

**************************************** **************************************** *

* License statement: this framework is written out of personal preferences and is not used for commercial purposes. $

**************************************** **************************************** *

* Official Weibo: 3225263431 QQ: 619043894 $

**************************************** **************************************** *

* $ Author: shenxn Shen xiaoning ([email protected]) $

* $ Date: Oct 18,201 3 4:58:48 $

* $ ID $

**************************************** ****************************************/


Header ("Content-Type: text/html; charset = UTF-8"); // you can specify the system output character as UTF-8.

Date_default_timezone_set ("PRC"); // set the time zone


/**

* Framework directory

*/

Define ("root_path", str_replace ("\", "/", dirname (_ file __)).'/');


/**

* Program root directory

*/

Define ('script _ path', dirname (root_path ).'/');


/**

* Module root directory

*/

Define ('module _ path', script_path. 'module ');


// Load the framework

Require_once root_path. '/lib/init. php ';


/**

* Automatically generate the directory structure

*/

Structure: Create ();


/**

* Contains the system configuration file.

*/

$ Config = script_path. "config/config. php ";

If (file_exists ($ config )){

Require_once $ config;

}


/**

* Loading System built-in functions

*/

$ Common_function = root_path. '/common/function. php ';

If (file_exists ($ common_function )){

Require_once $ common_function;

}


/**

* Load Public Functions

*/

$ Common_helper = script_path. '/helper/setup. php ';

If (file_exists ($ common_helper )){

Require_once $ common_helper;

}


/**

* Load smarty

*/

$ Smarty = root_path. "plugin/smarty. Class. php ";


If (file_exists ($ smarty )){

Require_once $ smarty;

}


Require_once root_path. '/controller. php ';

Controller: Dispatch ();


This article is from the "lamp" blog and will not be reproduced!

I plan to write a framework to improve my writing structure.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.