modernman00/shared-lib 问题修复 & 功能扩展

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

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

modernman00/shared-lib

最新稳定版本:v1.8.19

Composer 安装命令:

composer require modernman00/shared-lib

包简介

Shared library for common functions and classes across projects

README 文档

README

CI/CD Pipeline PHP Version License Latest Version

A comprehensive PHP shared library containing common functions and classes for use across multiple projects.

Features

  • Authentication & Security: JWT handling, secure sessions, token management
  • Database Operations: PDO utilities, query builders, database helpers
  • Form Building: Bootstrap and Bulma form builders
  • File Management: Upload handling, image optimization, virus scanning
  • Email Services: PHPMailer integration, email templates
  • Validation & Sanitization: Input validation, data sanitization
  • Rate Limiting: Request throttling and rate limiting
  • Logging: Monolog integration for structured logging
  • Exception Handling: Custom exception classes

Installation

Install via Composer:

composer require waleolaogun/shared-lib

Requirements

  • PHP 8.1 or higher
  • Composer for dependency management

Usage

Basic Example

<?php

require_once 'vendor/autoload.php';

use Src\Auth;
use Src\Db;
use Src\Utility;

// Initialize database connection
$db = new Db();

// Use authentication
$auth = new Auth($db);

// Use utility functions
$sanitized = Utility::sanitizeInput($_POST['data']);

Available Classes

  • Src\Auth - Authentication and authorization
  • Src\Db - Database operations and utilities
  • Src\Email - Email sending capabilities
  • Src\FileUploader - File upload handling
  • Src\JwtHandler - JWT token management
  • Src\Limiter - Rate limiting functionality
  • Src\Utility - General utility functions
  • And many more...

Development

Setting Up Development Environment

  1. Clone the repository:

    git clone https://github.com/modernman00/shared-lib.git
    cd shared-lib
  2. Install dependencies:

    composer install
  3. Run code quality checks:

    # PHP CS Fixer
    vendor/bin/php-cs-fixer fix --dry-run --diff
    
    # PHPStan static analysis
    vendor/bin/phpstan analyse

Code Quality Standards

This project follows PSR-12 coding standards and uses:

  • PHP CS Fixer for code formatting
  • PHPStan for static analysis (Level 6)
  • Composer audit for security vulnerability scanning

CI/CD Pipeline

The project uses GitHub Actions for continuous integration and deployment:

  • Automated Testing: Runs on PHP 8.1, 8.2, and 8.3
  • Code Quality Checks: PHP CS Fixer and PHPStan analysis
  • Security Scanning: Dependency vulnerability checks
  • Automated Dependency Updates: Dependabot integration
  • Release Management: Automated release asset creation

Contributing

  1. Fork the repository
  2. Create a feature branch: git checkout -b feature/amazing-feature
  3. Make your changes and ensure they pass all quality checks
  4. Commit your changes: git commit -m 'Add amazing feature'
  5. Push to the branch: git push origin feature/amazing-feature
  6. Open a Pull Request

All pull requests are automatically tested against our CI pipeline.

Running Tests Locally

# Install development dependencies
composer install --dev

# Run PHP CS Fixer
vendor/bin/php-cs-fixer fix --dry-run --diff --verbose

# Run static analysis
vendor/bin/phpstan analyse --memory-limit=1G

# Check for security vulnerabilities
composer audit

Versioning

This project uses Semantic Versioning. For available versions, see the releases page.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Support

For support, please open an issue on the GitHub repository.

Changelog

For a detailed changelog, see RELEASES.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2025-07-28

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固