惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

云风的 BLOG
云风的 BLOG
The GitHub Blog
The GitHub Blog
Y
Y Combinator Blog
博客园 - 三生石上(FineUI控件)
T
The Blog of Author Tim Ferriss
宝玉的分享
宝玉的分享
Hugging Face - Blog
Hugging Face - Blog
WordPress大学
WordPress大学
V
Visual Studio Blog
小众软件
小众软件
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
MongoDB | Blog
MongoDB | Blog
V
V2EX
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
博客园 - 【当耐特】
Microsoft Azure Blog
Microsoft Azure Blog
The Cloudflare Blog
H
Hackread – Cybersecurity News, Data Breaches, AI and More
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
Engineering at Meta
Engineering at Meta
L
LangChain Blog
Martin Fowler
Martin Fowler
GbyAI
GbyAI
博客园 - 司徒正美

zodream梦想开源/个人编程日记

文件解析笔记-zodream梦想开源/个人编程日记 密码本开发笔记之读写与保存-zodream梦想开源/个人编程日记 SkiaSharp 把 pixel byte[] 转成 SKBitmap-zodream梦想开源/个人编程日记 nas 使用 Docker 安装 gogs-zodream梦想开源/个人编程日记 复制 android 手机中的文件到电脑-zodream梦想开源/个人编程日记 周报:寻找优质的周刊-zodream梦想开源/个人编程日记 开发日志:对Markdown的代码块新增引用来源支持-zodream梦想开源/个人编程日记 周报:怎么写技术类的教程文章-zodream梦想开源/个人编程日记 css display:flex 布局尺寸超出问题-zodream梦想开源/个人编程日记 周报:SEO优化的思考-zodream梦想开源/个人编程日记 Edge 浏览器不适用 Edge Image Viewer 打开图片 -zodream梦想开源/个人编程日记 SEO 学习笔记(一) 内容来源-zodream梦想开源/个人编程日记 PHP 实现双因素身份认证(2FA)-zodream梦想开源/个人编程日记 WPF MVVM 获取List 多选数据-zodream梦想开源/个人编程日记 Burp Suite 抓包-zodream梦想开源/个人编程日记 使用 indexnow 注意事项-zodream梦想开源/个人编程日记 Godot 使用字体图标 例如: Iconfont、FontAwesome-zodream梦想开源/个人编程日记 angular 15 对指定页面进行访问限制-zodream梦想开源/个人编程日记 CSS 使用 column-count 实现瀑布流出现内容分割的解决办法-zodream梦想开源/个人编程日记 input 确认按键事件在手机端不生效-zodream梦想开源/个人编程日记 C# 使用socket 进行通讯-zodream梦想开源/个人编程日记 Maui开发中Windows应用开启管理员权限-zodream梦想开源/个人编程日记 Maui 中自定义控件-zodream梦想开源/个人编程日记 angular 14 使用 ng-template 实现tree 结构显示-zodream梦想开源/个人编程日记 c# 动态安装和卸载dll-zodream梦想开源/个人编程日记 慎用 CompositionTarget.Rendering-zodream梦想开源/个人编程日记 c# 重写 c++ 程序笔记:数据初始化-zodream梦想开源/个人编程日记 源码编译 aseprite-zodream梦想开源/个人编程日记 记录一下字符串分隔split各语言之间的不同-zodream梦想开源/个人编程日记 c# Gzip解码无头内容-zodream梦想开源/个人编程日记
第二课 安装及入口配置-zodream梦想开源/个人编程日记
zodream · 2016-03-03 · via zodream梦想开源/个人编程日记

最新文档

具体文档请查看【zodream

基本骨架

请下载 PHP-ZoDream 中的 starter 分支,这个分支只包含基本的骨架,适合新项目开发

主分支为框架配套的开发项目,包括本站的源码和一些开发中的模块

搭建完整架构

请配合composer.phar 在命令行执行

php composer.phar install

1

入口配置

html/index.php

<?php
use Zodream\Service\Web;

require_once dirname(__DIR__).'/Service/Bootstrap.php';
$app = new Web(APP_DIR);
$app->autoResponse();

123456

解释 这里主要加载主程序 ,具体引入文件在

Service/Bootstrap.php

<?php
if (version_compare(PHP_VERSION, '7.1.0', '<'))  {
    die('require PHP > 7.1.0 !');
}
defined('DEBUG') or define('DEBUG', true);                  //是否开启测试模式
define('APP_DIR', dirname(__DIR__));            //定义路径
require_once APP_DIR.'/vendor/autoload.php';

1234567

  • 第一句,是指要求 PHP 版本最低要求为 7.1 ;
  • 第二句,是指是否开启测试模式,在上线时#必须#改为 FALSE 或注释此句,不然会爆出错误并提示路径;
  • 第三句,是指定义路径,是指当前程序所在的位置,如果本入口文件与其他文件夹不处于同级目录,请指向其他文件夹所处的父目录;
  • 第四句,是指定义组件名,这个主要是为了方便多个网址同时存在,并共用同一个主程序;
  • 第五句,载入 Composer 的自动加载程序,方便以后使用其他类;
  • 第六句,正式启动程序,手动控制是为了能够手动注册其他路由;

转载请保留原文链接: https://zodream.cn/blog/id/2.html