PhpCodeAnalyzer
version` option
PHPCodeanalyzer พบการใช้ส่วนขยายที่ไม่ได้สร้างขึ้นในรหัส PHP ของคุณ เครื่องมือนี้ช่วยให้คุณเข้าใจว่ารหัสของคุณสามารถขนส่งได้ระหว่างการติดตั้ง PHP เป็นอย่างไร
ในการสแกนไฟล์หรือโฟลเดอร์เรียกใช้ phpca และส่งไฟล์หรือชื่อไดเรกทอรี
> phpca .. H ttpServer
Scanning .. H ttpServer ...
[spl] Function " spl_autoload_register " used in file .. H ttpServer/vendor/composer/ClassLoader.php[258]
[spl] Function " spl_autoload_unregister " used in file .. H ttpServer/vendor/composer/ClassLoader.php[266]
[spl] Function " spl_autoload_register " used in file .. H ttpServer/vendor/composer/autoload_real.php[22]
[spl] Function " spl_autoload_unregister " used in file .. H ttpServer/vendor/composer/autoload_real.php[24]
Used non-built-in extensions in your code:
- [spl] Standard PHP Library (SPL). This extension is bundled with php since PHP 5.0.0. Extension is available in pecl: spl. คุณสามารถข้ามความคืบหน้าด้วยตัวเลือก --no-progress :
> phpca --no-progress .. y ii-1.1.16.bca042 f ramework c aching
Scanning .. y ii-1.1.16.bca042 f ramework c aching ...
Used non-built-in extensions in your code:
- [apc] Alternative PHP Cache. Extension is available in pecl: apc.
- [wincache] Windows Cache for PHP. Extension is available in pecl: wincache.
นอกจากนี้คุณสามารถรักษาความคืบหน้าได้ด้วยตัวเลือก --no-report :
> phpca --no-report .. y ii-1.1.16.bca042 f ramework c aching
Scanning .. y ii-1.1.16.bca042 f ramework c aching ...
[apc] Function " apc_fetch " used in file .. y ii-1.1.16.bca042 f ramework c aching/CApcCache.php[46]
[apc] Function " apc_fetch " used in file .. y ii-1.1.16.bca042 f ramework c aching/CApcCache.php[56]
[apc] Function " apc_store " used in file .. y ii-1.1.16.bca042 f ramework c aching/CApcCache.php[70]
[apc] Function " apc_add " used in file .. y ii-1.1.16.bca042 f ramework c aching/CApcCache.php[84]
[apc] Function " apc_delete " used in file .. y ii-1.1.16.bca042 f ramework c aching/CApcCache.php[95]
[apc] Function " apc_clear_cache " used in file .. y ii-1.1.16.bca042 f ramework c aching/CApcCache.php[107]
[apc] Function " apc_clear_cache " used in file .. y ii-1.1.16.bca042 f ramework c aching/CApcCache.php[109]
[wincache] Function " wincache_ucache_get " used in file .. y ii-1.1.16.bca042 f ramework c aching/CWinCache.php[46]
[wincache] Function " wincache_ucache_get " used in file .. y ii-1.1.16.bca042 f ramework c aching/CWinCache.php[56]
[wincache] Function " wincache_ucache_set " used in file .. y ii-1.1.16.bca042 f ramework c aching/CWinCache.php[70]
[wincache] Function " wincache_ucache_add " used in file .. y ii-1.1.16.bca042 f ramework c aching/CWinCache.php[84]
[wincache] Function " wincache_ucache_delete " used in file .. y ii-1.1.16.bca042 f ramework c aching/CWinCache.php[95]
[wincache] Function " wincache_ucache_clear " used in file .. y ii-1.1.16.bca042 f ramework c aching/CWinCache.php[106] หากคุณต้องการเห็นการใช้งานส่วนขยายเฉพาะเพียงหนึ่งเดียวให้ใช้ --extension= ตัวเลือก:
> phpca --extension=apc .. y ii-1.1.16.bca042 f ramework c aching
Scanning .. y ii-1.1.16.bca042 f ramework c aching ...
[apc] Function " apc_fetch " used in file .. y ii-1.1.16.bca042 f ramework c aching/CApcCache.php[46]
[apc] Function " apc_fetch " used in file .. y ii-1.1.16.bca042 f ramework c aching/CApcCache.php[56]
[apc] Function " apc_store " used in file .. y ii-1.1.16.bca042 f ramework c aching/CApcCache.php[70]
[apc] Function " apc_add " used in file .. y ii-1.1.16.bca042 f ramework c aching/CApcCache.php[84]
[apc] Function " apc_delete " used in file .. y ii-1.1.16.bca042 f ramework c aching/CApcCache.php[95]
[apc] Function " apc_clear_cache " used in file .. y ii-1.1.16.bca042 f ramework c aching/CApcCache.php[107]
[apc] Function " apc_clear_cache " used in file .. y ii-1.1.16.bca042 f ramework c aching/CApcCache.php[109]รายงานสรุปในกรณีนี้จะไม่ถูกเพิ่มในตอนท้าย
รายการตัวเลือกที่มีอยู่ทั้งหมด:
> phpca -h
PhpCodeAnalyzer
Usage:
phpca [-v] [-q] [--output =< path > ] [--no-report] [--no-progress] [--since-version =< version > ] FILES...
phpca [-v] [-q] [--output =< path > ] --extension= < ext > FILES...
phpca -h
Options:
-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 versionchmod +x phpca.phar. การติดตั้งในพื้นที่ : ใช้จากโฟลเดอร์ปัจจุบัน:
. /phpca.phar -h ข. การติดตั้งทั่วโลก : ย้ายไปยังหนึ่งในโฟลเดอร์ที่ระบุไว้ใน $PATH ของคุณและเรียกใช้จากโฟลเดอร์ใด ๆ :
sudo mv phpca.phar /usr/local/bin/phpca
phpca -hอีกวิธีหนึ่งในการติดตั้ง PHPCA คือผ่านนักแต่งเพลง
curl -sS https://getcomposer.org/installer | php./composer.phar global require wapmorgan/php-code-analyzer dev-masterphpca -h