定制 axelitus/design-patterns 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

axelitus/design-patterns

Composer 安装命令:

composer require axelitus/design-patterns

包简介

Design Patterns for PHP

README 文档

README

A framework agnostic PHP package that contains base classes to easily extend and implement some design patterns.

Package Information

Requirements

The requirements for this package to work are the following:

  • PHP >= 5.4.*

Standards

This package is intended to follow some standards for easy contributions and usage. Recently there has been an initiative to standardize the interoperation of frameworks, though I think this easily extends to most pieces of code everyone is building. The group behind all this is the PHP-FIG (Framework Interoperability Group), you should pay them a visit at their site.

There are already some standards marked as accepted (final): PSR-0, PSR-1, PSR-2 and PSR-3.

This package is intentend to be PSR-2 compliant.

Being PSR-2 compliant means this package can be easily installed by using Composer from the Packagist package archive. Just follow the instructions in section How to install. It also means that there's a guide for coding styles and the developers and contributors should enforce this for everyone's benefit.

Contents

All classes are referenced to the package namespace if not otherwise stated.

  • Utils - Has some useful utilities encapsulated.

  • Creational\Factory - Defines a Factory object.

  • Creational\Multiton - Defines a Multiton object.

  • Creational\MultitonShelf - Defines a MultitonShelf object.

  • Creational\Singleton - Defines a Singleton object.

  • Creational\SingletonShelf - Defines a SingletonShelf object.

  • Creational\TMultiton - Defines a generic Multiton object.

  • Creational\TSingleton - Defines a generic Singleton object.

  • Interfaces\Forgeable - Defines the interface for an object that is forgeable.

  • Interfaces\Initializable - Defines the interface for an object that is initializable.

How to install

To install this package and use it in your app just follow these instructions (if you haven't read the documentation from Composer please do so before you continue):

  1. Download composer if you haven't already done so (use your preferred method). Example:
$ curl -s https://getcomposer.org/installer | php
  1. Place a require statement inside your composer.json file replacing <version> with the desired version. Example:
"require": {
    "axelitus/design-patterns": "<version>"
}
  1. Run the composer installer to resolve dependencies and download the packages. Example:
$ php composer.phar install
  1. In order to use the packages you have to load the autoloader that was generated by composer. Example:
require 'vendor/autoload.php';
  1. Finally just use the package classes as needed:
axelitus\DesignPatterns\[<sub-namespace>\...]<class>::<function>(<params>);

统计信息

  • 总下载量: 263
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 4
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 4
  • Watchers: 1
  • Forks: 1
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2013-08-10

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固