Skip to main content

druvu-lib-web 2.0.0 Released: Run PHP on JVM

A compact Java web framework on Jetty 12 launches version 2.0.0, running real PHP 8 templates without needing a PHP runtime.

AI-written
Inewgen
15 Aug 2026Source: Dev.to2 min read (0 views)
Share
druvu-lib-web 2.0.0 Released: Run PHP on JVM

Stock photo for illustration only, not from the actual event

Font size
  • druvu-lib-web 2.0.0 officially launches on Jetty 12
  • Uses real PHP 8 templates rather than a PHP-like syntax
  • Operates entirely inside Java without any PHP runtime
  • Default HTML escaping improves overall application security

Java and PHP developers have a new tool to explore with the official release of druvu-lib-web 2.0.0, a lightweight Java web framework built on Jetty 12 that uniquely utilizes PHP as its template language instead of just a syntax that resembles it.

The newly released 2.0 engine executes authentic PHP 8 layouts, supporting variables, every control structure, string interpolation, heredocs, includes, arrow functions, and 115 standard functions. Its semantics are rigorously verified by running entire templates against PHP 8 to match the output byte for byte.

software code development technology screen

Stock photo for illustration only, not from the actual event

Notably, there is no PHP runtime present anywhere in the stack. The core engine is written in Java, your request handlers are in Java, and server-side attributes like request.setAttribute("customer", customer) automatically translate into accessible $customer variables inside the template page.

Never miss the latest news?

Subscribe to get news summaries by email - not often enough to be annoying.

โฆษณา

Running PHP templates directly on the JVM introduces a fascinating interoperability approach for enterprise stacks. It allows teams to leverage existing PHP templating logic within robust Java infrastructure. Furthermore, defaulting to HTML-escaped outputs reflects a secure-by-default design philosophy that mitigates common injection vulnerabilities.

The primary breaking change from the 1.x series is security-focused: output is now HTML-escaped by default, requiring developers to explicitly opt out using raw() if unescaped rendering is necessary, thereby turning a potential security oversight into a safe behavior.

Developers interested in testing the framework, reviewing documentation, or running the provided examples can access the official GitHub repository. The creator encourages community feedback, noting that any template rendering discrepancies compared to native PHP should be reported as bugs.

Source: Dev.to

Comments

Leave a Comment
0/2000

Found something wrong in this article? Report an issue with this article