术语
- 工作区 /work tree
仓库所在的文件夹叫做工作区,就是你在电脑里能看到的目录。 - 暂存区
也就是在 git add 之后,git commit 之前的缓冲区,一般在.git/index 文件中。 - 仓库
git commit 之后,根据暂存区的文件生成一个 commit id, 暂存区的文件归档到仓库中,一般在.git/objects 里面
git
# 输出git版本信息
$ git -v
git version 2.38.1.windows.1
# 输出常用的命令列表
记录-交流-Web开发知识分享
路由类
Router.php
<?php class Router { private $routes = []; private $routeCount = 0; public function addRoute($method, $url, $callback) { if ($url !== '/') {//去除url尾部斜杠 while ($url !== $url = rtrim($url, '/'));//不应该去除url尾部斜杠,以后要改 } $this->routes[] = ['method' => $method, 'url' =>…
# 输出git版本信息
$ git -v
git version 2.38.1.windows.1
# 输出常用的命令列表
; 该文件中的所有配置均以分号 (;) 开头,代表注释行或不使用的指令
; 全局配置
[global]
; 进程 ID 文件位置,默认none
pid = /var/run/php-fpm.pid
; 错误日志文件位置,默认#INSTALL_PREFIX#/log/php-fpm.log
error_log = /var/log
#==========================nginx全局配置==========================#
# 指定 nginx 进程运行的用户,这里是 nginx,默认为nobody。
user nginx;
# 指定 nginx 使用多少个 worker 进程处理请求,这里使用了 auto,表示根据 CPU 核心数自动分配。
worker_processes auto;
# 指定 nginx 主进程的 PID 文件路径。
pid /run/nginx.pid;
#指定错误日志文件的路径
error_log /var/
网址的url结尾应该不应该带斜杠
带与不带斜杠"/"是不同的网址.
特别是相对url,
如果 你访问https://www.p2hp.com/about ,里面有个<a href="info">info</a>,则它将链接到https://www.p2hp.com/info.
而如果你访问https://www.p2hp.com/about/(一般返回同样的内容),则里面的<a href="info">info</a>,将链接到https://www.p2hp.com/about/info.
但根目录带不带/是一样的
如:http://www.p2hp.com 和http://www.p2hp.com/ 是一样的.
已测试.
参考:
https://blog.cdivilly.com/2019/02/28/uri-trailing-slashes
https://stackoverflow.com/questions/5948659/when-should-i-use-a-trailing-slash-in-my-url
https://www.cloudways.com/blog/trailing-slashes-urls/
https://ahrefs.com/blog/zh/trailing-slash/
…
近期评论