algoritma/phpinfo 问题修复 & 功能扩展

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

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

algoritma/phpinfo

最新稳定版本:0.0.1

Composer 安装命令:

composer require algoritma/phpinfo

包简介

A lightweight CLI tool to fetch and inspect PHP settings by running `phpinfo()` via HTTP in your web application's environment. This tool is particularly useful for verifying the actual configuration of a running FPM instance when CLI settings might differ.

README 文档

README

A lightweight CLI tool to fetch and inspect PHP settings by running phpinfo() via HTTP in your web application's environment. This tool is particularly useful for verifying the actual configuration of a running FPM instance when CLI settings might differ.

Features

  • Accurate Info: Fetches settings from the perspective of the web server, not the CLI.
  • Secure: Uses a randomly named temporary file that is automatically deleted after each request.
  • Filtering: View only important settings, search for specific keys, or filter by extension/section.
  • Colorized Output: Easy-to-read terminal output with a legend for local vs. default values.

Requirements

  • PHP 8.4 or higher.
  • PHP cURL extension.
  • Write access to the public directory of your web application.

Installation

Via Composer

You can install this tool as a dependency in your project:

composer require algoritma/phpinfo

Or install it globally:

composer global require algoritma/phpinfo

Utilization

The tool provides a single command: php:info.

Basic Usage

You must provide the base URL of your application. The tool will automatically attempt to guess your project's public directory.

bin/phpinfo https://myapp.local

Configuration via Environment Variables

You can set default values in a .env file in your current directory:

APP_URL=https://myapp.local
APP_PUBLIC_DIR=/var/www/html/public

Advanced Options

  • Specific Public Directory: If the tool cannot guess it correctly.

    bin/phpinfo https://myapp.local /var/www/html/my-public-dir
  • Filter by Section: Show only specific extensions or sections.

    bin/phpinfo https://myapp.local --section=core --section=opcache
  • Search for a Key: Find a specific configuration directive.

    bin/phpinfo https://myapp.local --search=memory
  • Show Important Settings: Display a curated list of the most relevant production settings.

    bin/phpinfo https://myapp.local --important
  • Skip SSL Verification: Useful for local development with self-signed certificates.

    bin/phpinfo https://myapp.local --no-verify

Contributing

Contributions are welcome! To contribute, follow these steps:

  1. Fork the repository.

  2. Install dependencies:

    composer install
  3. Run Quality Assurance: Before submitting a PR, ensure all tests and quality checks pass:

    make qa

    This command runs:

    • PHPUnit: Unit and integration tests.
    • PHPStan: Static analysis.
    • Rector: Code upgrades and refactoring checks.
    • PHP-CS-Fixer: Coding style checks.
  4. Fix Coding Style / Rector: If there are issues, you can run:

    make qa-fix

Project Structure

  • bin/: The CLI entry point.
  • src/Command/: Symfony Console command implementation.
  • src/Service/: Logic for fetching, parsing, filtering, and rendering PHP info.
  • tests/: PHPUnit tests.

License

This project is licensed under the MIT License. See the LICENSE file (if present) or composer.json for details.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-03-06

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固