Skip to content

Commit ba05fd3

Browse files
committed
pack
1 parent c318c71 commit ba05fd3

7 files changed

Lines changed: 105 additions & 5 deletions

File tree

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
/vendor
2+
/tmp

.htaccess

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
RewriteEngine on
2+
RewriteBase /
3+
RewriteCond %{REQUEST_FILENAME} !-d
4+
RewriteCond %{REQUEST_FILENAME} !-f
5+
RewriteRule ^(.+)$ /index.php [L]

Makefile

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,14 @@ test:
22
phpunit
33
server:
44
php -S localhost:8080 -t . router.php
5-
build:
6-
echo "TODO"
5+
build: zip phar
76
document:
8-
cd doc && mermaid *.mermaid
7+
cd doc && mermaid *.mermaid
8+
zip:
9+
mkdir -p tmp
10+
zip -r tmp/ark_framework.zip . -x ".git/*" "tmp*" "*.DS_Store"
11+
phar:
12+
mkdir -p tmp
13+
box build
14+
clean:
15+
rm -rf tmp

README.md

Lines changed: 41 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,55 @@
22

33
Lightweight PHP framework.
44

5+
This framework aims to provide a minimal start point for your application.
6+
57
## Features
68

79
- Event driven
810
- Small
911

12+
## What's Included
13+
14+
- Application Class
15+
- Container (Pimple)
16+
- Router (FastRoute)
17+
1018
## Requirements
1119

1220
- PHP 5.4
1321

22+
## Installation
23+
24+
### Via Composer
25+
26+
```
27+
composer require ark/framework
28+
```
29+
30+
### Download Zip
31+
32+
See [Latest Release](https://github.com/arkphp/framework/releases/latest)
33+
34+
### Download Phar
35+
36+
See [Latest Release](https://github.com/arkphp/framework/releases/latest)
37+
1438
## Usage
1539

16-
See `index.php`
40+
See `index.php`
41+
42+
## Server Setup
43+
44+
### Nginx
45+
46+
See `nginx.conf`
47+
48+
### Apache
49+
50+
See .htaccess
51+
52+
### PHP Builtin Server
53+
54+
```
55+
php -S localhost:8080 -t . router.php
56+
```

box.json

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
{
2+
"alias": "ark.framework.phar",
3+
"chmod": "0755",
4+
"compactors": [
5+
"Herrera\\Box\\Compactor\\Json",
6+
"Herrera\\Box\\Compactor\\Php"
7+
],
8+
"finder": [
9+
{
10+
"name": [
11+
"LICENSE*",
12+
"License*",
13+
"*.php"
14+
],
15+
"exclude": [
16+
"phpunit",
17+
"Tests",
18+
"tests"
19+
],
20+
"in": ["src", "vendor"]
21+
}
22+
],
23+
"output": "tmp/ark.framework.phar",
24+
"git-version": "git_version",
25+
"main": "bootstrap.php",
26+
"output": "tmp/ark.framework.phar",
27+
"stub": true
28+
}

nginx.conf

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
server {
2+
listen 80;
3+
4+
root /path/to/docroot/;
5+
index index.php index.html index.htm;
6+
7+
server_name www.example.com;
8+
9+
location / {
10+
try_files $uri /index.php?$query_string;;
11+
}
12+
13+
location ~ \.php$ {
14+
fastcgi_split_path_info ^(.+\.php)(/.+)$;
15+
fastcgi_pass unix:/var/run/php5-fpm.sock;
16+
fastcgi_index index.php;
17+
include fastcgi_params;
18+
}
19+
}

router.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22
$path = parse_url($_SERVER["REQUEST_URI"], PHP_URL_PATH);
3-
if (file_exists('./'.$path)) {
3+
if (is_file('.'.$path) || is_dir('.'.$path)) {
44
return false;
55
}
66

0 commit comments

Comments
 (0)