定制 anthonykgross/dependency-resolver 二次开发

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

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

anthonykgross/dependency-resolver

最新稳定版本:v2

Composer 安装命令:

composer require anthonykgross/dependency-resolver

包简介

dependency-resolver

README 文档

README

Build Status

Installing anthonykgross/dependency-resolver

The recommended way to install anthonykgross/dependency-resolver is through Composer.

# Install Composer
curl -sS https://getcomposer.org/installer | php

Next, run the Composer command to install the latest stable version of dependency-resolver:

php composer.phar require anthonykgross/dependency-resolver "dev-master"

After installing, you need to require Composer's autoloader:

require 'vendor/autoload.php';

You can then later update dependency-resolver using composer:

composer.phar update

Usage

$tree  = array(
   'A' => array(),
   'B' => array('A'),
   'C' => array('B'),
   'D' => array('C', 'A'),
   'E' => array('C', 'B'),
);
$resolution = \Algorithm\DependencyResolver::resolve($tree);
print($resolution);
// ['A','B','C','D','E']

OR

$tree  = array(
    'A' => array('B'),
    'B' => array('C'),
    'C' => array('A'),
);
$resolution = \Algorithm\DependencyResolver::resolve($tree);
// RuntimeException : Circular dependency: C -> A

Documentation

Contributors

Anthony K GROSS

Joshua Behrens

Copyright and license

Code and documentation copyright 2020. Code released under the MIT license.

统计信息

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

GitHub 信息

  • Stars: 12
  • Watchers: 2
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2017-07-25