Giter Site home page Giter Site logo

tp5-facebook's Introduction

ThinkPHP 5.0 for facebook

采用ThinkPHP5+bootstrap+layer

vendor和public目录因为权限问题,无法上传,解压static解压到public目录,vendor可以从官方tp5.05提取出来

微云下载链接

ThinkPHP5的运行环境要求PHP5.4以上。

详细开发文档参考 ThinkPHP5完全开发手册

切换到public目录后,启动命令:php -S localhost:8888 router.php

使用

1.修改 /application/config.php,必须配置,不然css、js、images无法加载  

 // 视图输出字符串内容替换
'view_replace_str'       => [
    '__STATIC__' =>   '/tp5/public/static',         // 静态资源存放目录
    '__PUBLIC__' =>   '/tp5/public',         // 静态资源存放目录
],

   例子:

  'view_replace_str'       => [

    '__STATIC__' =>   '/tp5-facebook/public/static',         // 静态资源存放目录
    '__PUBLIC__' =>   '/tp5-facebook/public',         // 静态资源存放目录
    
],

tp5是项目的目录名称,必须更改

 2.数据库配置

    return [
       // 数据库类型
       'type'            => 'mysql',
       // 服务器地址
       'hostname'        => '127.0.0.1',
       // 数据库名
       'database'        => 'tp5',
       // 用户名
       'username'        => 'root',
       // 密码
       'password'        => '',
       // 端口
       'hostport'        => '3306',
       // 连接dsn
       'dsn'             => '',
       // 数据库连接参数
       'params'          => [],
       // 数据库编码默认采用utf8
       'charset'         => 'utf8',
       // 数据库表前缀
       'prefix'          => 'fb_',
       // 数据库调试模式
       'debug'           => true,
       // 数据库部署方式:0 集中式(单一服务器),1 分布式(主从服务器)
       'deploy'          => 0,
       // 数据库读写是否分离 主从式有效
       'rw_separate'     => false,
       // 读写分离后 主服务器数量
       'master_num'      => 1,
       // 指定从服务器序号
       'slave_no'        => '',
       // 是否严格检查字段是否存在
       'fields_strict'   => true,
       // 数据集返回类型
       'resultset_type'  => 'array',
       // 自动写入时间戳字段
       'auto_timestamp'  => false,
       // 时间字段取出后的默认时间格式
       'datetime_format' => 'Y-m-d H:i:s',
       // 是否需要进行SQL性能分析
       'sql_explain'     => false,
       // Builder类
       'builder'         => '',
       // Query类
       'query'           => '\\think\\db\\Query',
   ];

3.数据库创建

命令行切换到tp所在目录

php think migrate:run

注:详细命令 php think

  访问

  + http://localhost/项目目录名/public/index.php/login/index.html

  +这里的项目目录就是上面配置css、js的路径,默认为 /tp5-facebook  

版权信息

本项目由布尔开发。

演示

tp5-facebook's People

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.