diff options
| author | nsfisis <nsfisis@gmail.com> | 2026-08-09 09:14:11 +0900 |
|---|---|---|
| committer | nsfisis <nsfisis@gmail.com> | 2026-08-09 09:14:11 +0900 |
| commit | 6643eb8b7d305818f80c910144b3b29b1af34ba7 (patch) | |
| tree | 3baee8b2291725add75e9963d7666890aae62760 /crates/shirabe-php-shim/src | |
| parent | be514aeff17ab7d8debcc59acddd07f7c7b72bd7 (diff) | |
| download | php-shirabe-6643eb8b7d305818f80c910144b3b29b1af34ba7.tar.gz php-shirabe-6643eb8b7d305818f80c910144b3b29b1af34ba7.tar.zst php-shirabe-6643eb8b7d305818f80c910144b3b29b1af34ba7.zip | |
refactor(installed-versions): drop the Rust port, which has no readers
InstalledVersions is a runtime API for plugins and project code; Composer
itself never reads it. Its consumers run in the PHP worker against the copy
FilesystemRepository dumps to vendor/composer/InstalledVersions.php, whose
static state is already kept in sync by __shirabe_installed_versions_reload.
Nothing in Rust read the mirrored statics, so reload() and the reflection
setters were no-ops.
The tests covered only the Rust port, not the PHP class the worker loads, so
they assert nothing about compatibility; they are left as todo!() skeletons.
This also removes the shim functions method_exists, php_dir and
require_php_file, whose only caller was the deleted module.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Diffstat (limited to 'crates/shirabe-php-shim/src')
| -rw-r--r-- | crates/shirabe-php-shim/src/runtime.rs | 25 |
1 files changed, 1 insertions, 24 deletions
diff --git a/crates/shirabe-php-shim/src/runtime.rs b/crates/shirabe-php-shim/src/runtime.rs index e24d6d69..2f8b79f1 100644 --- a/crates/shirabe-php-shim/src/runtime.rs +++ b/crates/shirabe-php-shim/src/runtime.rs @@ -66,18 +66,6 @@ pub fn defined(name: &str) -> bool { ) } -// Models methods available on Composer's own runtime classes when given a class name string. -// Shirabe is a native binary that does not run under a Composer-dumped autoloader, so the dumped -// `Composer\Autoload\ClassLoader` (and its `getRegisteredLoaders`) is absent from the running -// process; the class-name form therefore reports no such method. The object form needs runtime -// reflection that PhpMixed::Object does not carry. -pub fn method_exists(object_or_class: &PhpMixed, _method_name: &str) -> bool { - match object_or_class { - PhpMixed::String(_) => false, - _ => todo!(), - } -} - // Models the classes available in a standard PHP CLI environment running Composer: // the common bundled extensions (zip, Phar) plus Composer's own runtime classes. pub fn class_exists(name: &str) -> bool { @@ -351,23 +339,12 @@ pub fn usleep(_microseconds: u64) { } /// Equivalent to PHP's __DIR__ magic constant -pub fn php_dir() -> String { +pub fn dir() -> String { // TODO(php-runtime): __DIR__ is the directory of the source file at compile time; it must be supplied // per call site (e.g. via a macro), not from a runtime shim function. todo!() } -pub fn dir() -> String { - // TODO(php-runtime): see php_dir; __DIR__ is a per-source-file compile-time value. - todo!() -} - -/// Equivalent to PHP's `require <file>` returning the file's return value -pub fn require_php_file(_filename: &str) -> PhpMixed { - // TODO(php-runtime): `require` evaluates a PHP source file at runtime; there is no PHP interpreter. - todo!() -} - pub fn memory_get_usage() -> i64 { // TODO(phase-c): return PHP's actual emalloc-tracked memory usage instead of a stub 0. 0 |
