Skip to content

Conversation

@wudi
Copy link
Owner

@wudi wudi commented Dec 4, 2025

No description provided.

wudi added 30 commits December 4, 2025 10:08
- Added `lsp_server.rs` to handle LSP requests and responses.
- Implemented indexing of PHP symbols (classes, functions, methods, properties, etc.) using `DashMap`.
- Introduced `IndexingVisitor` and `DocumentSymbolVisitor` for traversing the AST and collecting symbols.
- Enhanced `Backend` struct to manage documents, symbol indexing, and diagnostics publishing.
- Integrated file indexing on server initialization using `WalkDir`.
- Added support for LSP features: document symbols, go to definition, references, hover, and completion.
- Updated `lib.rs` to include `line_index` module.
- Refactored `line_index.rs` for improved offset calculations.
- Modified parser to handle doc comments for classes and functions.
- Updated tests to cover new LSP features and ensure correct symbol indexing and retrieval.
- Created package.json for the PHP Parser RS LSP extension with necessary metadata and dependencies.
- Implemented extension.ts to activate the language client, configure server path, and handle server execution.
- Added tsconfig.json for TypeScript compilation settings.
…gVisitor and add goto implementation functionality
…or and add goto type definition functionality
- Added CallFrame struct to manage execution context.
- Introduced Stack struct for operand management.
- Defined OpCode enum for bytecode instructions including stack operations, arithmetic, variable handling, control flow, and object manipulation.
- Created initial VM module structure with engine, stack, opcode, and frame management.
- Implemented basic tests for arrays, classes, constructors, and inheritance to validate functionality.
- Established a comprehensive VM specification document outlining architecture, data structures, and implementation roadmap.
- Enhanced the VM to support passing variables by reference, including function parameters and array assignments.
- Introduced new opcodes: AssignRef, MakeVarRef, and AssignDimRef to manage reference assignments and dereferencing.
- Updated the VM's execution logic to handle references correctly during variable assignments, function calls, and returns.
- Added tests for various scenarios involving references, including basic reference assignments, foreach loops with references, and function calls with reference parameters.
- Improved error handling for invalid reference operations and ensured proper memory management for reference types.
- Added bitwise operations: AND, OR, XOR, NOT, left shift, and right shift.
- Introduced spaceship operator for comparison.
- Implemented logical operations: boolean NOT and XOR.
- Added assignment operations with support for various arithmetic and bitwise operations.
- Implemented increment and decrement operations (pre and post).
- Added type casting functionality for various types.
- Introduced new opcodes for array manipulation: unset dimension, check if key exists, and count elements.
- Implemented object manipulation opcodes: unset object properties, instance checking, and class retrieval.
- Added tests for new operations including bitwise operations, spaceship operator, ternary operator, increment/decrement, and type casting.
wudi added 30 commits December 23, 2025 12:42
- Added FastCGI protocol implementation in `fcgi` module.
- Created `Request` and `RequestBuilder` for handling FastCGI requests.
- Implemented FastCGI record reading and writing functions.
- Developed `FpmRequest` struct to map FastCGI parameters to PHP superglobals.
- Introduced `init_superglobals` function to populate PHP superglobals from FastCGI request data.
- Added integration tests for php-fpm FastCGI server, covering basic requests, GET parameters, PHP SAPI, headers, and concurrent requests.
- Made `insert_builtin_constant` public in `RequestContext` for external access.
…guration examples, documentation, and an updated integration test.
- Added new hash algorithms: RIPEMD (128, 160, 256, 320), Tiger (128, 160, 192), and XXHash (32, 64, 3, 128).
- Implemented HMAC support for multiple algorithms including MD5, SHA1, SHA2 variants, RIPEMD, Tiger, and Whirlpool.
- Introduced PBKDF2 and HKDF key derivation functions.
- Added hash_equals function for constant-time string comparison.
- Implemented hash_update_file and hash_update_stream functions for updating hash contexts with file and stream data.
- Created tests for HMAC, hash_equals, PBKDF2, and new hash algorithms to ensure correctness.
- Implemented Adler32, FNV-1, FNV-1a (32-bit and 64-bit), and Joaat hashing algorithms.
- Updated HashRegistry to register new algorithms.
- Added unit tests for new algorithms to ensure correctness.

refactor(tests): create comprehensive hash algorithms test suite

- Developed a test suite for various hash algorithms to validate output against expected values.
- Included tests for existing algorithms to ensure backward compatibility.
- Added  and  struct wrappers implementing  and .
- Implemented  function to support Tiger128/160 variants that require custom HMAC logic due to  crate limitations.
- Updated  to include  and .
- Updated  to list all supported algorithms including Tiger variants.
- Resolved method ambiguity in  macro and struct implementations.
- Moved code execution logic from individual test files into a common module.
- Updated tests in `static_lsb.rs`, `static_properties.rs`, `static_self_parent.rs`, `static_var.rs`, `stdlib.rs`, `string_functions.rs`, `switch_match.rs`, `variable_variable.rs`, and `yield_from.rs` to utilize the new common functions for running PHP code.
- Ensured all test cases are prefixed with `<?php` for proper PHP syntax.
- Improved readability and maintainability of test code by reducing duplication.
…le initialization

- Added support for setting a custom working directory in the PHP VM executor.
- Introduced global variable initialization after VM creation, ensuring proper memory allocation.
- Updated `ExecutionConfig` to include `working_dir` and `globals` fields.
- Enhanced test coverage with 15 new tests for global variables and working directory features.

feat(stderr): Complete stderr capture implementation

- Implemented independent capture of stderr alongside stdout in the PHP VM executor.
- Created `CapturingErrorHandler` for error reporting with formatted output.
- Updated executor to handle stderr extraction and ensure proper formatting.
- Added 5 new tests to validate stderr capture functionality.
…tput helper

- Introduce common::run_code_capture_output for consistent output capturing in tests
- Refactor test modules to use the new helper, removing duplicated output writer logic
- Simplify test code for property array initialization, eval, isset/empty, echo escapes, string interpolation, finally, and globals superglobal
- Minor improvements to test clarity and error assertions
- Updated all test files to replace direct instantiation of EngineContext with EngineBuilder.
- Ensured that core extensions are included in the engine setup for all tests.
- Improved consistency and maintainability of test setup code.
- Added comprehensive typed property validation to the Rust PHP VM, aligning with PHP 8.x behavior.
- Introduced new data structures for property entries and static property entries.
- Enhanced compilation process to emit property declarations with type hints.
- Implemented runtime validation and type coercion logic for scalar and complex types.
- Created extensive test cases for property type validation, including valid assignments, coercion scenarios, and error handling.
- Added examples demonstrating property type validation, including inheritance and static properties.
- Documented implementation details, type coercion rules, and future enhancements in PROPERTY_TYPE_VALIDATION.md.
- Introduced tests for strict types edge cases, including union types, nullable types, false and true types, mixed types, default parameters, multiple parameters, void return types, and complex coercion chains.
- Implemented tests for strict types evaluation, ensuring that eval() inherits strictness correctly and handles return type checking.
- Added tests for include/require behavior with strictness, verifying that included files maintain their own strictness modes and that strict callers enforce type checks on weak functions.
- Created parameter validation tests to check strict and weak mode behaviors for various types, including int, float, string, bool, and nullable types.
- Developed return validation tests to ensure correct handling of return types in both strict and weak modes, including coercion scenarios.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants