1.4 starting...

Just have to add an handler.
This commit is contained in:
Ad5001 2016-07-30 17:09:31 +03:00
parent 1db1810c7d
commit 335007df2b
9 changed files with 88 additions and 27 deletions

View file

@ -2,7 +2,7 @@
#This define the port that your website that will run.
#****NOTE THAT YOU WILL NEED TO RE-PORTFOREWARD WITH THE NEW PORT****
port: 8080
port: 80
# Here you can choose the pages !
index: index.html
@ -11,4 +11,5 @@ index: index.html
# Here you can config pages that user will not be able to see !
denied-pages:
- /config..yml
- /config.yml
- /router.php

16
resources/handler.php Normal file
View file

@ -0,0 +1,16 @@
<?php
/*
Copyright (C) Ad5001 2016 All rights reserved.
@link http://ad5001.ga
Do not attemped to modify this file if you're not sure on how it works.
This file process 404, 403 requests and custom index.
*/
if(!file_exists(__DIR__ . $_SERVER["REQUEST_URI"])) {
echo file_get_contents(__DIR__ . "/" . yaml_parse(file_get_contents(__DIR__ . "/config.yml"))[404]);
} elseif($_SERVER["REQUEST_URI"] == "/") {
echo file_get_contents(__DIR__ . "/" . yaml_parse(file_get_contents(__DIR__ . "/config.yml"))["index"]);
} elseif(in_array($_SERVER["REQUEST_URI"], yaml_parse(file_get_contents(__DIR__ . "/config.yml"))["denied-pages"])) {
echo file_get_contents(__DIR__ . "/" . yaml_parse(file_get_contents(__DIR__ . "/config.yml"))[403]);
} else {
return false;
}