Code Monkey home page Code Monkey logo

despote1.0's Introduction

He110PHP

简述

He110php 是一款简单的PHP MVC框架,主要是为了理解 MVC **而创建的

要求

PHP 5.4.0+

目录说明

目录结构:

project  WEB部署目录
├─application           应用目录
│  ├─controllers        控制器目录
│  ├─models             模块目录
│  ├─views              视图目录
├─config                配置文件目录
├─he110php               核心框架目录
├─runtime               运行目录
│  ├─caches             缓存文目录
│  ├─logs               日志目录
│  ├─sessions           缓存目录
├─index.php             入口文件

使用

1.克隆代码

git clone [email protected]:He110te4m/He110php.git

2.创建数据库

在数据库中创建名为 project 的数据库,并插入两条记录,命令:

CREATE DATABASE `project` DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;
USE `project`;

CREATE TABLE `item` (
    `id` int(11) NOT NULL auto_increment,
    `item_name` varchar(255) NOT NULL,
    PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;

INSERT INTO `item` VALUES(1, 'Hello World.');
INSERT INTO `item` VALUES(2, 'Lets go!');

3.修改数据库配置文件

打开配置文件 config/config.php ,使之与自己的数据库匹配

	define('DB_NAME', 'project');
	define('DB_USER', 'root');
	define('DB_PASSWORD', 'root');
	define('DB_HOST', 'localhost');

4.测试访问

打开 index.php 文件,修改

define('APP_URL', 'http://localhost/');

为自己代码的具体位置,默认是 localhost 目录下。

然后就可以访问了:http://localhost/

despote1.0's People

Contributors

he110te4m avatar

Stargazers

Cooper avatar yuri2 avatar

Watchers

 avatar yuri2 avatar

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.