Download the PHP package syntaxx/phpx-compiler without Composer

On this page you can find all versions of the php package syntaxx/phpx-compiler. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package phpx-compiler

PHPX - JSX-like Syntax for PHP

PHPX is a powerful library that brings JSX-like syntax to PHP, enabling developers to write component-based UI code in PHP with a familiar JSX syntax. It supports both Frontend rendering through WebAssembly and Server-Side Rendering (SSR).

Features

Quick Start

New to PHPX? Start with the PHPX Guide for a complete introduction!

Installation

Basic Usage

Compiler Usage

The PHPX compiler can transform PHPX files (.phpx) into standard PHP files:

Command Line Options

Arguments

Options

Verbose Mode Output

The compiler supports three verbosity levels for debugging and monitoring:

Example (-v):

For detailed verbose mode documentation, including JSON format, CI/CD integration, and performance tips, see Verbose Mode Guide.

PHP File Compilation

When using --compile-php-files, the compiler will:

Practical Use Cases

Lint Mode for CI/CD

Validate PHPX syntax in your CI pipeline without compiling:

Single File Compilation

Quickly compile individual components during development:

Continue-on-Error for Large Projects

Compile as many files as possible in projects with temporary errors:

PHP Linting for Quality Assurance

Ensure compiled output is valid PHP syntax:

Source Maps for Debugging

Enable source maps to map compiled PHP code back to original PHPX source:

What are Source Maps?

Source maps create a mapping between your compiled PHP code and the original PHPX source. When errors occur in compiled code, the source map allows debuggers and tools to show you the exact location in your original PHPX file.

Generated Files:

Source Map Comment (added to compiled PHP):

Source Map Format (Source Map v3):

Human-Readable Format (.map.txt):

The .map.txt file provides an easy-to-read overview of how compiled PHP lines map back to the original PHPX source. Perfect for:

Why Source Maps Matter:

  1. AI/LLM Debugging - AI agents can map runtime errors back to the code they generated
  2. IDE Integration - IDEs can show errors at the correct PHPX line, not compiled PHP line
  3. Stack Traces - Error stack traces reference original PHPX files
  4. Xdebug Integration - Debug original PHPX code, not compiled output
  5. Team Workflow - Developers work with PHPX, not compiled PHP

Example Error Mapping:

Without source maps:

With source maps:

For AI Agents:

Source maps enable accurate debugging feedback loops:

Combining with JSON Errors:

For the ultimate AI-friendly debugging setup:

This gives you:

For even more AI-friendly debugging, see AI-Friendly Source Maps - enhanced source maps with semantic context, transformation provenance, checksums, confidence scores, and debugging hints specifically designed for LLM/agent consumption.

JSON Output for AI Agents & Tooling

For AI agents, LLMs, and automated tooling, use --format=json to get machine-readable structured error data:

JSON Output Structure:

Key Fields for AI/LLM Processing:

Why This Matters for AI:

  1. Source Maps: The line and column fields map directly to your generated code, enabling accurate debugging
  2. Context Awareness: The context field tells you if the error is in JSX vs PHP code
  3. Expected Tokens: Use expected array to understand what the parser wanted
  4. Actionable Hints: The hint field provides fix suggestions your AI can apply
  5. Structured Data: Parse JSON instead of regex-parsing human-readable output

AI Agent Integration Example:

CI/CD Integration:

Benefits for AI/LLM Tools:

Error Messages

PHPX provides Rust-style error messages with source context and helpful hints:

Features:

Architecture

PHPX consists of two main parts:

  1. Parser: Converts PHPX syntax into PHP components
  2. Runtime: Handles component rendering and state management

Frontend (WebAssembly)

When targeting the frontend, PHPX components are compiled to WebAssembly, allowing them to run efficiently in the browser while maintaining the same syntax and component structure.

Server-Side Rendering

For server-side rendering, PHPX components are rendered directly on the server, providing fast initial page loads and SEO benefits.

Event System

The PHPX compiler includes a powerful event system that allows you to hook into the compilation process. This is useful for building custom tooling, monitoring compilation, or implementing custom logging.

Quick Example

Available Events

The compiler dispatches events for every compilation phase:

Documentation

For detailed documentation, examples, and best practices, see:

Documentation

For comprehensive guides and advanced topics, see the docs/ directory:

📚 Core Guides

🔧 Compiler Features

📖 Full Index

Roadmap

Check out our Roadmap to see what's coming next!

We welcome feedback and contributions!

Requirements

License

MIT License

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.


All versions of phpx-compiler with dependencies

PHP Build Version
Package Version
Requires syntaxx/phpx-parser Version ^5.4.2
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package syntaxx/phpx-compiler contains the following files

Loading the files please wait ...