Skip to content

Commit

Permalink
ENHANCEMENT Support public folder (#21)
Browse files Browse the repository at this point in the history
  • Loading branch information
Damian Mooyman authored and Aaron Carlino committed Jan 12, 2018
1 parent 39a52d9 commit d46f453
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
10 changes: 9 additions & 1 deletion code/constants.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
<?php


// Serve always hosts from the root
define('BASE_URL', '');
define('BASE_PATH', getcwd());

// Detect BASE_PATH with public-folder awareness
define(
'BASE_PATH',
basename(getcwd()) === 'public'
? dirname(getcwd())
: getcwd()
);
1 change: 1 addition & 0 deletions code/server-handler.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@


$paths = [
'/public/index.php',
'/index.php',
'/vendor/silverstripe/framework/main.php',
'/framework/main.php',
Expand Down

0 comments on commit d46f453

Please sign in to comment.