Skip to content

Latest commit

 

History

History
248 lines (191 loc) · 6.92 KB

File metadata and controls

248 lines (191 loc) · 6.92 KB

🚀 PivotPHP Cycle ORM v1.0.1 - Release Notes

Release Date: July 9, 2025 Version: 1.0.1 Type: Performance & Compatibility Update


📋 Overview

This release focuses on performance optimizations, cross-platform compatibility, and code quality improvements following the PivotPHP Core v1.1.0 upgrade. This is a maintenance release that maintains 100% backward compatibility while delivering significant performance improvements and better developer experience.

🎯 Key Highlights

🚀 Performance Boost

  • 7x faster environment detection with static caching
  • Reduced memory usage by eliminating redundant checks
  • Optimized test execution with clean PHPUnit configuration

🌐 Cross-Platform Support

  • Universal compatibility across Windows, macOS, and Linux
  • Platform-specific scripts for different environments
  • Resolved Windows CMD issues with environment variables

🔧 CI/CD Improvements

  • Clean exit codes for better CI/CD integration
  • Suppressed test noise for cleaner CI outputs
  • PHPUnit optimization for faster test execution

📊 Performance Improvements

Environment Detection Optimization

// Before: Multiple function calls, array recreations
// After: Single static cache lookup

// Benchmark Results:
// First call: 2.15 μs
// Cached calls: 0.30 μs
// Speed improvement: 7x faster

Memory Usage Optimization

  • Reduced object allocations in environment detection
  • Centralized caching eliminates duplicate data structures
  • Optimized PHPUnit configuration reduces memory overhead

🌐 Cross-Platform Compatibility

New Scripts Added

# Universal (works everywhere)
composer test-coverage

# Platform-specific alternatives
./scripts/test-coverage.sh      # Unix/Linux/macOS
scripts\test-coverage.bat       # Windows CMD
scripts\test-coverage.ps1       # PowerShell
php scripts/test-coverage.php   # PHP-based (universal)

Resolved Issues

  • Windows CMD compatibility with environment variables
  • PowerShell support for modern Windows development
  • Unix shell consistency across different shells
  • Cross-platform path handling in scripts

🔄 Major Updates

1. PivotPHP Core v1.1.0 Integration

  • Updated dependency from *@dev to ^1.1.0
  • Auto stress performance improvements inherited
  • Production-ready Packagist distribution
  • Removed local development dependencies

2. Environment Detection Refactoring

// Before: Duplicated logic in multiple places
$isTestingEnv = (
    (isset($_ENV['APP_ENV']) && $_ENV['APP_ENV'] === 'testing') ||
    (isset($_SERVER['APP_ENV']) && $_SERVER['APP_ENV'] === 'testing') ||
    defined('PHPUNIT_RUNNING')
);

// After: Centralized and cached
if (!EnvironmentHelper::isTesting()) {
    error_log('Query failed: ' . $query);
}

3. Caching System Implementation

// Centralized cache with type safety
private static array $cache = [];

public static function clearCache(): void
{
    self::$cache = [];
}

🧪 Testing Enhancements

PHPUnit Configuration Optimization

  • Removed unnecessary coverage from default test runs
  • Clean exit codes (0) for successful test runs
  • Suppressed test-specific logs in testing environment
  • Faster test execution without coverage overhead

Test Results

PHPUnit 10.5.47 by Sebastian Bergmann and contributors.
Runtime: PHP 8.4.8
Configuration: /home/.../phpunit.xml

................................................................. 65 / 67 ( 97%)
..                                                                67 / 67 (100%)

Time: 00:00.210, Memory: 16.00 MB
OK (67 tests, 242 assertions)
Exit code: 0  ✅

🔧 Bug Fixes

Fixed Issues

  • CI/CD Exit Codes: PHPUnit now returns proper exit code 0
  • Log Pollution: Suppressed test error logs in testing environment
  • PSR-12 Violations: Fixed all code style violations
  • Windows Compatibility: Resolved inline environment variable issues
  • PHPStan Compliance: Fixed type issues with centralized cache

Code Quality

  • 100% PSR-12 compliant with automatic fixes
  • PHPStan Level 8 with zero errors
  • 67 tests passing with 242 assertions
  • Clean codebase with removed duplicates

📚 Documentation Updates

Enhanced Documentation

  • Cross-platform instructions in README.md
  • Performance benchmarks documentation
  • CLAUDE.md improvements for better development workflow
  • API documentation consistency

New Documentation Files

  • RELEASE_NOTES_1.0.1.md - This document
  • scripts/benchmark-environment-helper.php - Performance demonstration
  • scripts/test-cache-clearing.php - Cache functionality testing

🔍 Technical Details

Compatibility

  • PHP: 8.1+ with full 8.4 compatibility
  • PivotPHP Core: v1.1.0+
  • Cycle ORM: v2.10+
  • Platforms: Windows, macOS, Linux
  • CI/CD: GitHub Actions, GitLab CI, Jenkins

Dependencies

{
  "require": {
    "php": "^8.1",
    "pivotphp/core": "^1.1.0",
    "cycle/orm": "^2.10"
  }
}

Standards Compliance

  • PSR-4: Autoloading standard
  • PSR-12: Coding style standard
  • Semantic Versioning: Version numbering
  • Keep a Changelog: Changelog format

🎯 Migration Guide

Upgrading from v1.0.0

# Update via Composer
composer update pivotphp/cycle-orm

# No breaking changes - fully backward compatible
# All existing APIs work exactly the same

New Features Available

// New cache management (optional)
EnvironmentHelper::clearCache();

// Performance benchmarking (development)
php scripts/benchmark-environment-helper.php

// Cross-platform coverage
composer test-coverage  # Works everywhere

🚀 What's Next

Future Improvements

  • Query builder enhancements
  • Advanced caching strategies
  • Additional database driver support
  • Enhanced monitoring capabilities

Community

📈 Performance Metrics

Before vs After

Metric v1.0.0 v1.0.1 Improvement
Environment Detection 2.15 μs 0.30 μs 7x faster
Test Execution Various Clean 0 CI-friendly
Memory Usage Higher Optimized Reduced
Cross-Platform Limited Full 100% compatible

🙏 Acknowledgments

This release was made possible by:

  • Community feedback on CI/CD integration
  • Performance optimization suggestions
  • Cross-platform compatibility requirements
  • Code quality improvements recommendations

📥 Download

Composer Installation:

composer require pivotphp/cycle-orm:^1.0.1

GitHub Release: https://github.com/PivotPHP/pivotphp-cycle-orm/releases/tag/v1.0.1

Packagist: https://packagist.org/packages/pivotphp/cycle-orm


Built with ❤️ by the PivotPHP Team