Skip to content

wangschang/DesignPatternsPHP

 
 

Repository files navigation

DesignPatternsPHP

php设计模式(基于php7)

Build Status Documentation Status Donate

Read the Docs of DesignPatternsPHP or Download as PDF/Epub

This is a collection of known design patterns and some sample code how to implement them in PHP. Every pattern has a small list of examples.

这是一个php实现的设计模式的汇总,每个设计模式都有一个小栗子。

I think the problem with patterns is that often people do know them but don't know when to apply which.

我想关于设计模式的问题是:我们知道他但是不知道如何应用它们

Installation

安装

You should look at and run the tests to see what happens in the example.

你应该看一下并允许测试看看例子是如何运行的

To do this, you should install dependencies with Composer first:

首先你要安装 Composer 的依赖

$ composer install

Read more about how to install and use Composer on your local machine here.

关于更多如何使Composer请阅读更多 here.

To run the tests use phpunit:

$ ./vendor/bin/phpunit

using Docker (optional)

使用 Docker(可选)

You can optionally build and browse the documentation using Docker for Mac, Windows or Linux.

查看相应文档请查看:Docker for Mac, Windows or Linux.

Just run:

运行:

$ docker-compose up --build

Go to http://localhost:8080/README.html to read the generated documentation.

http://localhost:8080/README.html 查看生成文档。

Patterns

设计模式

The patterns can be structured in roughly three different categories. Please click on the 📓 for a full explanation of the pattern on Wikipedia.

设计模式大���有三个目录组成,点击链接查看详细的Wikipedia 解释 📓

参考地址 : https://designpatternsphp.readthedocs.io/zh_CN/latest/README.html

有已经翻译完的地址请参考:https://learnku.com/docs/php-design-patterns/2018/translation-instructions/1486

About

sample code for several design patterns in PHP 7.4 PHP设计模式

Topics

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • PHP 85.3%
  • Python 8.0%
  • Makefile 6.4%
  • Dockerfile 0.3%