arabcoders/dependency 问题修复 & 功能扩展

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

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

arabcoders/dependency

Composer 安装命令:

composer require arabcoders/dependency

包简介

Find function and class dependencies in PHP source code

README 文档

README

Find function and class dependencies in PHP source code

This class can determine all classes and functions used by one or more PHP scripts, This is useful to determine if scripts can be run in certain environments.

Install

Via Composer

$ composer require arabcoders/dependency

Usage Example.

<?php

require __DIR__ . '/../../autoload.php';

$normalize  = new \arabcoders\dependency\NormalizeNames();
$extentions = new \arabcoders\dependency\ParseExtensions( $normalize );
$parser     = new \arabcoders\dependency\ParseToken( $normalize );

$files = new RegexIterator(
    new RecursiveIteratorIterator(
        new RecursiveDirectoryIterator( __DIR__ . '/dummydata' )
    ),
    '/^.+\.php$/i',
    RecursiveRegexIterator::GET_MATCH
);

$dependency = new \arabcoders\dependency\Dependency( $normalize, $extentions->run(), $parser, $files, [ ] );

print PHP_EOL . PHP_EOL . 'Get count for each extension call';

$dependency->run();

foreach ( $dependency->getCountPerExtensionCalls() as $extention => $calls )
{
    print sprintf( PHP_EOL . PHP_EOL . '** Extention ( %s ) **' . PHP_EOL . PHP_EOL, $extention );
    foreach ( $calls as $call => $count )
    {
        print sprintf( '* %s: %d' . PHP_EOL, $call, $count );
    }
}

print PHP_EOL . PHP_EOL . 'Get count for each extension' . PHP_EOL . PHP_EOL;

foreach ( $dependency->getCountPerExtention() as $extention => $count )
{
    print sprintf( '** %s: %d **' . PHP_EOL, $extention, $count );
}

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2016-06-23

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固