Installation of different system integration environments:mac installation MampWindows installation Phpstudythinkphp Documentation: HTTPS://WWW.KANCLOUD.CN/MANUAL/THINKPHP5/118008 I've been using a Mac recently, but I haven't used MAMP, so I'll try using Phpstudy to learn, and then append MAMP The method.Phpstudy Installing thinkphp steps:
- Enter thinkphp official website, download full version: http://www.thinkphp.cn/
- Extract the downloaded thinkphp copy all the files
- Locate the WWW folder under the Phpstudy installation path, create a new TP5 folder, paste all of the extracted thinkphp files into the TP5
- Restart Phpstudy
- Enter http://localhost/tp5/public/in the browser
- Shown as "thinkphp V5
Ten years of sharpening a sword-a high-performance framework designed for API development "for installation success
thinkphp Specification:
- All directories to use lowercase + underline
- The function file name must end in. php
- The namespace namespace must match the directory path: <? Php namespace app\index\controller
- The class library name must be consistent with the file name, with the first letter capitalized and Camel-written: The file name is index. PHP so the class library name must be class Index {...}
- Function Name must be first letter lowercase, in camel writing format: pubilc function getusername() {...}
- The first letter of the variable name is lowercase, using the Camel writing format: public $userName = ';
- Constructor name with double download line + lowercase letter, this kind of file try not to use: Public function __controll() {...}
- Constants must be all uppercase and underlined to connect: define ('app_state', ' dev ');
- All configuration names must be all lowercase and connected by a download line: 'app_namespace' + ' app ',
- The database or table name must be connected in lowercase letters with a download line and cannot appear in the hump or first letter capital:user_name
- Top and namespace (directory) unified Call app, form a good way to develop: namespace app\index\controller from the namespace this path is the directory path
thinkphp Directory Description: project 应用部署目录
├─application 应用目录(可设置),所有的应用都写在这里,经常使用│├─common Public Module catalog (can be changed) │├─the logic of the Index (MVC) main Page partModule catalog (can be changed)│ │ ├─config.php 模块配置文件
│ │ ├─common.php 模块函数文件
│ │ ├─controller 控制器目录
│ │ ├─model 模型目录
│ │ ├─view 视图目录││└─ ... More Class Library Catalogs │├─admin(后台的逻辑,对应index模块) │├─command.php PHP configuration file│ ├─common.php php的公共函数,可以写在这里,任何地方都可以调用,应用公共(函数)文件│├─config.php PHP application configuration file, the entire application read this file, apply (public) configuration file │├─database.php Database configuration file, connection database method, need to modify this file│ ├─tags.php 是对 ThinkPHP 框架进行扩展而不需要修改源码│└─route.php routing configuration file, to disguise the URL, you can modify the file├─extend 加载第三方库时使用,直接将类库下载到这个目录├─Public site root directory, all Web site files are placed in this directory,WEB Deployment Directory (external access directory)│ ├─static 静态资源存放目录(css,js,image)│├─index.php the portal file of the website, apply the portal file │├─router.php change the URL address file │ ├─robots.txt 搜索引擎爬虫定义规则│ └─.htaccess 用于 apache 的重写├─RuntimeWeb site running buffer files, including log, cache, compile files, etc.├─vendor third-party Class library directory (Composer)
├─thinkphpFramework System Catalog
│├─lang Language Pack Directory
│├─ Library Framework Core Class Library Directory
││├─think Framework core file, think Class Library package directory
││└─traits System Traits Directory
│├─TPL Framework default some templates, System template directory
│├─.htaccess for Apache rewrite
│├─.travis.yml CI Definition File
│├─base.php defines some constants, the underlying definition file
│├─composer.json Composer definition file, configuration file
│├─console.php Console Entry File
│├─convention.php Framework default configuration file, custom profile
│├─helper.php helper function file (optional)
│├─license.txt Authorization Note File
│├─phpunit.xml Unit Test configuration file
│├─readme.md README File
│└─start.php Framework Boot boot file
├─build.php auto-Generate definition file (reference)
├─composer.json Composer Definition File
├─license.txt Authorization Note File
├─readme.md README File
├─think Command Line entry file
This is a temporary update for tonight.
Installing thinkphp 5 in Phpstudy