- How do I install kzykhys/git in a Laravel application?
- Install it with Composer using composer require kzykhys/git, then instantiate its Git classes directly in your code. There is no Laravel service provider, config file, or facade, so any container binding or configuration publishing is your own glue. On modern Laravel versions, expect dependency resolution to fail because the package pins Symfony 2.x-era components that conflict with current symfony/process versions.
- Is kzykhys/git compatible with Laravel 10 or Laravel 11?
- Most likely not without changes. The last release was in 2014 and its dependencies target Symfony 2.x, while Laravel 10 and 11 require symfony/process 6 or 7, so Composer will usually report a hard conflict. The package also predates PHP 8, so a compatibility spike should be treated as a gate before any integration work.
- Does kzykhys/git need the Git binary or a PHP extension?
- It needs the Git command-line tool installed and available on the host; it does not require a PHP Git extension. The library uses Symfony Process to execute Git commands, so the PHP process user must have permission to run git and access the repository paths. Ensure git is in PATH or configure the binary path explicitly.
- How do I clone a repository with kzykhys/git?
- Use the package's repository API to clone a remote URL into a local path, then operate on the resulting repository object for branches, commits, tags, log, and status. The library wraps the git clone command through Symfony Process, so failures throw exceptions rather than returning false. Check the README for exact method signatures because the API predates modern PHP conventions.
- Is kzykhys/git safe to run inside a web request or queue worker?
- Treat it as risky by default. A 2014-era CLI wrapper may interpolate branch names, paths, remotes, or commit messages into a shell string, which creates a command injection surface if any value is user-controlled. It may also use chdir() for working directories, which is unsafe under Octane or concurrent queue workers, and it may hang on Git credential prompts unless you set GIT_TERMINAL_PROMPT=0 and timeouts.
- How do I configure the Git binary path and working directory in kzykhys/git?
- The library exposes configuration for the Git binary path and the working directory, so you can point it at a specific git executable and repository path. In Laravel, read those values from config or environment variables and pass them in when constructing the Git object. There is no built-in Laravel config publishing, so you own that wiring.
- Can I use kzykhys/git with Laravel Octane or Swoole?
- It is not a good fit without isolation. If the library changes the process working directory with chdir() instead of using git -C, concurrent requests or workers in a long-lived process can operate on the wrong repository. For Octane or Swoole, prefer a wrapper that passes -C or --work-tree explicitly and runs each command through Symfony Process with a bounded timeout.
- How does kzykhys/git handle errors and exceptions?
- It uses Symfony Process to run Git and throws exceptions when a command fails, so you can catch failures instead of parsing raw output. Wrap calls in try/catch, log the command context, and surface a safe error to users. Also configure timeouts and disable interactive prompts so a failed command cannot hang the request.
- What are the best alternatives to kzykhys/git for Laravel Git automation?
- Consider gitonomy/gitlib for a pure PHP API, php-git2 for libgit2 bindings, or a small in-house Symfony Process wrapper limited to a fixed allowlist of Git subcommands. Laravel already ships Symfony Process, so a hand-rolled wrapper is often the lowest-risk option for deployment scripts and admin dashboards. Evaluate maintenance status and PHP 8 support before choosing.
- Is kzykhys/git still maintained, and what license is it under?
- The package appears dormant: its last release was 2014 and it has a small ecosystem footprint with few dependents. Check the repository for an explicit license file before forking or redistributing it in a vendor package. If you need ongoing PHP 8 and Laravel support, assume you will own maintenance.