一個php技術棧后端猿的知識儲備大綱


<h1 align="center">Easy Tips</h1>

<p align="center">
<a href="https://github.com/TIGERB/easy-tips#目錄">
  <img src="https://img.shields.io/badge/php-done-brightgreen.svg" alt="php">
</a>
<a href="https://github.com/TIGERB/easy-tips/tree/master/mysql">
  <img src="https://img.shields.io/badge/mysql-doing-blue.svg" alt="mysql">
</a>
<a href="https://github.com/TIGERB/easy-tips/tree/master/redis">
  <img src="https://img.shields.io/badge/redis-doing-blue.svg" alt="redis">
</a>
<a href="https://github.com/TIGERB/easy-tips/tree/master/patterns">
  <img src="https://img.shields.io/badge/patterns-done-brightgreen.svg" alt="patterns">
</a>
<a href="https://github.com/TIGERB/easy-tips/tree/master/algorithm">
  <img src="https://img.shields.io/badge/algorithm-%CE%B1-yellowgreen.svg" alt="algorithm">
</a>
<a href="https://github.com/TIGERB/easy-tips/tree/master/data-structure">
  <img src="https://img.shields.io/badge/data--structure-doing-blue.svg" alt="data-structure">
</a>
<a href="https://github.com/TIGERB/easy-tips/tree/master/network">
  <img src="https://img.shields.io/badge/network-doing-blue.svg" alt="network">
</a>
</p>

<br>

> 一個php技術棧后端猿的知識儲備大綱

## 前言

為什么把php,mysql,redis放在前三位?因為php/mysql/redis基礎是一個當代phper的根基。

## 備注

狀態        | 含義
--------- | -------
not-start | 當前未開始總結
doing     | 總結中
α         | 目前僅供參考未修正和發布
done      | 總結完畢
fixing    | 查漏補缺修改中

## 目錄

- PHP(doing)

  - 符合PSR的PHP編程規范(含個人建議)

    - [實例](https://github.com/TIGERB/easy-tips/blob/master/php/standard.php)
    - [文檔](https://github.com/TIGERB/easy-tips/blob/master/php/standard.md)
    - [經驗](https://github.com/TIGERB/easy-tips/blob/master/php/artisan.md)

  - 基礎知識[讀(R)好(T)文(F)檔(M)]

    - [數據類型](http://php.net/manual/zh/language.types.php)
    - [運算符優先級](http://php.net/manual/zh/language.operators.precedence.php)
    - [string函數](http://php.net/ref.strings.php)
    - [array函數](http://php.net/manual/zh/ref.array.php)
    - [math函數](http://php.net/manual/zh/ref.math.php)
    - [面向對象](http://php.net/manual/zh/language.oop5.php)
    - 版本新特性

      - [7.1](http://php.net/manual/zh/migration71.new-features.php)
      - [7.0](http://php.net/manual/zh/migration70.new-features.php)
      - [5.6](http://php.net/manual/zh/migration56.new-features.php)
      - [5.5](http://php.net/manual/zh/migration55.new-features.php)
      - [5.4](http://php.net/manual/zh/migration54.new-features.php)
      - [5.3](http://php.net/manual/zh/migration53.new-features.php)

  - [記一些坑](https://github.com/TIGERB/easy-tips/blob/master/pit.md#記一些坑)

- Mysql(doing)

  - [常用sql語句](https://github.com/TIGERB/easy-tips/blob/master/mysql/sql.md)
  - 引擎
    - InnoDB
    - MyISAM
    - Memory
    - Archive\Blackhole\CSV\Federated\merge\NDB
  - 事務隔離級別
    - READ UNCOMMITTED:未提交讀
    - READ COMMITTED:提交讀/不可重復讀
    - REPEATABLE READ:可重復讀(MYSQL默認事務隔離級別)
    - SERIALIZEABLE:可串行化
  - 索引
    - B-Tree
    - 哈希索引(hash index)
    - 空間數據索引(R-Tree)
    - 全文索引
  - 鎖
    - 悲觀鎖
    - 樂觀鎖
  - 分表
    - 垂直分表
    - 水平分表
  - sql優化
  - 主從配置

- Redis(doing)

  - 常用命令
  - 實現原理&與memcache區別
  - 常見使用場景實戰
    - [緩存](https://github.com/TIGERB/easy-tips/blob/master/redis/cache.php)
    - [隊列](https://github.com/TIGERB/easy-tips/blob/master/redis/queue.php)
    - [悲觀鎖](https://github.com/TIGERB/easy-tips/blob/master/redis/pessmistic-lock.php)
    - [樂觀鎖](https://github.com/TIGERB/easy-tips/blob/master/redis/optimistic-lock.php)
    - [訂閱/推送](https://github.com/TIGERB/easy-tips/blob/master/redis/subscribe-publish)

- 設計模式(done/fixing)

  - [概念](https://github.com/TIGERB/easy-tips/blob/master/patterns/thought.md#設計模式)

  - 創建型模式實例

    - [單例模式](https://github.com/TIGERB/easy-tips/blob/master/patterns/singleton/test.php)
    - [工廠模式](https://github.com/TIGERB/easy-tips/blob/master/patterns/factory/test.php)
    - [抽象工廠模式](https://github.com/TIGERB/easy-tips/blob/master/patterns/factoryAbstract/test.php)
    - [原型模式](https://github.com/TIGERB/easy-tips/blob/master/patterns/prototype/test.php)
    - [建造者模式](https://github.com/TIGERB/easy-tips/blob/master/patterns/builder/test.php)

  - 結構型模式實例

    - [橋接模式](https://github.com/TIGERB/easy-tips/blob/master/patterns/bridge/test.php)
    - [享元模式](https://github.com/TIGERB/easy-tips/blob/master/patterns/flyweight/test.php)
    - [外觀模式](https://github.com/TIGERB/easy-tips/blob/master/patterns/facade/test.php)
    - [適配器模式](https://github.com/TIGERB/easy-tips/blob/master/patterns/adapter/test.php)
    - [裝飾器模式](https://github.com/TIGERB/easy-tips/blob/master/patterns/decorator/test.php)
    - [組合模式](https://github.com/TIGERB/easy-tips/blob/master/patterns/composite/test.php)
    - [代理模式](https://github.com/TIGERB/easy-tips/blob/master/patterns/proxy/test.php)
    - [過濾器模式](https://github.com/TIGERB/easy-tips/blob/master/patterns/filter/test.php)

  - 行為型模式實例

    - [模板模式](https://github.com/TIGERB/easy-tips/blob/master/patterns/template/test.php)
    - [策略模式](https://github.com/TIGERB/easy-tips/blob/master/patterns/strategy/test.php)
    - [狀態模式](https://github.com/TIGERB/easy-tips/blob/master/patterns/state/test.php)
    - [觀察者模式](https://github.com/TIGERB/easy-tips/blob/master/patterns/observer/test.php)
    - [責任鏈模式](https://github.com/TIGERB/easy-tips/blob/master/patterns/chainOfResponsibility/test.php)
    - [訪問者模式](https://github.com/TIGERB/easy-tips/blob/master/patterns/visitor/test.php)
    - [解釋器模式](https://github.com/TIGERB/easy-tips/blob/master/patterns/interpreter/test.php)
    - [備忘錄模式](https://github.com/TIGERB/easy-tips/blob/master/patterns/memento/test.php)
    - [命令模式](https://github.com/TIGERB/easy-tips/blob/master/patterns/command/test.php)
    - [迭代器模式](https://github.com/TIGERB/easy-tips/blob/master/patterns/iterator/test.php)
    - [中介者器模式](https://github.com/TIGERB/easy-tips/blob/master/patterns/mediator/test.php)
    - [空對象模式](https://github.com/TIGERB/easy-tips/blob/master/patterns/nullObject/test.php)

- [數據結構(doing)](https://github.com/TIGERB/easy-tips/blob/master/data-structure.md)

  - 數組
  - 堆/棧
  - 樹
  - 隊列
  - 鏈表
  - 圖
  - 散列表

- 算法(doing)

  - 算法分析

    - 時間復雜度/空間復雜度/正確性/可讀性/健壯性

  - 算法實戰

    - 排序算法(α)

      - [冒泡排序](https://github.com/TIGERB/easy-tips/blob/master/algorithm/sort/bubble.php)
      - [快速排序](https://github.com/TIGERB/easy-tips/blob/master/algorithm/sort/quick.php)
      - [選擇排序](https://github.com/TIGERB/easy-tips/blob/master/algorithm/sort/select.php)
      - [插入排序](https://github.com/TIGERB/easy-tips/blob/master/algorithm/sort/insert.php)
      - [歸並排序](https://github.com/TIGERB/easy-tips/blob/master/algorithm/sort/merge.php)
      - [希爾排序](https://github.com/TIGERB/easy-tips/blob/master/algorithm/sort/shell.php)
      - [基數排序](https://github.com/TIGERB/easy-tips/blob/master/algorithm/sort/radix.php)

- 網絡基礎(doing)

  - [互聯網協議概述](https://github.com/TIGERB/easy-tips/blob/master/network/internet-protocol.md#互聯網協議)
  - [client和nginx簡易交互過程](https://github.com/TIGERB/easy-tips/blob/master/network/nginx.md#client和nginx簡易交互過程)
  - [nginx和php-fpm簡易交互過程](https://github.com/TIGERB/easy-tips/blob/master/network/nginx.md#nginx和php簡易交互過程)
  - [http](https://github.com/TIGERB/easy-tips/blob/master/network/http.md)
    - 報文
      - 報文頭部
      - 報文體
    - 常見13種狀態碼
    - 方法method
    - https
    - http2
    - websocket

- 計算機基礎(doing)

  - [linux常用命令](https://github.com/TIGERB/easy-tips/blob/master/linux/command.md)
  - shell

- 高並發相關(not-start)

## 測試用例

### 設計模式

運行腳本: php patterns/[文件夾名稱]/test.php

```
例如,

測試責任鏈模式: 運行 php patterns/chainOfResponsibility/test.php

運行結果:

請求5850c8354b298: 令牌校驗通過~
請求5850c8354b298: 請求頻率校驗通過~
請求5850c8354b298: 參數校驗通過~
請求5850c8354b298: 簽名校驗通過~
請求5850c8354b298: 權限校驗通過~
```

### 算法

運行腳本: php algorithm/test.php [算法名稱|空獲取列表]

```
例如,

測試冒泡排序: 運行 php algorithm/test.php bubble

運行結果:

==========================冒泡排序=========================
Array
(
    [0] => 11
    [1] => 67
    [2] => 3
    [3] => 121
    [4] => 71
    [5] => 6
    [6] => 100
    [7] => 45
    [8] => 2
)
=========上為初始值==================下為排序后值=============
Array
(
    [0] => 2
    [1] => 3
    [2] => 6
    [3] => 11
    [4] => 45
    [5] => 67
    [6] => 71
    [7] => 100
    [8] => 121
)
```

### 常見redis運用實現

運行腳本: php redis/test.php [名稱|空獲取列表]

```
例如,

測試悲觀鎖: 運行 php redis/test.php p-lock

運行結果:

執行count加1操作~

count值為:1

```

## 糾錯

如果大家發現有什么不對的地方,可以發起一個[issue](https://github.com/TIGERB/easy-tips/issues)或者[pull request](https://github.com/TIGERB/easy-tips),
我會及時糾正,THX~

> 補充:發起pull request的commit message請參考文章[Commit message編寫指南](http://www.ruanyifeng.com/blog/2016/01/commit_message_change_log.html)

## 英文版

因為國外開發者的要求和個人的時間有限,征集大家有興趣的可以把本項目進行英文版翻譯。希望國外的developer也可以受益於這個項目~

翻譯文件認領申請:<https://github.com/TIGERB/easy-tips/issues/36>

## 感謝

感謝以下朋友的issue或pull request:

- @[faynwol](https://github.com/faynwol)
- @[whahuzhihao](https://github.com/whahuzhihao)
- @[snriud](https://github.com/snriud)
- @[fhefh2015](https://github.com/fhefh2015)
- @[RJustice](https://github.com/RJustice)
- @[ooing](https://github.com/ooing)
- @[shellus](https://github.com/shellus)
- @[entimm](https://github.com/entimm)
- @[jealone](https://github.com/jealone)
- @[cugblbs](https://github.com/cugblbs)
- @[CmderQ](https://github.com/CmderQ)
- @[neetdai](https://github.com/neetdai)
- @[yangqiphp](https://github.com/yangqiphp)


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM