华为防火墙cli控制台
I have always been a big fan of console commands and I try to provide a command line interface (CLI) as much as possible in most of my PHP projects.
我一直是控制台命令的忠实拥护者,并且我尝试在大多数PHP项目中尽可能提供命令行界面(CLI)。
In this article, I’ll briefly compare three PHP console command libraries:
在本文中,我将简要比较三个PHP控制台命令库:
The Symfony console component (symfony/Console)
Symfony控制台组件( symfony / Console )
The Hoa console (hoa/console)
Hoa控制台( hoa /控制台 )
The Webmozart console (webmozart/console)
Webmozart控制台( webmozart /控制台 )
起源故事 (Origin Stories)
The Symfony console is the oldest and the most popular one, used in many projects (and obviously part of the Symfony framework). With dozens of contributors, it became the first choice for many developers.
Symfony控制台是最古老和最受欢迎的控制台 ,在许多项目中使用(显然是Symfony框架的一部分)。 拥有数十名贡献者,它已成为许多开发人员的首选。
Hoa is a modular, extensible and structured set of PHP libraries that includes the Hoa console. It aims to be a bridge between industrial and research worlds, and this makes that project quite interesting.
Hoa是一组模块化,可扩展和结构化PHP库,其中包括Hoa控制台 。 它旨在成为工业界和研究界之间的桥梁,这使该项目非常有趣。
The Webmozart console is the newest project, wants to be easier, test friendly and add new functionality on top of the Symfony console.
Webmozart控制台是最新的项目,希望更简单,易于测试并在Symfony控制台之上添加新功能。
依赖关系,大小和复杂性 (Dependencies, Size, and Complexity)
The Symfony console has only suggested dependencies, as opposed to the Hoa console library that depends on some Hoa project libraries. The Webmozart project, too, directly depends on the Symfony console.
Symfony控制台仅建议了依赖项,而不是依赖于某些Hoa项目库的Hoa控制台库。 Webmozart项目也直接取决于Symfony控制台。
The Hoa console has the smallest number of LOC (Logical Lines of Code) ~1397, followed by the Symfony console ~2226 and the Webmozart ~3126 (without dependencies).
Hoa控制台的LOC (逻辑代码行)数量最少,〜1397,其次是Symfony控制台〜2226和Webmozart 〜3126(无依赖项)。
In order to have a rough indicator of the complexity of these projects, below is some data from their PHPLOC analysis*:
为了粗略地说明这些项目的复杂性,以下是来自其PHPLOC分析的一些数据*:
Description | Symfony | Hoa | Webmozart |
---|---|---|---|
Cyclomatic Complexity | |||
Average Complexity per LLOC | 0.37 | 0.36 | 0.26 |
Average Complexity per Class | 14.73 | 25.14 | 8.84 |
Average Complexity per Method | 2.55 | 3.38 | 1.99 |
Dependencies | |||
Global Accesses | 3 | 20 | 1 |
Attribute Accesses | 807 | 217 | 1285 |
Method Calls | 1103 | 324 | 1320 |
描述 | Symfony | a | Webmozart |
---|---|---|---|
圈复杂度 | |||
每个LLOC的平均复杂度 | 0.37 | 0.36 | 0.26 |
每班平均复杂度 | 14.73 | 25.14 | 8.84 |
每种方法的平均复杂度 | 2.55 | 3.38 | 1.99 |
依存关系 | |||
全局访问 | 3 | 20 | <