定制 almostanything/dependency-graph 二次开发

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

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

almostanything/dependency-graph

最新稳定版本:v1.0.0

Composer 安装命令:

composer require almostanything/dependency-graph

包简介

A simple dependency graph data structure

README 文档

README

A dependency graph data structure.

Usage

Basic Usage

use AlmostAnything\DependencyGraph\DependencyGraphNode as Node;

$jq = new Node('jquery.js');
$bs = new Node('bootstrap.js');
$dp = new Node('datepicker.js');

$jq->addChild($bs);
$dp->addParents($bs, $jq);

$graph = $jq->getGraph();             // returns an instance of DependencyGraph
var_dump($graph->topologicalSort());

Dependency Graphs can be disconnected so you may want to provide a DependencyGraph instance.

use AlmostAnything\DependencyGraph\DependencyGraphNode as Node;
use AlmostAnything\DependencyGraph\DependencyGraph as Graph;

$graph = new Graph();

$jq = new Node('jquery.js', $graph);
$pt = new Node('prototype.js', $graph);

$jq->addChild(new Node('bootstrap.js'));      // $graph will be automatically set on child
$pt->addChild(new Node('pt-typeahead.js');

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: Unknown
  • 更新时间: 2015-02-04