Skip to content

yangweijie/php-tools

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

48 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PHP Tools Collection

A cross-platform PHP tools collection with GUI interface built using the kingbes/libui library. This toolkit includes system management utilities and HTTP load testing tools.

Features

  • Port Killer: Identify and terminate processes occupying specific ports

    • Scan ports by number to find associated processes
    • Display process details including PID, user, and command
    • Selectively terminate processes with checkboxes
    • Cross-platform support (Windows, macOS, Linux)
  • Process Killer: Find and terminate running processes by name or PID

    • Search processes by name or PID
    • Display detailed process information
    • Selective termination with bulk operations
    • Cross-platform support (Windows, macOS, Linux)
  • Cross-platform GUI: Native desktop application with tabbed interface

    • Built with kingbes/libui PHP-FFI bindings
    • Native look and feel on all platforms
    • Intuitive tabbed interface for different tools
    • Responsive design with proper layout management

System Requirements

  • PHP 8.2+ with FFI extension
  • Windows, macOS, or Linux (x86_64 architecture only)
  • For GUI functionality: libui library dependencies

Installation

From Source

# Clone the repository
git clone https://github.com/yangweijie/php-tools.git
cd php-tools

# Install dependencies
composer install

Download Pre-built Binaries

Pre-built binaries are available for download from the GitHub Releases page for:

  • Windows (x86_64)
  • macOS (x86_64)
  • Linux (x86_64)

Usage

Running the GUI Application

From Source

# When running from source
php cli.php gui

From PHAR Package

# When using the PHAR package
php builds/tools.phar gui

Command Line Options

# Show help
./tools --help

# Show version
./tools --version

Building from Source

Requirements for Building

  • PHP 8.2+ with FFI extension
  • Composer

Build Process

# Install dependencies
composer install

# Build PHAR executable
php cli.php build

# Or use the build script
./build.sh

# The built executable will be available in the builds/ directory

Development

Project Structure

app/                 # Application source code
├── App.php         # Main GUI application class
├── PortKiller.php  # Port killing utility
├── ProcessKiller.php # Process killing utility
├── ProcessRow.php  # Process row component
├── ExampleTab.php  # Example tab component
├── Commands/       # CLI commands
└── Providers/      # Service providers
scripts/            # Development and utility scripts
├── watcher.php     # Hot reload watcher script
dev.sh              # Development script for macOS/Linux
dev.bat             # Development script for Windows
bootstrap/          # Application bootstrap files
config/             # Configuration files
tests/              # Test files
builds/             # Build output directory

Running Tests

php run_tests.php

Development Commands

# Install dependencies
composer install

# Run tests
composer test

# Code formatting
composer format

# Build PHAR executable
php cli.php build

Development with Hot Reload

For improved development experience, we provide hot reload functionality that automatically restarts the GUI application when PHP files are modified:

Using the development scripts

# On macOS/Linux
./dev.sh

# On Windows
dev.bat

This will start the GUI application in watch mode. Any changes to PHP files in the app/ directory will automatically trigger a restart of the application.

Manual hot reload

# On all platforms
php scripts/watcher.php gui --watch

Cross-platform Builds

The GitHub Actions workflow automatically builds binaries for all supported platforms:

  • Linux (x86_64)
  • Windows (x86_64)
  • macOS (x86_64)

GitHub Actions

This repository includes GitHub Actions for automated building and releasing:

  • Build and Release: Automatically builds binaries for all platforms when a new tag is pushed
  • Continuous Integration: Runs tests on every push and pull request

Creating a New Release

To create a new release with pre-built binaries:

  1. Create and push a new tag:

    git tag v1.0.0
    git push origin v1.0.0
  2. The GitHub Action will automatically:

    • Build binaries for Linux, Windows, and macOS
    • Create a new release on GitHub
    • Attach all platform binaries to the release

Manual Release Trigger

You can also manually trigger the build workflow:

  1. Go to the "Actions" tab in your GitHub repository
  2. Select "Build and Release" workflow
  3. Click "Run workflow" and confirm

Downloading Binaries

Pre-built binaries are available from the GitHub Releases page:

  • Windows: tools-windows.exe
  • macOS: tools-macos
  • Linux: tools-linux

Download the appropriate binary for your platform and run it directly without any installation.

Dependencies

License

This project is open-source software licensed under the MIT license.

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

About

用 kingbes/libui 开发的php工具箱,跨平台

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages