__rhandle = $rhandle; $this->__epoch = $epoch; } public function __destruct() { \ShirabeRustObjectRegistry::release($this->__rhandle); } public function __shirabeRustHandleDescriptor(): array { return [ '__rhandle' => $this->__rhandle, '__class' => static::class, '__epoch' => $this->__epoch, ]; } public function __clone() { // PHP has already shallow-copied this stub, so both copies would point at one // entity and release it twice. The Rust side clones the entity instead, applying // whatever __clone semantics the real class defines, and this copy rebinds to the // fresh handle. Entities without clone semantics answer with an explicit error. [$this->__rhandle, $this->__epoch] = \ShirabeRpcRuntime::callRust($this->__rhandle, '__shirabeClone', []); \ShirabeRustObjectRegistry::adopt($this->__rhandle, $this); } public function __construct(bool $useEnvironment = true, ?string $baseDir = null) { [$this->__rhandle, $this->__epoch] = \ShirabeRpcRuntime::callRust(0, '__shirabeConstruct', [static::class, [$useEnvironment, $baseDir]]); \ShirabeRustObjectRegistry::adopt($this->__rhandle, $this); } public const SOURCE_DEFAULT = 'default'; public const SOURCE_COMMAND = 'command'; public const SOURCE_UNKNOWN = 'unknown'; public const RELATIVE_PATHS = 1; public static $defaultConfig = [ 'process-timeout' => 300, 'use-include-path' => false, 'allow-plugins' => [], 'use-parent-dir' => 'prompt', 'preferred-install' => 'dist', 'audit' => ['ignore' => [], 'abandoned' => Auditor::ABANDONED_FAIL], 'notify-on-install' => true, 'github-protocols' => ['https', 'ssh', 'git'], 'gitlab-protocol' => null, 'vendor-dir' => 'vendor', 'bin-dir' => '{$vendor-dir}/bin', 'cache-dir' => '{$home}/cache', 'data-dir' => '{$home}', 'cache-files-dir' => '{$cache-dir}/files', 'cache-repo-dir' => '{$cache-dir}/repo', 'cache-vcs-dir' => '{$cache-dir}/vcs', 'cache-ttl' => 15552000, // 6 months 'cache-files-ttl' => null, // fallback to cache-ttl 'cache-files-maxsize' => '300MiB', 'cache-read-only' => false, 'bin-compat' => 'auto', 'discard-changes' => false, 'autoloader-suffix' => null, 'sort-packages' => false, 'optimize-autoloader' => false, 'classmap-authoritative' => false, 'apcu-autoloader' => false, 'prepend-autoloader' => true, 'update-with-minimal-changes' => false, 'github-domains' => ['github.com'], 'bitbucket-expose-hostname' => true, 'disable-tls' => false, 'secure-http' => true, 'secure-svn-domains' => [], 'cafile' => null, 'capath' => null, 'github-expose-hostname' => true, 'gitlab-domains' => ['gitlab.com'], 'store-auths' => 'prompt', 'platform' => [], 'archive-format' => 'tar', 'archive-dir' => '.', 'htaccess-protect' => true, 'use-github-api' => true, 'lock' => true, 'platform-check' => 'php-only', 'bitbucket-oauth' => [], 'github-oauth' => [], 'gitlab-oauth' => [], 'gitlab-token' => [], 'http-basic' => [], 'bearer' => [], 'custom-headers' => [], 'bump-after-update' => false, 'allow-missing-requirements' => false, 'client-certificate' => [], 'forgejo-domains' => ['codeberg.org'], 'forgejo-token' => [], ]; public static $defaultRepositories = [ 'packagist.org' => [ 'type' => 'composer', 'url' => 'https://repo.packagist.org', ], ]; public static function disableProcessTimeout(): void { // Override global timeout set earlier by environment or config ProcessExecutor::setTimeout(0); } public function setBaseDir(?string $baseDir): void { \ShirabeRpcRuntime::callRust($this->__rhandle, 'setBaseDir', [$baseDir]); } public function setConfigSource(ConfigSourceInterface $source): void { \ShirabeRpcRuntime::callRust($this->__rhandle, 'setConfigSource', [$source]); } public function getConfigSource(): ConfigSourceInterface { return \ShirabeRpcRuntime::callRust($this->__rhandle, 'getConfigSource', []); } public function setAuthConfigSource(ConfigSourceInterface $source): void { \ShirabeRpcRuntime::callRust($this->__rhandle, 'setAuthConfigSource', [$source]); } public function getAuthConfigSource(): ConfigSourceInterface { return \ShirabeRpcRuntime::callRust($this->__rhandle, 'getAuthConfigSource', []); } public function setLocalAuthConfigSource(ConfigSourceInterface $source): void { \ShirabeRpcRuntime::callRust($this->__rhandle, 'setLocalAuthConfigSource', [$source]); } public function getLocalAuthConfigSource(): ?ConfigSourceInterface { return \ShirabeRpcRuntime::callRust($this->__rhandle, 'getLocalAuthConfigSource', []); } public function merge(array $config, string $source = self::SOURCE_UNKNOWN): void { \ShirabeRpcRuntime::callRust($this->__rhandle, 'merge', [$config, $source]); } public function getRepositories(): array { return \ShirabeRpcRuntime::callRust($this->__rhandle, 'getRepositories', []); } public function get(string $key, int $flags = 0) { return \ShirabeRpcRuntime::callRust($this->__rhandle, 'get', [$key, $flags]); } public function all(int $flags = 0): array { return \ShirabeRpcRuntime::callRust($this->__rhandle, 'all', [$flags]); } public function getSourceOfValue(string $key): string { return \ShirabeRpcRuntime::callRust($this->__rhandle, 'getSourceOfValue', [$key]); } public function raw(): array { return \ShirabeRpcRuntime::callRust($this->__rhandle, 'raw', []); } public function has(string $key): bool { return \ShirabeRpcRuntime::callRust($this->__rhandle, 'has', [$key]); } public function prohibitUrlByConfig(string $url, ?IOInterface $io = null, array $repoOptions = []): void { \ShirabeRpcRuntime::callRust($this->__rhandle, 'prohibitUrlByConfig', [$url, $io, $repoOptions]); } }