Download the PHP package capachow/arcane without Composer
On this page you can find all versions of the php package capachow/arcane. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download capachow/arcane
More information about capachow/arcane
Files in capachow/arcane
Package arcane
Short Description A deceptively powerful 14kb dependency-free single-file PHP microframework built to keep things easy and minimal.
License MIT
Homepage https://arcane.dev
Informations about the package arcane
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 14kb 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
- Optional MV engine compiled views
- 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
https://arcane.dev/download or copy via terminal:
It's a single file with zero dependencies. You should just curl it.composer create-project capachow/arcane
Simply drop index.php into your project and open it in your browser. Arcane conjures the rest like magic.
Documentation
- Philosophy & Architecture
- The Four Functions
- Routing & Pages
- Layouts, Rendering, and Includes
- Optional Model-View Engine
- Helpers & Autoload Cascade
- Automatic CSS/JS Assets
- Localization and Translation
- Environment & Settings
- Page Directives
- Runtime Constants
- Troubleshooting & Notes
- Requirements and Ecosystem
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:
- Match: The URL is mapped directly to the closest physical file in
/pages, normalizing paths for SEO. - Collect: Arcane walks the directory tree down to that file, channeling only relevant helpers, data, and assets.
- Build: The page executes within this prepared environment, generating the
CONTENTconstant. - Return: Output is wrapped in the layout, assets are injected, and the final response is sent to the browser.
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, ornullinto actual bool or nulls.
2.2 path(mixed, bool): The unified tool for inspecting where you are and generating where you want to go.
-
A. Current Request [empty]:
-
B. Get Segment [integer]:
- C. Generate URL [string|array]:
- Note: If a locale is active (example:
en+us), Arcane automatically prefixes the generated URL (/us/about). You do not have to manually manage language prefixes. - Normalization: If you provide a path without an extension or parameters (no
.or?), Arcane assumes it is a page route and removes any trailing slash to normalize SEO.
- Note: If a locale is active (example:
<?= path(['IMAGES', 'logo.svg']); # /images/logo.svg (no matter the URL) ?> php <?= path('/folder/custom.php', true); ?> <?= path(['HELPERS', 'custom.php'], true); ?> php
Sidebar
Injected into the layout.
php <?= scribe('Welcome'); ?> <?= scribe('Hello :name', [':name' => 'John']); # Hello John ?> <?= scribe(['missing.key', 'Fallback']); ?> php
html
:$title
:$user->getName()
:="$user['name']"
:='"Welcome back, {$user->name}"'
:="number_format($price, 2)"
html
:scribe('welcome_message')
html
You have items!
Your cart is empty.
Please log in.
- :$user->name
<input type="checkbox"
php
php
Items: = $cart['items']; ?>
Total: $= number_format($cart['total'], 2); ?>
php
env DIR_PAGES=/pages/ DIR_LAYOUTS=/layouts/ DIR_HELPERS=/helpers/ DIR_SCRIPTS=/scripts/ DIR_STYLES=/styles/ DIR_LOCALES=/locales/ DIR_IMAGES=/images/ nginx location / { rewrite ^/(.*)/$ /$1 permanent; try_files $uri $uri/ /index.php?$query_string; }
- [Arcane Helpers](https://github.com/capachow/arcane-helpers) is a collection of drop-in files for common tasks (Markdown parsing, OAuth, database access).
- [Creating an issue](https://github.com/capachow/arcane/issues) on GitHub for reporting bugs is always appreciated.
*License*: Copyright 2017-2026 [Joshua Britt](https://github.com/capachow) under the [MIT](LICENSE.md).
---
### 14. The Meaning of Arcane
Since you made it this far down, here is a little easter egg message.
The word *arcane* refers to mysterious knowledge, secrets understood by only a few.
In an era of endless configuration and complexity, simplicity has become that secret. We have largely forgotten that the web was meant to be crafted, not configured. Arcane is a return to that lost art. It is a reminder that real mastery does not require complexity. It requires deep understanding.
> Now go have fun and develop something you are proud of, but keep it **Arcane**.