| Age | Commit message (Collapse) | Author |
|
Port php_version_compare (canonicalization + special-form ordering) and
expose it via version_compare()/version_compare_2(). Implement clone()
(via Clone), spl_object_hash()/spl_object_hash_process() (address-based),
get_loaded_extensions() and the main-version case of phpversion().
Interpreter/reflection/autoload/eval/$GLOBALS/memory-accounting and
Windows-only SAPI helpers remain TODO(phase-d): they have no equivalent
in the compiled shim.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
|
Implement the bulk of string.rs shims:
- sprintf() with flags/width/precision/positional args for the common
conversions (s/d/u/b/o/x/X/c/f/F)
- pack()/unpack() for the C/c/n/v/N/V (+ s/S/i/I unpack) format codes
- base64_encode()/base64_decode() (non-strict)
- substr_replace, str_bitand, chr, hexdec, stripcslashes, addcslashes,
number_format (round-half-away-from-zero), uniqid, strip_tags,
html_entity_decode, iconv (UTF-8/ASCII identity)
%e/%E/%g/%G, wordwrap, sscanf, php_strip_whitespace and non-UTF-8 iconv
remain TODO(phase-d) (exact float-exponent/tokenizer/encoding-table
behavior not yet ported). Divergences in ported functions are noted with
TODO(phase-d) comments.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
|
Run exec()/shell_exec()/system() through /bin/sh -c with PHP-faithful
line handling and return values. Port escapeshellcmd() (Unix branch,
including paired-quote handling) and escapeshellarg(). Implement
posix_isatty() via std::io::IsTerminal.
uid/signal/process-title helpers and proc_open-dependent status calls
remain TODO(phase-d): they need a libc/syscall crate or the deferred
process/signal subsystems.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
|
Implement var.rs shims: serialize() (scalars/arrays with canonical
integer-key normalization), var_export()/var_export_str() (PHP-faithful
indentation and quoting), to_array() ((array) cast semantics),
get_debug_type() and is_iterable() for the scalar/array cases.
Reflection-dependent helpers (is_a, is_callable, get_class, instance_of,
etc.) and object variants remain TODO(phase-d) as they need runtime
class information PhpMixed does not carry.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
|
These slice/map wrappers mirrored PHP's internal array pointer and
have no clean Rust equivalent. Remove them and replace the lone
caller with direct first-element access; the rest were unused imports.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
|
PHP's internal array pointer (current/key/end) has no clean Rust
equivalent. Remove these todo!() shim stubs and replace each call
site with direct first/last element access matching Composer's
original behavior. Unblocks Config::merge of anonymous {name: false}
disable entries, re-enabling test_add_packagist_repository.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
|
Implement array_unique, array_splice, array_merge_recursive, krsort,
ksort, asort, sort_with_flags and sort_natural_flag_case, plus the
strnatcmp/strnatcasecmp port they rely on. Drop array_key_last and
array_splice_mixed in favour of existing helpers at the call sites.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
|
|
|
Drop the get_as_float parameter; the Rust shim always returns f64.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
|
Support md5, sha1, sha256, and xxh3 algorithms.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
|
|
|
ArrayObject was only a thin wrapper around IndexMap<String, PhpMixed>
used as an empty-{} vs empty-[] marker and as the assoc=false JSON
object representation; no reference semantics were involved. Inline its
payload directly into PhpMixed::Object and drop the type along with the
now-dead StdClass.
Side effects of the unification:
- ArrayObject::new was todo!(); the config --global / object-typed get
paths that built PhpMixed::Object(ArrayObject::new(None)) no longer
panic.
- base_config_command wrote 'config' as PhpMixed::Array(empty), emitting
[] instead of {}; now matches PHP's new \ArrayObject ({}).
- The dead is::<StdClass>()/is::<ArrayObject>() instanceof checks in
JsonManipulator are replaced with the faithful as_object() mapping.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
|
|
|
Replace the todo!() bodies of filter_var_email, filter_var_ip, and
filter_var_int_with_range with working validators. Like filter_var_url
these are pragmatic rather than byte-for-byte compatible with PHP's
hand-written filters; the divergences are noted in comments.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
|
Replace the dispatch-on-constant filter_var() and filter_var_with_options()
with dedicated filter_var_boolean/url/email/ip and filter_var_int_with_range,
dropping the FILTER_VALIDATE_* constants and updating all call sites.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
|
apcu_fetch/apcu_add only ran when apcuPrefix was non-null, but
Composer never calls setApcuPrefix on the loaders it instantiates
itself; the prefix is only emitted into the generated target-project
autoload_real.php. So the cache branches were unreachable in Shirabe's
execution paths. Remove the apcu shim and the now-dead lookups.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
|
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
|
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
|
json_encode/json_encode_ex now return anyhow::Result<String> instead of
Option, so callers no longer need json_last_error() to get the failure
reason.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
|
|
|
The per-file stub!/encode_stub!/etc. macros generated #[ignore]d test
functions but obscured the individual test bodies. Expanding them inline
removes the macro indirection so future ports can fill in each function
directly.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
|
Fill in the shim functions that have an easy, accurate pure-Rust port:
array (merge/flip/fill_keys/slice/search/is_list), string (substr_count,
strpbrk, raw/urlencode, ucfirst/ucwords, strstr, strcspn, explode limit,
str_replace arrays), mb_* (strlen/substr/str_split), sort callbacks
(uasort/uasort_map/uksort), levenshtein, intdiv, ceil, ctype_digit,
json_encode, count_mixed and the PhpMixed/to_* boolean casts.
Runtime- or crate-dependent and hard-to-port-accurately stubs (sprintf,
version_compare, natural sort, hashing, etc.) are left as todo!().
|
|
Port PHP setUp/tearDown across the ported integration tests using
same-named set_up()/tear_down() functions and a TearDown struct whose
Drop runs tear_down(). Fixture-init setUp returns its fixtures;
tmpdir-style setUp/tearDown carry state in TearDown fields. Parts that
depend on unported infrastructure (PHPUnit mocks, Config::merge, the PHP
error handler) stay todo!() and are only wired into ignored stubs to
avoid breaking live tests.
Also fix shirabe-php-shim putenv to handle the no-'=' form (PHP unsets
the variable), which Platform::clear_env relies on for the env-clearing
tearDowns.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
|
All ignored: Composer/Filesystem/Platform/Vcs repositories and the
AuthHelper/Bitbucket/Git/Perforce/RemoteFilesystem/Svn utils mock
IO/Config/HttpDownloader(curl)/ProcessExecutor or use reflection;
Filesystem/ProcessExecutor/StreamContextFactory/ProxyManager need on-disk
fixtures or proxy env. setUp/tearDown not ported.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
|
All ignored: ArrayLoader/ValidatingArrayLoader/VersionSelector parse
constraints via a look-around regex; ArchiveManager uses PharData (todo!());
ArchivableFilesFinder/VersionGuesser/Locker mock git/process/IO; the plugin API
is not implemented (TODO(plugin)). Wires up the plugin test target.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
|
All ignored: these mock IO/HttpDownloader (curl)/ProcessExecutor/installers,
use ZipArchive/JsonManipulator todo!()s, need Symfony console or schema
validation, reflect into ClassLoader, or run end-to-end install/functional
fixtures. Wires up the event_dispatcher test target.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
|
All ignored: Auditor mocks HttpDownloader and parses constraints (look-around
regex); JsonConfigSource uses JsonManipulator (addcslashes todo!()); the
AutoloadGenerator cases are fixture/mocked-installer integration. Wires up the
config test target.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
|
DefaultPolicy/PoolBuilder/PoolOptimizer/Solver as stubs
All ignored: they build Pools/run the Solver over packages whose constraint
parsing uses a look-around regex the regex crate cannot compile, with
fixture-heavy setup. setUp/tearDown not ported.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
|
testAddPackagistRepository is fully modelled but Config::merge of an anonymous
{name: false} disable entry reaches current() (todo!()), so it is ignored; the
remaining env-dependent / plugin-config cases are stubbed.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
|
JsonManipulator's text-rewriting operations reach addcslashes (todo!()) in the
php-shim, so all 50 cases are stubbed.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
|
Parse-error cases are modelled but JsonFile::parse_json's error path reaches
json_last_error (todo!()), so they are ignored; the encode/schema/merge-conflict/
indentation cases are stubbed (encode flag mapping, validateSchema, large
fixtures). setUp/tearDown not ported.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
|
requiredInformation/rootPackage/dumpAbandoned(+replacement) pass; testKeys
drives ~25 dynamic set<Property> calls over heterogeneous types and is stubbed.
Wires up the package/dumper test submodule.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
|
Adds Base/Bump/Config/DumpAutoload/Fund/Global/Init/Install/Licenses/Remove/
Repository/Require/RunScript/Show/Suggests/Update command tests. All ignored:
they need the ApplicationTester/initTempComposer harness (Init also reflects
into protected helpers). setUp/tearDown not ported.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
|
(Git/GitHub/GitLab/Bitbucket/Svn/Perforce/Forgejo)
Svn/GitBitbucket/Perforce supports pass. GitHub::supports reaches non-strict
in_array (todo!()) and Forgejo::supports uses a regex the regex crate cannot
compile, so those are ignored. All API-driven cases mock the HttpDownloader
(curl) / ProcessExecutor and are stubbed. setUp/tearDown not ported.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
|
PathRepository does not implement RepositoryInterface and exposes no public
getPackages/count/hasPackage (delegation to its inner ArrayRepository is not
ported), so the cases cannot be driven; the unversioned ones also need the
VersionGuesser. All stubbed.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
|
All ignored: load() parses require constraints via a look-around regex and the
cases mock RepositoryManager / ProcessExecutor / VersionGuesser. Wires up the
package/loader test submodule.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
|
All ignored/todo!(): the advisory filter parses affectedVersions via a
look-around regex; the Hg/Fossil/Perforce/Archive downloaders and
RepositoryManager need mocked process/HttpDownloader (curl); the Validate/
Archive commands, ApplicationTest and CompletionFunctionalTest need the
ApplicationTester/console harness. setUp/tearDown not ported.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
|
addWhenTypeIsNotRecognized passes (the type check precedes the hash). All other
cases call RuleSet::add, which computes get_hash -> hash_raw (todo!()), and
prettyString also mocks RepositorySet/Request; those are ignored.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
|
All ignored/todo!(): the auth-util tests mock IO/Config/HttpDownloader, the
command tests need ApplicationTester, and ZipArchiver builds a zip via
ZipArchive (todo!()). setUp/tearDown not ported.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
|
ArtifactRepository reads archives via ZipArchive/PharData (todo!());
BinaryInstaller installs and executes a real PHP binary and mocks a Package.
Both stubbed. setUp/tearDown not ported.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
|
TransactionTest needs Transaction::new (uasort_map todo!()) and non-root link
setters; StrictConfirmationQuestionTest needs Symfony QuestionHelper. Both
stubbed. Wires up the question test target.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
|
HgDriver::supports and RootAliasPackage setRequires pass. The other Hg cases
need an HgDriver instance (HttpDownloader/curl, mocked process); the other
RootAliasPackage setters only update alias_of, not the alias's own copy, so
those getters stay empty. All such cases ignored. setUp/tearDown not ported.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
|
clearCache verified against a real Cache over a temp dir; the gc() cases mock
Cache::getFinder (not overridable from a test) and are stubbed. setUp/tearDown
not ported.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
|
MetapackageInstaller install/uninstall verified against a real
InstalledArrayRepository; update reaches version_compare (todo!()) and is
ignored. The command tests need the ApplicationTester harness (stubbed).
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
|
All cases pass: only/exclude matching, both-filters guard, disabled child
advisories, and canonical vs non-canonical loadPackages. setUp's repository
fixture is inlined; teardown not ported.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
|
equals/type/enable/disable/isAssertion pass; getHash reaches hash_raw (todo!())
and prettyString needs mocked RepositorySet/Request, so both are stubbed.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
|
setRepository (same/another) and packageNamesToRegexp pass; the dev-version
formatting case mocks abstract BasePackage getters and is stubbed. Adds the
test_case helper to the package test target.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
|
In the full suite it races test_get_composer_json_path_from_env over the
global COMPOSER env; without the deferred tearDown clearing it, only one
mutator can run. Keeps from_env as the sole COMPOSER mutator.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
|
IniHelper cases reach XdebugHandler::get_all_ini_files (todo!()); RepositoryUtils
filterRequiredPackages is fully modeled but building linked packages via
ArrayLoader parses constraints with a look-around regex the regex crate cannot
compile. Both ignored. setUp/tearDown not ported.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
|
ClassLoader::getPrefixes verified; loadClass/serializability rely on PHP
runtime class loading and serialize() (stubbed). HttpDownloader and Reinstall
need curl/ApplicationTester (stubbed). Wires up the autoload test target.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|