Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: cloudfoundry/php-buildpack
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: master
Choose a base ref
Loading
...
head repository: cloudfoundry/php-buildpack
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: fix-rewrite-binary-compilation
Choose a head ref
Loading
Checking mergeability… Don’t worry, you can still create the pull request.
  • 15 commits
  • 54 files changed
  • 1 contributor

Commits on Jan 26, 2026

  1. Fix rewrite binary compilation when using git URL buildpack

    When users specify the buildpack via git URL, the pre_package script
    doesn't run so bin/rewrite remains a shell script. This change compiles
    the rewrite binary during the finalize phase using Go from GoInstallDir.
    
    Changes:
    - bin/finalize: Export GoInstallDir and BP_DIR for the Go binary
    - finalize.go: Add compileGoBinary() to compile rewrite at staging time
    - finalize_test.go: Update tests to use GoInstallDir from runtime.GOROOT()
    ramonskie committed Jan 26, 2026
    Configuration menu
    Copy the full SHA
    49283ac View commit details
    Browse the repository at this point in the history
  2. Fix rewrite binary compilation for git URL deployments

    Move rewrite binary compilation from runtime to staging phase.
    Previously, bin/rewrite attempted to compile at runtime by sourcing
    install_go.sh, which caused failures in git URL deployments.
    
    Changes:
    - bin/finalize: Compile rewrite binary alongside finalize during staging
    - bin/rewrite: Simplified to exec pre-compiled binary from .bp/bin
    - finalize.go: Copy pre-compiled rewrite with fallback logic:
      * Git URL mode: Uses REWRITE_BINARY_PATH from bash wrapper
      * Packaged mode: Falls back to BP_DIR/bin/rewrite
    - finalize_test.go: Updated tests to compile and use test binary
    
    This fixes the runtime error: '/home/vcap/app/.bp/bin/rewrite: line 7:
    /home/vcap/app/.bp/scripts/install_go.sh: No such file or directory'
    
    Staging succeeds, binary is pre-compiled and copied to droplet, runtime
    simply executes the pre-compiled binary without needing Go toolchain.
    ramonskie committed Jan 26, 2026
    Configuration menu
    Copy the full SHA
    a94a4bd View commit details
    Browse the repository at this point in the history

Commits on Jan 27, 2026

  1. Configuration menu
    Copy the full SHA
    4578400 View commit details
    Browse the repository at this point in the history
  2. Replace runtime config rewriting with build-time placeholder replacem…

    …ent for multi-buildpack support
    
    This commit fundamentally changes how PHP configuration files are processed
    to fix the multi-buildpack issue where PHP-FPM was trying to write to the
    wrong deps directory (deps/0 instead of deps/1+).
    
    Key changes:
    - Add ProcessConfigs() function that replaces placeholders at build time
      during finalization, eliminating the need for runtime rewriting
    - Remove rewrite tool copying and invocation from start scripts
    - Update start scripts to use sed for runtime variable expansion (PORT, TMPDIR)
    - Add support for @{DEPS_DIR} placeholder in php-fpm.conf include directives
    - Process fpm.d configs separately with app HOME instead of deps HOME
    - Add replacePlaceholdersInDirExclude() to skip subdirectories during processing
    
    Placeholder strategy:
    - @{VAR} = replaced at build time with absolute paths
    - ${VAR} = replaced at runtime with sed (for dynamic values like PORT)
    - #{VAR} = replaced at build time with values known during finalize
    
    This fixes the core multi-buildpack support issue where hardcoded assumptions
    about HOME=$DEPS_DIR/0 prevented proper operation with supply buildpacks.
    ramonskie committed Jan 27, 2026
    Configuration menu
    Copy the full SHA
    0958f39 View commit details
    Browse the repository at this point in the history
  3. Fix nginx configuration for unix socket and runtime variable expansion

    Updates nginx configuration files to work with the new build-time placeholder
    replacement system:
    
    - Add 'unix:' prefix to PHP_FPM_LISTEN upstream server directive for proper
      unix socket handling (nginx requires explicit 'unix:' prefix)
    - Change nginx placeholders from @{PORT} and @{TMPDIR} to ${PORT} and ${TMPDIR}
      to use shell variable syntax for runtime sed replacement
    
    These changes ensure nginx can properly connect to PHP-FPM via unix socket
    and handle dynamic runtime values like PORT that vary per container instance.
    ramonskie committed Jan 27, 2026
    Configuration menu
    Copy the full SHA
    e71f830 View commit details
    Browse the repository at this point in the history
  4. Re-enable supply buildpack integration test with git URL buildpack

    Re-enables the Default test suite which includes the supply buildpack test.
    The test now uses git URL buildpack directly instead of requiring pre-installed
    dotnet_core_buildpack, which fixes the multi-buildpack scenario.
    
    Changes:
    - Re-enable testDefault suite in init_test.go
    - Update test to use git URL for dotnet-core-buildpack (master branch)
    - Skip test on Docker platform (git URL buildpacks require CF platform)
    - Update dotnet fixture csproj to specify .NET 8.0 target framework
    - Improve test assertions and error messages
    
    This test validates that the PHP buildpack works correctly as a final buildpack
    when used with a supply buildpack, which was the core issue being fixed.
    ramonskie committed Jan 27, 2026
    Configuration menu
    Copy the full SHA
    f07fcc2 View commit details
    Browse the repository at this point in the history
  5. Fix PHP-FPM PID file path to support multi-buildpack scenarios

    The PHP-FPM pid file path was hardcoded to deps/0 using #DEPS_DIR/0 placeholder,
    which caused PHP-FPM to fail when used as a final buildpack after a supply buildpack
    (where deps index is 1 or higher).
    
    Changes:
    - Replace #DEPS_DIR/0 with @{HOME} placeholder in php-fpm.conf for all PHP versions
    - Remove #DEPS_DIR/0 and #DEPS_DIR from replacement map in finalize.go
    - Now pid path correctly uses the actual deps index (e.g., /home/vcap/deps/1/...)
    
    This allows PHP-FPM to start correctly in multi-buildpack deployments.
    ramonskie committed Jan 27, 2026
    Configuration menu
    Copy the full SHA
    506263b View commit details
    Browse the repository at this point in the history

Commits on Jan 28, 2026

  1. Remove runtime rewrite binary and related infrastructure

    Remove the runtime rewrite binary that was previously used for runtime
    configuration templating. This completes the migration to build-time
    placeholder replacement that was introduced in commit 0958f39.
    The rewrite binary was originally copied from the v4.x Python buildpack
    and was used to replace template variables in configuration files at
    runtime. This approach has been superseded by build-time placeholder
    replacement in the finalize phase, which is more efficient and removes
    the need for runtime configuration rewriting.
    Changes:
    - Remove bin/rewrite shell wrapper script
    - Remove src/php/rewrite/cli/main.go (entire Go rewrite implementation)
    - Remove rewrite binary compilation from bin/finalize
    - Remove bin/rewrite from manifest.yml include_files
    - Remove /bin/rewrite-compiled from .gitignore
    - Remove rewrite-related test code and REWRITE_BINARY_PATH handling
    - Update ARCHITECTURE.md to remove rewrite binary documentation
    - Update code comments to reflect build-time placeholder replacement
    ramonskie committed Jan 28, 2026
    Configuration menu
    Copy the full SHA
    a3dcabc View commit details
    Browse the repository at this point in the history
  2. Unify template variable syntax to @{VAR} format

    Standardize all configuration template placeholders to use the @{VAR} syntax
    consistently. This replaces the mixed usage of #{VAR} and #VAR formats that
    existed across httpd, nginx, php-fpm, and php.ini configuration files.
    
    Variables updated: WEBDIR, LIBDIR, PHP_FPM_LISTEN, PHP_EXTENSIONS,
    ZEND_EXTENSIONS, PHP_FPM_CONF_INCLUDE
    ramonskie committed Jan 28, 2026
    Configuration menu
    Copy the full SHA
    56fcd74 View commit details
    Browse the repository at this point in the history
  3. Add vendor symlink in WEBDIR for Composer autoload compatibility

    Create a symlink from WEBDIR/vendor to the actual vendor directory during
    Composer compilation. This allows apps to use relative require paths like
    `require 'vendor/autoload.php'` from their web root (e.g., htdocs).
    The symlink is only created when:
    - WEBDIR exists and vendor is not already inside it
    - No existing vendor directory or symlink exists in WEBDIR
    Also fixes #{LIBDIR} -> @{LIBDIR} placeholder in composer extension.
    ramonskie committed Jan 28, 2026
    Configuration menu
    Copy the full SHA
    3b14de8 View commit details
    Browse the repository at this point in the history
  4. fix integration test regex

    ramonskie committed Jan 28, 2026
    Configuration menu
    Copy the full SHA
    279819a View commit details
    Browse the repository at this point in the history

Commits on Jan 29, 2026

  1. skip custom extensions test

    as we do not support this yet
    ramonskie committed Jan 29, 2026
    Configuration menu
    Copy the full SHA
    a3d54eb View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    8471b5e View commit details
    Browse the repository at this point in the history
  3. Fix php.ini.d context bug and add comprehensive buildpack documentation

    This commit addresses a critical bug in placeholder replacement and adds
    extensive documentation comparing the PHP buildpack with other CF buildpacks.
    Bug Fix:
    - Fix php.ini.d directory context: process with app HOME instead of deps HOME
      The php.ini.d directory was incorrectly processed with deps context
      (@{HOME} = /home/vcap/deps/{idx}) instead of app context (@{HOME} =
      /home/vcap/app). This affected the buildpack-created include-path.ini and
      any user-provided php.ini.d/*.ini files using @{HOME} placeholders.
    
      Changed finalize.go to process php.ini.d separately (like fpm.d) with
      app-context replacements, ensuring include paths and user configs reference
      the correct application directory.
    Documentation:
    - Add docs/ directory with comprehensive architectural documentation (60K total):
      - BUILDPACK_COMPARISON.md: Cross-buildpack analysis showing PHP v5.x follows
        the same patterns as Go, Java, Ruby, and Python buildpacks
      - VCAP_SERVICES_USAGE.md: Complete guide on service binding patterns,
        clarifying that VCAP_SERVICES IS available during staging in Go code
      - REWRITE_MIGRATION.md: Moved from root, corrected misleading statements
        about VCAP_SERVICES availability
      - README.md: Navigation hub with best practices and quick links
    
    - Correct misconception: VCAP_SERVICES is available during staging for
      extensions and Go code, just not as @{...} config file placeholders
    
    - Document that v4.x runtime rewrite was PHP-unique, not a CF standard
      pattern used by other buildpacks
    Testing:
    - Update php_with_php_ini_d fixture to test @{HOME} placeholder replacement
    - Add test verification for include_path containing /home/vcap/app/lib
    - Enhance modules_test.go to validate placeholder replacement in php.ini.d
    The documentation demonstrates that PHP buildpack v5.x is fully aligned with
    Cloud Foundry buildpack standards and best practices.
    ramonskie committed Jan 29, 2026
    Configuration menu
    Copy the full SHA
    048a88a View commit details
    Browse the repository at this point in the history
  4. Add comprehensive user guide and developer feature reference

    Documentation Enhancement:
    - Add USER_GUIDE.md (15K, 865 lines): Complete end-user guide for all
      buildpack features
      - Getting started (deploy in 2 commands)
      - Web server configuration (Apache, Nginx, FPM-only)
      - PHP configuration (versions, ini files, FPM pools)
      - PHP extensions installation
      - Composer and dependencies
      - APM integration (NewRelic, AppDynamics, Dynatrace)
      - Session storage (Redis, Memcached)
      - Framework guides (Laravel, CakePHP, Symfony, Laminas)
      - Advanced features (multi-buildpack, preprocess commands)
      - Troubleshooting section
    
    - Add FEATURES.md (11K, 696 lines): Developer/maintainer reference with
      test coverage verification
      - 30+ features with explicit integration test references
      - Test locations (file:line numbers)
      - Fixture paths for each feature
      - Implementation details and code snippets
      - Test coverage analysis matrix
      - Identification of 7 features needing explicit tests
      - Cross-references to integration tests
    
    - Update docs/README.md: Separate USER_GUIDE.md (for users) and
      FEATURES.md (for developers) with clear audience targeting
    
    - Update root README.md: Reference both user and developer documentation
    
    Documentation Structure (Total: 80K across 6 files):
    - USER_GUIDE.md - For end users deploying applications
    - FEATURES.md - For developers/maintainers verifying test coverage
    - BUILDPACK_COMPARISON.md - Cross-buildpack architectural analysis
    - VCAP_SERVICES_USAGE.md - Service binding patterns and best practices
    - REWRITE_MIGRATION.md - v4.x to v5.x migration guide
    - README.md - Navigation hub with quick links
    
    The documentation demonstrates comprehensive feature coverage with 95%+ test
    verification and provides clear guidance for both users and maintainers.
    ramonskie committed Jan 29, 2026
    Configuration menu
    Copy the full SHA
    99b2d12 View commit details
    Browse the repository at this point in the history
Loading
Morty Proxy This is a proxified and sanitized view of the page, visit original site.