PHPackages                             capachow/arcane - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Framework](/categories/framework)
4. /
5. capachow/arcane

ActiveProject[Framework](/categories/framework)

capachow/arcane
===============

A deceptively powerful 12kb dependency-free single-file PHP microframework built to keep things easy and minimal.

26.03.1(2mo ago)2313[2 issues](https://github.com/capachow/arcane/issues)[1 PRs](https://github.com/capachow/arcane/pulls)MITPHPPHP &gt;=8.2

Since Jan 23Pushed 2mo agoCompare

[ Source](https://github.com/capachow/arcane)[ Packagist](https://packagist.org/packages/capachow/arcane)[ Docs](https://arcane.dev)[ GitHub Sponsors](https://github.com/capachow)[ RSS](/packages/capachow-arcane/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (10)DependenciesVersions (9)Used By (0)

Arcane Microframework
---------------------

[](#arcane-microframework)

> *Arcane is unconventional but beautifully intuitive. It is intentionally different, breaking away from modern frameworks to encourage critical thinking without the dependence and overhead of complex systems. It brings out the fun in building for the web by automating the features you want, while making it easier to apply the ones you need.*

At its core, Arcane is a tiny `12kb` single-file PHP microframework designed to keep things easy and minimal. It uses a filesystem-first workflow where files map directly to routes, and context-aware helpers and assets load automatically. Perfect for anyone who wants a fast, flexible tool with zero setup.

- Clean configuration free URLs
- Unique filesystem defined routing
- Helpers autoloaded by context
- Layouts wrap pages automatically
- Robust localization kept simple
- Architecture driven by directories
- Simple ENV file configuration
- HTML minification for performance
- Native PHP minimal learning curve
- Zero external dependencies needed

`Less config. More craft.`

Installation
------------

[](#installation)

**** or copy via terminal:

```
curl -fsLO copy.arcane.dev/index.php
```

> `composer create-project capachow/arcane` It's a single file with zero dependencies. You should just curl it.

Simply drop `index.php` into your project and open it in your browser. Arcane conjures the rest like magic.

Documentation
-------------

[](#documentation)

1. [Philosophy &amp; Architecture](#1-philosophy--architecture)
2. [The Four Functions](#2-the-four-functions)
3. [Routing &amp; Pages](#3-routing--pages)
4. [Layouts, Rendering, and Includes](#4-layouts-rendering-and-includes)
5. [Helpers &amp; Autoload Cascade](#5-helpers--autoload-cascade)
6. [Automatic CSS/JS Assets](#6-automatic-cssjs-assets)
7. [Localization and Translation](#7-localization-and-translation)
8. [Environment &amp; Settings](#8-environment--settings)
9. [Page Directives](#9-page-directives)
10. [Runtime Constants](#10-runtime-constants)
11. [Troubleshooting &amp; Notes](#11-troubleshooting--notes)
12. [Requirements and Ecosystem](#12-requirements-and-ecosystem)

---

### 1. Philosophy &amp; Architecture

[](#1-philosophy--architecture)

Arcane operates on a single governing principle: **location is logic**.

Modern web development often drifts into configuration chaos. Many frameworks are built to satisfy enterprise edge cases, and everyone else ends up carrying that weight. Arcane takes the opposite stance. It focuses on the work that ships real projects, like routing, templating, and helpers, and treats "less" as a **deliberate discipline**, not a missing feature. By focusing on what most projects actually need, Arcane makes a promise rooted in honesty, freedom, and focus. You should not have to carry the baggage for features you will never use.

That discipline comes from *unified primitives* and a filesystem-first approach. There is no route registry or hidden sigils to maintain. If you want a page, you create a file. By keeping assets, logic, and views close together, Arcane encourages *cognitive locality*. You build where it makes sense instead of hunting through scattered configuration.

Dependencies also break. They age, conflict, and require maintenance. Arcane stays **dependency-free** at its core, keeping your project stable and grounded in standard PHP, so you are not betting your site on whether a framework stays maintained.

**The Request Lifecycle**:

Instead of a complex event loop, Arcane follows a linear path of discovery:

1. **Match:** The URL is mapped directly to the closest physical file in `/pages`, normalizing paths for SEO.
2. **Collect:** Arcane walks the directory tree down to that file, channels only relevant helpers, data, and assets.
3. **Build:** The page executes within this prepared environment, generating the `CONTENT` constant.
4. **Return:** Output is wrapped in the layout, assets are injected, and the final response is sent to the browser.

---

### 2. The Four Functions

[](#2-the-four-functions)

Arcane keeps things minimal. You can build simple to complex applications using just these four globals. These global functions are available everywhere.

2.1 **`env(string, string)`**: Retrieves environment variables or feature flags.

- *Note*: Automatically converts strings `true`, `false`, or `null` into actual bool or nulls.

```
