1
0
mirror of https://github.com/restoreddev/phpapprentice.git synced 2025-10-28 20:35:45 +01:00

Initial commit for public repo

This commit is contained in:
Andrew Davis
2018-09-02 10:57:36 -05:00
commit cb5d7c2386
79 changed files with 14644 additions and 0 deletions

27
src/util/router.php Normal file
View File

@@ -0,0 +1,27 @@
<?php
/**
* Router file used for development server
* to create html files on demand
*/
require __DIR__ . '/../../vendor/autoload.php';
load_config(__DIR__ . '/../../config.php');
$uri = $_SERVER['REQUEST_URI'];
$pathinfo = pathinfo($uri);
if ($pathinfo['dirname'] == '/' && !isset($pathinfo['extension'])) {
$pathinfo['extension'] = 'html';
$pathinfo['filename'] = 'index';
}
if ($pathinfo['extension'] == 'html') {
$build = new Apprentice\Build;
$output = $build->runSingleBuild($pathinfo['filename']);
echo $output;
return true;
}
return false;