- Can I install js/mysqlnd-bundle in a Laravel application with Composer?
- No. js/mysqlnd-bundle is a Symfony2 bundle with Symfony 2.x component constraints, while Laravel 10 and 11 pull Symfony 6/7 components, so Composer dependency resolution has no overlap. Even with --ignore-platform-reqs the code references Symfony 2 APIs that no longer exist, so it will not run as a Laravel dependency.
- Is js/mysqlnd-bundle a Laravel package or a Symfony2 bundle?
- It is a Symfony2 bundle, not a Laravel package. It is discovered and booted by Symfony's Kernel, registers services through a DependencyInjection extension, and renders a toolbar panel through Twig and WebProfilerBundle. Laravel has no code path that loads that bundle structure, so there is no ServiceProvider or register/boot hook to use.
- What mysqlnd statistics does js/mysqlnd-bundle collect?
- The valuable part reads mysqlnd's per-connection and per-client statistics through mysqli_get_connection_stats() and mysqli_get_client_stats(). It shapes that data into query timings, bytes sent and received, and connection health for a Symfony profiler panel. Everything around that logic is Symfony DI wiring, Twig toolbar resources, and Symfony version constraints.
- Does js/mysqlnd-bundle require the mysqlnd PHP driver?
- Yes. The package assumes mysqlnd is the active MySQL driver, and without it the stats functions do not exist. If production or staging PHP was compiled with pdo_mysql or mysqli against libmysqlclient, the collector fails rather than degrading gracefully. Check every environment with php -i | grep -i mysqlnd before considering any port.
- Does js/mysqlnd-bundle work with Laravel's default pdo_mysql connection?
- Not directly. The collection logic is built around mysqli stats functions, while Laravel's default pdo_mysql connection exposes much less through PDO. A Laravel port may need a shadow mysqli connection or must accept limited metrics. Validate whether the bytes sent and received per query you need are actually available through PDO in your setup.
- Is js/mysqlnd-bundle compatible with PHP 8, Laravel 10, and Laravel 11?
- No. The last release was 2013-10-15 and the codebase is PHP 5.3/5.4 era, so expect PHP 8 breakage such as dynamic properties, removed functions, old-style constructors, and no scalar or return types. It also depends on Symfony 2 APIs that are gone in Symfony 6/7, which Laravel 10/11 use. A fork-and-port is required; it is not a drop-in dependency.
- What Laravel alternatives should I use for MySQL query profiling and mysqlnd stats?
- Laravel Debugbar, Telescope, Clockwork, DB::listen(), and MySQL performance_schema can cover SQL timings and application-level profiling. None of them gives you mysqlnd wire-level bytes sent and received per query out of the box. If that specific metric is the gap, port the mysqlnd collection logic into a custom Debugbar DataCollector or Telescope watcher.
- How long does it take to port js/mysqlnd-bundle's stats logic to Laravel?
- Budget roughly 1 to 2 weeks for a mid-level PHP engineer. Expect about 20 percent reading and stripping the Symfony bundle, 50 percent porting the stats collection into a Laravel host collector, and 30 percent validating it against your real MySQL workload. The line count is low, but the archaeology and PHP 8 modernization are moderate.
- Is js/mysqlnd-bundle maintained and safe to use in production?
- Treat it as abandoned. The repository has a 2013 release, zero dependents, and about 80 stars, with no security or compatibility maintenance for modern PHP and Laravel. Using it in production creates permanent internal ownership if you fork it. It is better suited to development-time profiling research than production APM.
- Should I require js/mysqlnd-bundle or fork it as a reference implementation?
- Fork it as a reference implementation, not as a Composer dependency. Resolve key questions first: is mysqlnd active in every environment, does your PDO setup expose the needed data or require mysqli, is the goal dev profiling or production APM, what DB::listen plus Telescope and performance_schema fail to answer, who owns the fork, and which PHP and Laravel versions are in scope.