| Age | Commit message (Collapse) | Author |
|
Add a minimal shirabe-php-rpc crate that spawns the system PHP as a
child process and asks it for runtime information over a Unix domain
socket, then use it to fill the `--version` PHP line with the real
\PHP_VERSION and \PHP_BINARY instead of fixed placeholder values.
See docs/dev/php-rpc.md for the design and scope.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
|
Give DirectoryIteratorEntry a backing path (mirroring
RecursiveIteratorFileInfo) and make directory_iterator enumerate entries,
returning Result to match PHP DirectoryIterator's UnexpectedValueException
on an unopenable directory. Wire the new Result through DumpCompletionCommand's
get_supported_shells.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
|
The CurlDownloader owned a tokio runtime and block_on'd reqwest from its
sync tick(), while the repository/installer/downloader sync bridges each
created another Runtime and block_on'd async fns that reach that leaf.
Driving one Runtime::block_on from within another panics with "Cannot
start a runtime from within a runtime", hit by `require` when fetching
p2 metadata.
Switch CurlDownloader to a blocking reqwest client (its own internal
thread, never nested) and replace the per-call Runtime::new().block_on
bridges with a no-reactor sync_executor::block_on helper. No awaited
future parks on a reactor once the only async I/O is blocking, so the
helper can be nested freely.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
|
|
|
Replace the libcurl-shim CurlDownloader with a reqwest+tokio implementation per
the .ken sketch, resolving the construction panic that blocked command tests
(mock path via __new_mock is untouched). Port remote_filesystem (7), hg/svn
driver (4), zip_archiver/git_exclude_filter (4) tests. Fix hg/svn/git_exclude
regex-delimiter and svn result-propagation porting bugs.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
|
Port seld/jsonlint JsonParser (+hand-written Lexer), unblocking 10 json_file
parse-error tests verified byte-for-byte against PHP. Implement Symfony Finder
SplFileInfo, executable finders, String classes (byte/code-point/unicode),
ZipArchive shim (via the zip crate), SPDX license validation, and shim
date/stream functions. Genuinely-blocked sites (reflection, PHP runtime
constants, non-UTF-8 transcoding, recursive PCRE) stay todo!() with reasons.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
|
Replace the todo!() json_schema::Validator stub with the jsonschema crate.
Errors are surfaced as 'property : message'; the message wording follows the
jsonschema crate and is *not* justinrainbow-compatible.
Port the ComposerSchemaTest and JsonFileTest schema cases to the new wording
(noted per test).
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
|
Move MetadataMinifier and SpdxLicenses out of shirabe-external-packages
into dedicated shirabe-metadata-minifier and shirabe-spdx-licenses
crates, updating all import sites accordingly.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
|
Replace the hand-rolled `SERIAL` mutex guarding process-global env access
with serial_test's `#[serial]` attribute on each test.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
|
Support md5, sha1, sha256, and xxh3 algorithms.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
|
|
|
Back parse_url/parse_url_all with reqwest::Url and add the
FILTER_VALIDATE_URL and FILTER_VALIDATE_BOOLEAN arms to filter_var, so
Config::prohibit_url_by_config no longer hits todo!(). reqwest::Url is
not a byte-for-byte port of PHP's parser; the divergences are noted with
TODO(phase-c).
Switch the scheme in_array in prohibit_url_by_config to strict: the
needle is a string-or-null and the haystack holds only non-numeric
string literals, so loose and strict comparison are provably equivalent
here, avoiding a dependency on PHP loose `==` semantics.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
|
Replace the todo!() stubs with an inline port of symfony/finder's
searchInDirectory() pipeline, materializing entries as PathBuf in place
of SplFileInfo. Also port Glob::toRegex, needed for glob name patterns.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
|
|
|
|
|
PHP's random_int/random_bytes are cryptographically secure, but Composer
does not rely on that property, so a non-cryptographic PRNG suffices.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
|
Composer never feeds a pattern that fails to compile at runtime, so a
preg_*() failure is a programming error rather than a recoverable
condition. Replace the PcreException path with a panic.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
|
Replace todo!() stubs reached on the `composer --version` path so the
command runs without panicking and exits cleanly:
- introspection (function_exists, class_exists, extension_loaded,
defined) via white-lists modeling a standard Linux PHP CLI
- type casts: php_to_string/strval, php_truthy/boolval, substr,
byte_at, explode, strtr_array
- config/env: error_reporting, ini_get, date_default_timezone_*,
server_get/server_contains_key, php_uname("s")
- IO: turn PhpResource into an enum (Stdin/Stdout/Stderr/File) and
implement fwrite/fflush/stream_isatty/php_fopen resource helpers
- shutdown/exit: register_shutdown_function + run_shutdown_functions,
exit, error_get_last
- preg_match_all_offset_capture via the regex crate; the formatter
pattern drops PCRE possessive quantifiers (original kept in a
comment with a TODO)
proc_open reports unavailable for now (TODO(phase-c)); terminal-size
and tty detection fall back to defaults. sprintf calls on this path
are rewritten with format!(). OutputFormatterStyleInterface gains
clone_box to return shared styles.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
|
Introduce shim functions and constants, replacing the ad-hoc chrono
format strings and parse helpers used as phase-b placeholders.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
|
Change json_encode/json_encode_ex and JsonFile::encode/encode_with_options
to take a generic serde::Serialize value instead of &PhpMixed, implement
Serialize for PhpMixed/ArrayObject, and drop the PhpMixed::String wrapping
at JsonManipulator call sites in favor of passing raw values.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
|
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
|
|
|
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
|
|
|
- Replace RefCell with Mutex in Constraint for thread safety
- Add clone_box() to ConstraintInterface for cloning trait objects
- Propagate Result from Constraint::new() and unwrap at call sites
- Fix VersionParser instantiation (unit struct, not fn)
- Add indexmap dependency to shirabe-semver
|
|
- Remove duplicate function/constant definitions that were added during
porting (strpos, str_contains, str_starts_with, is_scalar, strlen,
substr, strtoupper, str_replace, sprintf, array_keys, str_ends_with,
is_int, array_values, is_object, is_numeric, PHP_EOL,
FILTER_VALIDATE_EMAIL, PHP_VERSION_ID)
- Replace old spl_autoload_register/unregister (PhpMixed args) with
typed Box<dyn Fn> versions
- Replace old array_pop/array_shift/array_unshift/array_splice with
generic/correctly-typed versions
- Replace old trim(chars: &str) with trim(chars: Option<&str>)
- Rename array_slice(PhpMixed) to array_slice_mixed to coexist with
the typed array_slice<V>(IndexMap<String, V>) version
- Fix chdir return type Result<()> -> anyhow::Result<()>
- Add anyhow dependency to shirabe-php-shim
|
|
|
|
Add zip crate dependency and ZipArchive stub to shirabe-php-shim.
Also add dirname and stream_get_contents shim functions.
|
|
|
|
|
|
|
|
|