thinkphp Minor Tricks Change the application name

Source: Internet
Author: User

One, change the application name

When we deploy the thinkphp code, we have to structure it like this.

We can set the app name in the index.php portal file

The code is as follows.

<?PHP// +----------------------------------------------------------------------// | thinkphp [WE CAN do IT JUST THINK]//+----------------------------------------------------------------------//| Copyright (c) 2006-2014 http://thinkphp.cn All rights reserved.//+-------------------------------------------------- --------------------// | Licensed (http://www.apache.org/licenses/LICENSE-2.0)//+------------------------------------------------------- ---------------// | author:liu21st <[email protected]>//+--------------------------------------------------------------------- -//Application Portal File//detection PHP environmentif(Version_compare(php_version, ' 5.3.0 ', ' < ') die(' Require PHP > 5.3.0! '));//Open Debug mode suggest the development phase to open the deployment phase comment or set to FalseDefine(' App_debug ',True);//Here you can set the default module and controller/*default load Module $_get[' m '] = ' module name ';*//*default Load controller $_get[' c '] = ' controller name ';*///defining the App catalogDefine(' App_path ', './website/');//Here you can change the app name//introduce thinkphp entry filerequire'./thinkphp/thinkphp.php ';//There 's no code behind the pro ^_^, it's so simple.

In addition, we can add these configurations in the app directory.

Take website here for the app name

/website/common/conf/config.php

Related configuration I put the code directly

The notes are all written clearly.

1<?PHP2 return Array(3     //' Config item ' = ' config value '4 //Disable module Access5 //' module_deny_list ' = = Array (' Common ', ' Runtime '),6 //Allow module access7 //' module_allow_list ' = = Array (' Index ', ' Admin '),8 //Set default load module9 //' default_module ' = ' Home ',Ten //Only one module allowed One //' multi_module ' = False, A //Modify the URL delimiter for PathInfo - //' url_pathinfo_depr ' = ' _ ', - //modifier key Name the     /*' var_module ' = ' m ', - ' var_controller ' = ' C ', - ' var_action ' = ' a '*/ -  +     //MySQL Global definition -' Db_type ' = ' mysqli ', +' Db_host ' = ' 127.0.0.1 ', A' Db_user ' = ' root ', at' db_pwd ' = ' 123 ', -' Db_name ' = ' cameramysql ', -' Db_port ' = ' 3306 ', -' Db_prefix ' = ' cm_ ', -' Show_page_trace ' =true -  in     //PDO Configuration -     /*' db_type ' = ' PDO ', to ' db_user ' = ' root ', + ' db_pwd ' = ' 123 ', - ' db_prefix ' = ' cm_ ', the ' db_dsn ' = ' Mysql:host=localhost;dbname=cameramysql;charset=utf8 ',*/ *  $);

thinkphp Minor Tricks Change the application name

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.