- Add phpstan assertions for better type safety in AstNodeType and CallArgumentGenerator
- Replace null check with direct condition in ClassFieldSelection to streamline validation
- Remove unused FunctionLike import and add GlobalConstantDef import in CompilerBase
- Convert CompilerBase to abstract class with abstract methods for better structure
- Update constants array type hint from ConstantDef to GlobalConstantDef
- Replace class inheritance tracking with SymbolRepository for compiler symbols
- Change isScalarInt parameter type from Expr to Node and update return type
- Update getFunctionName parameter type to specific node types instead of FunctionLike
- Refactor parseScalar method to use instanceof checks instead of getType() switch
- Replace string comparison with instanceof check in getComment method
- Change parseNumericIdentifier condition to use instanceof instead of getType()
- Fix argument count comparison in function call validation logic
- Use getRawArgs() method for accessing call arguments in
- Replace sapiEntryFile with separate configured path and value properties
- Add sapiEntryConfiguredPath and sapiEntryConfiguredValue for deferred validation
- Move entry file existence checks to final SAPI selection phase
- Add warning when entry is ignored due to non-CLI SAPI configuration
- Update test cases to verify entry file handling behavior
- Remove redundant entry file addition in translator pipeline
- Refactor entry configuration to support CLI SAPI requirement validation
- Add --entry option to specify PHP entry file for CLI SAPI execution
- Make --php-builder option optional with default empty configuration {}
- Update documentation to reflect new --entry and optional --php-builder options
- Add CompilerToolchain class to manage C/C++ compiler and archiver tools
- Implement response file support for long object lists in archiving operations
- Add progress tracking and detailed build stage reporting for PHP compilation
- Support MSVC, GCC and Clang compiler toolchains with proper companion tools
- Add test cases for new entry point and toolchain functionality
- Adjust build pipeline to exclude entry file from source compilation
- Improve build logging and error handling during compilation processes
- Register shutdown function to clear reflection resolver caches in embed SAPI
- Add test to verify library builds exclude executable process title sources
- Remove embed-specific request cache clearing from module shutdown
- Add tests for embed binary module ordering behavior
- Implement temporary module storage switching for interned strings
- Add pre-shutdown functions for AST constant cleanup in embed mode
- Update platform detection to search multiple library directories
- Add test case for finding embed libraries outside standard lib dir
- Modify module initialization to handle persistent/temporary module types correctly
- Implement configureProxyEnvironment function to export CLI proxy for child processes
- Add --sapi option supporting embed, cli, fpm targets with comma-separated lists
- Introduce --php-builder option for building PHP from source with extensions and ZTS
- Update documentation for new SAPI and PHP builder configuration options
- Add PeclExtensionSource class for managing PECL extension downloads
- Modify build configuration to support PHP builder and multiple SAPI targets
- Update compiler base with new build mode validation and SAPI handling
- Enhance native build configuration with PHP builder specific library paths
- Add comprehensive test coverage for new SAPI and PHP builder features
- Implement --proxy <url> CLI option for configuring HTTP(S) or SOCKS proxy
- Add proxy handling in argument parsing with proper validation
- Update documentation in COMPILER_CLI.md, README.md, and README-CN.md
- Enhance Downloader class to support proxy configuration for curl commands
- Add stream context options for HTTP proxy with authentication support
- Include proxy error message sanitization to hide sensitive information
- Add unit tests for proxy functionality covering curl and stream scenarios
- Update bash completion script to include new --proxy option
- Validate proxy URL requirements with appropriate error messages
- Add BUILD_MODE_SAPI constant and related methods for SAPI-specific builds
- Introduce sapiTargets, sapiEntryFile, and other SAPI-related configuration options
- Enhance Android platform with allowTargetVersion parameter in buildPhpIncludePaths
- Reorganize imports in CompilerBase with better grouping and ordering
- Add isSapiBuild() and getSapiTargets() methods for SAPI detection and management
- Update build mode logic to include SAPI in embed builds
- Refine expression type checking with shorter namespace references
- Add comprehensive SAPI build tests including target configuration scenarios
- Improve class property access in tests with parent class traversal support
- Standardize namespace separator handling in various compiler operations
- Add proper escaping and formatting in generated C++ code strings
- Implement SAPI-specific project parsing and validation rules
- Update test assertions to handle new namespace separator format
- Add error handling improvements for unsupported source conditions
- Enhance type checker generator
* fix(compiler): apply unary plus numeric conversion
* fix(compiler): infer unary plus assignments from target type
* fix(compiler): retain unary plus inference for fresh locals
* fix(compiler): resolve existing unary assignment locals by compiled name
Composer path repositories install a package as a symlink, so a source
directory reached through one contributed no files at all: PHP's
RecursiveDirectoryIterator does not descend into symlinked directories
unless asked, because RecursiveIteratorIterator calls hasChildren() and
its $allowLinks argument defaults to false.
The build still reported success, and the missing classes only surfaced
at runtime as `class 'X' is undefined`.
Scan with FilesystemIterator::FOLLOW_SYMLINKS. A linked directory is an
ordinary source entry with no setting of its own; what is compiled stays
with `sources` and `ignore`.
Exclusions match the path that reached a file, the one the project wrote
and the scanner traversed. An `ignore` entry is no longer resolved to its
link target, which compared a real path against a linked one and so never
matched.
Real paths are kept for identity alone. A link is refused when it closes
the branch that reached it, so a link to one of its own ancestors cannot
recurse; files reachable through several links are reduced to one path
after exclusions have run, since deduplicating before that would drop an
allowed alias along with an excluded one.
* fix(installer): keep the embed build inside its own prefix
The libphp.so installer reuses the configure options of the PHP already on
the machine so the private build matches it feature for feature. A
distribution build records where *it* installs, though, and those paths are
absolute. On Debian and Ubuntu the options carry --mandir=/usr/share/man,
--includedir=/usr/include, --libdir, --libexecdir, --sysconfdir and
--localstatedir. Inherited unchanged, they survive the --prefix rewrite, and
`make install` tries to write into system directories:
Installing PHP CLI man page: /usr/share/man/man1/
cp: cannot create regular file '/usr/share/man/man1/#INST@3023727#': Permission denied
make: *** [Makefile:265: install-cli] Error 1
Fatal error: Unable to install libphp.so: Command failed: make install
So the build only completed for root, or inside a container where the user
owns /usr. Everyone else got a PHP compiled from scratch and then thrown
away at the last step.
Two further options escape the same way. --program-suffix=8.3 installs the
binaries as php8.3 and php-config8.3, but LibPhpInstaller::installedVersion(),
writePhpIni() and UnixPlatform::findPhpConfig() all look for the plain names,
so a build that got past `make install` still looked like it had produced
nothing. --cache-file points at the distribution's build directory
(/tmp/buildd/nonexistent/config.cache), a path that does not exist here and
whose answers were recorded for a different prefix.
Drop all of them. Autoconf derives every installation directory from --prefix
when it is absent, so the private build lands entirely under the requested
prefix: bin/php, lib/libphp.so, include/php and share/man/man1. Options that
name a *dependency* rather than a destination, such as --with-zlib=/usr and
--with-layout=GNU, are untouched; the built PHP still matches the one it was
derived from.
* fix(installer): offer an existing build before asking to make one
Running a build twice asked four questions to arrive at the answer it
already had:
The current PHP installation does not provide libphp.so: /usr
Build a private PHP embed library now? [Y/n]
PHP version [8.5.10]:
Install directory [/home/alganet/.typephp]:
PHP 8.5.10 with libphp.so already exists in /home/alganet/.typephp; use it? [Y/n]
The reuse check sat at the bottom because it needs a version and a
directory, and those were read from the prompts. But both have defaults
that are known without asking anyone: the directory this installer always
proposes, and the PHP that is running it. That is the case being answered
here, so it can be offered first.
Ask it up front. Accepting now ends the exchange at one question, and the
`--prefix` rewrite no longer has to be reasoned about at all. The later
check stays for a directory or version typed by hand, and is skipped when
the answers repeat the defaults, so the same question is never asked twice.
ensure() also fetched the release list from php.net before looking for an
existing build, so the reuse path made a network round trip to learn the
URL of an archive it was not going to download. Move the fetch next to the
install that needs it.
Nothing recorded PHP_HOME anywhere but this process, and that has not
changed: a fresh run still has to rediscover the build. Being asked once
instead of four times is the part that is worth fixing separately.
- Add project-release.yml with embedded vendor files for standalone builds
- Implement YAML include mechanism in ProjectYamlLoader with circular reference detection
- Support single file or list of files in include directive with ordered merging
- Add recursive map merging and list replacement for included configurations
- Create CompilerProjectConfigurationTest to verify release compiler embedding
- Add ProjectYamlLoaderTest with comprehensive include scenarios
- Update GitHub workflows to build standalone compiler using project-release.yml
- Document include feature usage in README files with examples
- Remove embedded-files from development project.yml to reduce initialization cost
- Add validation for absolute paths and proper error handling for missing files
- Add version field to expose extension version through Zend module entry
- Add info mapping to accept arbitrary labels and scalar values for phpinfo()
- Generate PHP_MINFO_FUNCTION to display custom extension information
- Preserve info mapping order in module's phpinfo() section
- Validate version as non-empty string without NUL bytes
- Validate info as mapping of non-empty string labels to scalar values
- Add comprehensive tests for metadata parsing and generation
- Update documentation with extension metadata configuration examples
- Add testGccOnWindowsUsesGccIncludeSyntaxForAllSourceTypes method to verify include path formatting
- Test include paths with GCC compiler on Windows for C, C++, and assembler files
- Verify that GCC uses -I flag syntax instead of /I for all source types on Windows
- Confirm proper escaping of include paths with spaces using escapeshellarg
- Add formatIncludePaths method to handle include flag formatting consistently across platforms
- Add referencedClasses array to store fully resolved class names
- Implement recordReferencedClass method to track class references
- Enhance function call parsing with static function resolution
- Add native function lookup and return type detection
- Insert type conversion for runtime call results
- Resolve extension dependencies based on internal functions and classes
- Append extension requirements to generated module header
- Update tests to validate extension dependency detection
- Add test case for runtime builtin int property assignment
- Modify polymorphic class dispatch to restore string representation
- Removed strtotime from the list of functions that use direct PHPX wrappers
- Updated test case to verify only supported datetime calls use direct wrappers
- Modified strtotime test to include absolute, relative, epoch 0 and invalid dates
- Added timezone setting and additional test cases for relative date handling
- Updated expected test output to reflect new strtotime behavior
- Adjusted assertions to check for correct persistent function calls
- Added assertion to check opcodeBuildChecked property is false
- Used reflection to access parent class properties when needed
- Removed anonymousOpcode configuration from build parameters
- Ensured proper state verification for compiler fingerprint tests
- Renamed typephp_get_method_call_cache to get_method_call_cache
- Renamed typephp_get_function_call_cache to get_function_call_cache
- Renamed typephp_get_function_resolution_cache to get_function_resolution_cache
- Updated all references in compiler base and translator classes
- Modified renderDataDeclarations to accept includeGlobals parameter
- Added renderGlobalDeclarationsForSource to handle per-source global declarations
- Updated extension generation to use new naming convention
- Adjusted test assertions to match new function names
- Support single array parameter initialization for std::array, std::vector, std::map,
std::orderedMap, std::list, and std::dict
- Implement type inference from array initializer expressions with exact type matching
- Add rectangular shape validation for std::array initializers
- Generate appropriate C++ code for value initializers using lambda expressions
- Update documentation to reflect new value initializer capabilities
- Add comprehensive tests for valid and invalid initializer scenarios
- Defer StdFunc/StdArgInfo implementation as documented in design records
- Introduce StdVector, StdMap, and StdOrderedMap parameter attributes
- Add explicit std-container contract to ArgInfo entity
- Implement parameter validation and type checking logic
- Add error handling for invalid container parameter usage
- Support container parameter contracts in function signatures
- Generate automatic type conversion at function entry points
- Add compilation tests for std container parameter contracts
- Update documentation with container parameter rules and examples
- Implement compatibility checks between child and parent classes
- Add support for container parameters in trait methods and inheritance
- Add constant initialization code separation with before/after statement handling
- Implement constant finalization logic to prevent metadata replacement during re-parsing
- Create scoped initialization blocks using do-while constructs for temporary variables
- Add codegenFinalized flag to track constant processing state
- Introduce new test case for global nested array constants initialization
- Add incremental declaration test for constant initializer preservation
- Move constant value parsing to dedicated finalizeGlobalConstantValue method
- Update translator to handle scoped constant initialization code generation
- Add getDeclarationInputFiles method to include stub files in header generation
- Modify incremental compilation to process stub files alongside regular PHP files
- Update build state tracking to handle stub files differently (no translation units)
- Add test coverage for stub declaration generation and dependency invalidation
- Implement MSVC /bigobj flag for large object format support in generated commands
- Generate wrapper callbacks for stub functions and methods bridging to native implementations
- Update source pipeline to handle native/import stub metadata in module entry
- Modify declaration header generation to include stub callback registrations
- Add comprehensive test suite for stub functionality