$ show Varying-Vagrant-Vagrants/VVV
VVV (Varying Vagrant Vagrants) is a local WordPress development environment built on Vagrant. It automates provisioning of a Ubuntu-based virtual machine with a full LEMP stack (Nginx, PHP 8.2+, MariaDB 10.11), along with tools like WP-CLI, Composer, Node.js, Memcached, MailHog, and Xdebug. Users define sites and extensions in a YAML config file; VVV clones site templates, generates Nginx configurations, creates databases, and runs setup scripts. Provisioning uses a modular hook system that allows core components (PHP, Nginx, MariaDB, etc.) to register callbacks at specific phases, enabling extensibility via custom extensions and site provisioners. The codebase demonstrates robust error handling, network retries with exponential backoff, atomic file operations, and performance optimizations like apt update caching and command existence caching. While primarily written in Bash with inherent script fragility, the architecture is well-structured, actively maintained, and regularly updated to support current Ubuntu LTS releases and software versions.
The LLM identified 3 files worth highlighting for reuse:
A library of reusable Bash helper functions for logging with ANSI color formatting (vvv_info, vvv_error, vvv_success, etc.), network connectivity checks with retry logic, apt package management, configuration reading via shyaml, atomic file operations, and a priority-based hook system (vvv_add_hook / vvv_hook) that allows dynamic registration and execution of functions. The hook system validates hook names against a strict regex to prevent code injection. These functions are designed for use in provisioning scripts but can be extracted with minimal modification for any Bash-based automation project.
A robust MySQL/MariaDB database backup script that iterates over all databases, skips system databases and user-defined exclusions, and dumps each to a separate SQL file (optionally gzipped) with SHA256 checksums. Features include: automatic skip of databases with no tables, configurable gzip and exclusion lists via YAML config, parallel-safe FIFO usage, and detailed output of backed up, skipped, and failed databases. This script can be reused as-is for any MySQL backup workflow by adjusting the config paths.
A well-structured script to enable or disable PHP debugging modules (Xdebug, Tideways, pcov) across all installed PHP versions. It uses phpquery to detect versions, and phpdismod/phpenmod to toggle modules. Handles interdependencies (e.g., Tideways needs both tideways_xhprof and xhgui), validates module installation per PHP version, and restarts PHP-FPM services. Includes clear success/error/failure output. This pattern is reusable for any multi-PHP environment needing debug mode switching.