Skip to content

Commit 18d1a4d

Browse files
authored
Merge pull request #41 from capachow/develop
Various stability updates for new release.
2 parents d21048f + c20b37c commit 18d1a4d

7 files changed

Lines changed: 34 additions & 36 deletions

File tree

.github/FUNDING.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
github: [capachow]
1+
github: [capachow]

.github/ISSUE_TEMPLATE/bug_report.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
name: Bug Report
33
about: Report something that's broken
44
labels: Bug
5-
---
5+
---

.github/ISSUE_TEMPLATE/config.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
11
blank_issues_enabled: false
22
contact_links:
3+
- name: Discussions
4+
url: https://github.com/capachow/arcane/discussions
5+
about: Ask questions and share ideas
36
- name: Join Discord
47
url: https://chat.arcane.dev
58
about: Chat and discuss questions
69
- name: Documentation
7-
url: https://docs.arcane.dev
8-
about: How-to guide and examples
10+
url: https://github.com/capachow/arcane/blob/master/README.md#documentation
11+
about: How-to guide and examples

.github/ISSUE_TEMPLATE/feature_request.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
name: Feature Request
33
about: Suggest an idea for this project
44
labels: Enhancement
5-
---
5+
---

README.md

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
> *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.*
44
5-
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.
5+
At its core, Arcane is a tiny `13kb` 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.
66

77
- Clean configuration free URLs
88
- Unique filesystem defined routing
@@ -415,17 +415,15 @@ Arcane provides global constants to give you instant access to the application s
415415

416416
Arcane is minimal by design. It doesn't include heavy tomes, but it offers a system to plug them in easily.
417417

418-
- Arcane **requires** PHP >= 8.2.
418+
- Arcane **requires** PHP >= 8.4.
419419
- **Apache users:** Works automatically provided the `AllowOverride All` directive is enabled (Arcane will generate the required `.htaccess` file for you).
420420
- **NGINX users:** Requires routing traffic to the front controller. Add this to your `server` block alongside your existing PHP execution directive:
421-
422-
```nginx
423-
location / {
424-
rewrite ^/(.*)/$ /$1 permanent;
425-
try_files $uri $uri/ /index.php?$query_string;
426-
}
427-
```
428-
421+
```nginx
422+
location / {
423+
rewrite ^/(.*)/$ /$1 permanent;
424+
try_files $uri $uri/ /index.php?$query_string;
425+
}
426+
```
429427
- [Arcane Helpers](https://github.com/MEDIA76/arcane-helpers) is a collection of drop-in files for common tasks (Markdown parsing, OAuth, database access).
430428
- [Creating an issue](https://github.com/MEDIA76/arcane/issues) on GitHub for reporting bugs is always appreciated.
431429

@@ -439,4 +437,4 @@ The word *arcane* refers to mysterious knowledge, secrets understood by only a f
439437

440438
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.
441439

442-
> Now go have fun and develop something you are proud of, but keep it **Arcane**.
440+
> Now go have fun and develop something you are proud of, but keep it **Arcane**.

composer.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "capachow/arcane",
33
"type": "project",
4-
"description": "A deceptively powerful 12kb dependency-free single-file PHP microframework built to keep things easy and minimal.",
4+
"description": "A deceptively powerful 13kb dependency-free single-file PHP microframework built to keep things easy and minimal.",
55
"keywords": [
66
"php",
77
"web-development",
@@ -23,10 +23,10 @@
2323
}
2424
],
2525
"require": {
26-
"php": ">=8.2"
26+
"php": ">=8.4"
2727
},
2828
"config": {
2929
"optimize-autoloader": true,
3030
"sort-packages": true
3131
}
32-
}
32+
}

index.php

Lines changed: 14 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
22

33
/**
4-
* Arcane 26.03.1 Microframework
4+
* Arcane 26.4.1 Microframework
55
* Copyright 2017-2026 Joshua Britt
66
* MIT License https://arcane.dev
77
**/
@@ -29,11 +29,11 @@
2929

3030
(function() use(&$define) {
3131
$app = [
32-
'DIR' => dirname($_SERVER['SCRIPT_FILENAME']) . '/',
33-
'ROOT' => rtrim($_SERVER['DOCUMENT_ROOT'], '/') . '/',
34-
'START' => $_SERVER['REQUEST_TIME_FLOAT'],
32+
'DIR' => dirname($_SERVER['SCRIPT_FILENAME'] ?? __FILE__) . '/',
33+
'ROOT' => rtrim($_SERVER['DOCUMENT_ROOT'] ?? '', '/') . '/',
34+
'START' => $_SERVER['REQUEST_TIME_FLOAT'] ?? microtime(true),
3535
'QUERY' => urldecode($_SERVER['QUERY_STRING'] ?? ''),
36-
'URI' => strtok($_SERVER['REQUEST_URI'], '?')
36+
'URI' => strtok($_SERVER['REQUEST_URI'] ?? '/', '?')
3737
];
3838

3939
define('APP', array_merge($app, [
@@ -164,16 +164,16 @@
164164
$redirect = "{$redirect}?" . APP['QUERY'];
165165
}
166166

167-
exit(header('Location: ' . $redirect, true, 301));
167+
exit(header("Location: {$redirect}", true, 301));
168168
}
169169

170170
if(array_key_exists($uri[1], LOCALES)) {
171171
if(isset($uri[2]) && array_key_exists($uri[2], LOCALES[$uri[1]])) {
172172
$locale = LOCALES[$uri[1]][$uri[2]];
173173

174174
array_splice($uri, 0, 2);
175-
} else if(array_key_exists(null, LOCALES[$uri[1]])) {
176-
$locale = LOCALES[$uri[1]][null];
175+
} else if(array_key_exists('', LOCALES[$uri[1]])) {
176+
$locale = LOCALES[$uri[1]][''];
177177

178178
array_splice($uri, 0, 1);
179179
}
@@ -200,19 +200,19 @@
200200

201201
define('TRANSCRIPT', $transcript);
202202
} else if(!empty(SET['LOCALE'])) {
203-
$request = $_SERVER['HTTP_ACCEPT_LANGUAGE'];
203+
$request = $_SERVER['HTTP_ACCEPT_LANGUAGE'] ?? '';
204204
$default = str_replace('+', '-', SET['LOCALE']);
205205
$uri = implode('/', URI);
206206

207-
preg_match_all("/[a-z]{2}-[a-z]{2}/i", $request, $request);
207+
preg_match_all("/[a-z]{2}-[a-z]{2}/i", $request, $matches);
208208

209-
foreach(array_merge(reset($request), [$default]) as $code) {
209+
foreach(array_merge(reset($matches), [$default]) as $code) {
210210
foreach(LOCALES as $locales) {
211211
foreach($locales as $locale) {
212212
if(!strcasecmp($locale['CODE'], $code)) {
213213
$redirect = rtrim("{$locale['URI']}/{$uri}", '/');
214214

215-
exit(header('Location: ' . $redirect));
215+
exit(header("Location: {$redirect}"));
216216
}
217217
}
218218
}
@@ -236,7 +236,7 @@
236236

237237
if(!is_file($page) && is_dir(substr($page, 0, -4) . '/')) {
238238
$page = rtrim(str_replace('.php', '', $page), '/');
239-
$page = "$page/" . SET['INDEX'] . '.php';
239+
$page = "{$page}/" . SET['INDEX'] . '.php';
240240
}
241241

242242
if(is_file($page) && end($path) !== SET['INDEX']) {
@@ -374,8 +374,7 @@
374374
"/\>[^\S ]+/m" => ">",
375375
"/^\h+\</m" => "<",
376376
"/[^\S ]+\</m" => "<",
377-
"/\>\s{2,}\</" => "><",
378-
"//s" => ""
377+
"/\>\s{2,}\</" => "><"
379378
]), $minify, $content);
380379
} else {
381380
return $content;
@@ -480,5 +479,3 @@ function scribe($string, $replace = []) {
480479

481480
return $string;
482481
}
483-
484-
?>

0 commit comments

Comments
 (0)