Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

PhpCodeAnalyzer (really, it's "php extensions usage analyzer") scans codebase and analyzes which non-built-in php extensions used

License

NotificationsYou must be signed in to change notification settings

wapmorgan/PhpCodeAnalyzer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

41 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PhpCodeAnalyzer finds usage of different non-built-in extensions in your php code.This tool helps you understand how transportable your code between php installations is.

Latest Stable VersionTotal DownloadsLicense

TOC

Example of usage

To scan your files or folder launchphpca and pass file or directory names.

> phpca ..\HttpServerScanning ..\HttpServer ...[spl] Function"spl_autoload_register" usedin file ..\HttpServer/vendor/composer/ClassLoader.php[258][spl] Function"spl_autoload_unregister" usedin file ..\HttpServer/vendor/composer/ClassLoader.php[266][spl] Function"spl_autoload_register" usedin file ..\HttpServer/vendor/composer/autoload_real.php[22][spl] Function"spl_autoload_unregister" usedin file ..\HttpServer/vendor/composer/autoload_real.php[24]Used non-built-in extensionsin your code:- [spl] Standard PHP Library (SPL). This extension is bundled with php since PHP 5.0.0. Extension is availablein pecl: spl.

You can skip progress with--no-progress option:

> phpca --no-progress ..\yii-1.1.16.bca042\framework\cachingScanning ..\yii-1.1.16.bca042\framework\caching ...Used non-built-in extensionsin your code:- [apc] Alternative PHP Cache. Extension is availablein pecl: apc.- [wincache] Windows CacheforPHP. Extension is availablein pecl: wincache.

Also, you can keep only progress with--no-report option:

> phpca --no-report ..\yii-1.1.16.bca042\framework\cachingScanning ..\yii-1.1.16.bca042\framework\caching ...[apc] Function"apc_fetch" usedin file ..\yii-1.1.16.bca042\framework\caching/CApcCache.php[46][apc] Function"apc_fetch" usedin file ..\yii-1.1.16.bca042\framework\caching/CApcCache.php[56][apc] Function"apc_store" usedin file ..\yii-1.1.16.bca042\framework\caching/CApcCache.php[70][apc] Function"apc_add" usedin file ..\yii-1.1.16.bca042\framework\caching/CApcCache.php[84][apc] Function"apc_delete" usedin file ..\yii-1.1.16.bca042\framework\caching/CApcCache.php[95][apc] Function"apc_clear_cache" usedin file ..\yii-1.1.16.bca042\framework\caching/CApcCache.php[107][apc] Function"apc_clear_cache" usedin file ..\yii-1.1.16.bca042\framework\caching/CApcCache.php[109][wincache] Function"wincache_ucache_get" usedin file ..\yii-1.1.16.bca042\framework\caching/CWinCache.php[46][wincache] Function"wincache_ucache_get" usedin file ..\yii-1.1.16.bca042\framework\caching/CWinCache.php[56][wincache] Function"wincache_ucache_set" usedin file ..\yii-1.1.16.bca042\framework\caching/CWinCache.php[70][wincache] Function"wincache_ucache_add" usedin file ..\yii-1.1.16.bca042\framework\caching/CWinCache.php[84][wincache] Function"wincache_ucache_delete" usedin file ..\yii-1.1.16.bca042\framework\caching/CWinCache.php[95][wincache] Function"wincache_ucache_clear" usedin file ..\yii-1.1.16.bca042\framework\caching/CWinCache.php[106]

If you want to see only usage of one specific extension, use--extension= option:

> phpca --extension=apc ..\yii-1.1.16.bca042\framework\cachingScanning ..\yii-1.1.16.bca042\framework\caching ...[apc] Function"apc_fetch" usedin file ..\yii-1.1.16.bca042\framework\caching/CApcCache.php[46][apc] Function"apc_fetch" usedin file ..\yii-1.1.16.bca042\framework\caching/CApcCache.php[56][apc] Function"apc_store" usedin file ..\yii-1.1.16.bca042\framework\caching/CApcCache.php[70][apc] Function"apc_add" usedin file ..\yii-1.1.16.bca042\framework\caching/CApcCache.php[84][apc] Function"apc_delete" usedin file ..\yii-1.1.16.bca042\framework\caching/CApcCache.php[95][apc] Function"apc_clear_cache" usedin file ..\yii-1.1.16.bca042\framework\caching/CApcCache.php[107][apc] Function"apc_clear_cache" usedin file ..\yii-1.1.16.bca042\framework\caching/CApcCache.php[109]

Summary report in this case will not be added at the end.

Help

Full list of available options:

> phpca -hPhpCodeAnalyzerUsage:    phpca [-v] [-q] [--output=<path>] [--no-report] [--no-progress] [--since-version=<version>] FILES...    phpca [-v] [-q] [--output=<path>] --extension=<ext> FILES...    phpca -hOptions:  -h --help                 Show this text  -v --verbose              Show more debug text  -q --quiet                Don't print any messages  --output=<path>           Path where to generate XML report  --extension=<ext>         Look for usage a specific extension  --no-report               Turn off summary report  --no-progress             Turn off progress  --since-version=<version> Only include extensions not included since version

Installation

Phar

  1. Just download a phar fromreleases page and make executable
chmod +x phpca.phar
  1. a.Local installation: use it from current folder:

    ./phpca.phar -h

    b.Global installation: move it in to one of folders listed in your$PATH and run from any folder:

    sudo mv phpca.phar /usr/local/bin/phpcaphpca -h

Composer

Another way to installphpca is via composer.

  1. Install composer:
curl -sS https://getcomposer.org/installer| php
  1. Install phpcf in global composer dir:
./composer.phar global require wapmorgan/php-code-analyzer dev-master
  1. Run from any folder:
phpca -h

About

PhpCodeAnalyzer (really, it's "php extensions usage analyzer") scans codebase and analyzes which non-built-in php extensions used

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors5

Languages


[8]ページ先頭

©2009-2025 Movatter.jp