sikhlana/laravel-singleton 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

sikhlana/laravel-singleton

最新稳定版本:v2.0.2

Composer 安装命令:

composer require sikhlana/laravel-singleton

包简介

A simple package to automatically mark a class as singleton.

README 文档

README

This package makes it easy to define singletons for the service container with just an implementation of a single interface.

Contents

Installation

You can install the package via composer:

composer require sikhlana/laravel-singleton

If you need to install the service provider manually:

// config/app.php
'providers' => [
    ...
    Sikhlana\Singleton\SingletonServiceProvider::class,
],

Usage

All you have to do is make the class you want to use as a singleton implement the Sikhlana\Singleton\Singleton interface:

use Sikhlana\Singleton\Singleton;

class MySingletonClass implements Singleton
{
    ...
}

And voila! You're done.

Testing

You can do unit tests by running:

vendor/bin/phpunit

Changelog

Please see CHANGELOG for more information what has changed recently.

Security

If you discover any security related issues, please email xoxo@saifmahmud.name instead of using the issue tracker.

Contributing

Please see CONTRIBUTING for details.

Credits

License

The MIT License (MIT). Please see License File for more information.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2019-09-08