Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Versioncontrol Svn Laravel Package

pear/versioncontrol_svn

PEAR VersionControl_SVN is a PHP library for interacting with Apache Subversion (SVN) repositories. It provides APIs to run SVN operations, inspect repository data, and integrate version control tasks into PHP applications and scripts.

View on GitHub
Deep Wiki
Context7

Getting Started

Begin by confirming you truly need pear/versioncontrol_svn—its archived status, low security score, and PEAR legacy mean this should only be for emergency legacy SVN integration. If proceeding, install via Composer (despite PEAR incompatibility): composer require pear/versioncontrol_svn, and add "allow-plugins": {"pear/pear-core-minimal": true} to composer.json. Instantiate the client with an explicit binary path: (new VersionControl_SVN(['svnbinary' => '/usr/bin/svn'])). Your first real-world task will likely be fetching repo metadata:

$info = $svn->info('/path/to/working/copy');
echo $info->getOut()['entry'][0]['commit']['revision'];

Check the sparse examples/ in the archived GitHub repo for basic command patterns.

Implementation Patterns

Adopt a wrapper service (e.g., SvnService) to encapsulate all SVN interactions—this isolates the fragile PEAR dependency and simplifies mocking in tests. Use $svn->run($command, $args, $options) for all non-trivial operations (e.g., ['log', '--xml', '--limit', 10]) to bypass outdated convenience methods. For CI/deployment hooks:

  1. Create a SvnSyncJob that checks out/update a working copy,
  2. Validates with svn->info(),
  3. Extracts revision/metadata via $svn->run('info'),
  4. Cleans temp paths afterward.
    Leverage Laravel’s config system: define config/svn.php with base_url, credentials, and working_copy_path, then bind VersionControl_SVN as a shared instance in AppServiceProvider with injected config.

Gotchas and Tips

  • PHP 8+ is unsupported: Patch VersionControl_SVN::run() to handle escapeshellarg() failures on non-string scalars (e.g., floats or nulls) by casting to strings first.
  • Binary paths must be absolute—relative paths like svn fail silently in Docker/nginx contexts; always verify with exec('which svn', $output).
  • XML parsing breaks on large logs: Instead of relying on $svn->log()’s XML output, use --xml with custom flags and simplexml_load_string() only after validating XML validity with libxml_use_internal_errors(true).
  • Auth injection is non-intuitive: Use $svn->setAuth(['username' => $user, 'password' => $pass]) before each operation—not at instantiation—for HTTP(S) repos, as credentials don’t persist across CLI sessions.
  • Error handling is crippled: Always capture raw output: $output = $svn->getLastOutput(); $error = $svn->getLastError();—SVN’s CLI exit codes and stderr often reveal more than the PHP object’s state.
  • Test with fake repos: Spin up a local svnserve -d -r ./test_repo and use file:// URLs in tests to avoid network flakiness; clean up repos in tearDown().
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
davejamesmiller/laravel-breadcrumbs
artisanry/parsedown
christhompsontldr/phpsdk
enqueue/dsn
bunny/bunny
enqueue/test
enqueue/null
enqueue/amqp-tools
milesj/emojibase
bower-asset/punycode
bower-asset/inputmask
bower-asset/jquery
bower-asset/yii2-pjax
laravel/nova
spatie/laravel-mailcoach
spatie/laravel-superseeder
laravel/liferaft
nst/json-test-suite
danielmiessler/sec-lists
jackalope/jackalope-transport