commit a46ba1dd4ec0633a3e1e908e40a638e6ca186cb8 Author: Gregory Ballantine Date: Sat Jul 9 12:50:24 2022 -0400 Initial project structure with Composer diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..57872d0 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +/vendor/ diff --git a/.htaccess b/.htaccess new file mode 100644 index 0000000..c7552bf --- /dev/null +++ b/.htaccess @@ -0,0 +1,19 @@ +Options All -Indexes + + +order allow,deny +deny from all + + + + # Redirect to the public folder + RewriteEngine On + # RewriteBase / + RewriteRule ^$ public/ [L] + RewriteRule (.*) public/$1 [L] + + # Redirect to HTTPS + # RewriteEngine On + # RewriteCond %{HTTPS} off + # RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301] + diff --git a/bin/dev-server.sh b/bin/dev-server.sh new file mode 100755 index 0000000..9c804c9 --- /dev/null +++ b/bin/dev-server.sh @@ -0,0 +1,7 @@ +#!/bin/sh + +# cd into the correct directory +cd "$( dirname "$0" )"/.. + +# launch the PHP dev server +php -S localhost:8080 -t public public/index.php diff --git a/composer.json b/composer.json new file mode 100644 index 0000000..135ce64 --- /dev/null +++ b/composer.json @@ -0,0 +1,18 @@ +{ + "name": "bitgoblin/bitgoblin-website", + "description": "Bit Goblin main website", + "type": "project", + "license": "BSD-2-Clause", + "autoload": { + "psr-4": { + "Bitgoblin\\BitgoblinWebsite\\": "src/" + } + }, + "authors": [ + { + "name": "Gregory Ballantine", + "email": "gballantine@bitgoblin.tech" + } + ], + "require": {} +} diff --git a/logs/.gitkeep b/logs/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/phpcs.xml b/phpcs.xml new file mode 100644 index 0000000..72e9907 --- /dev/null +++ b/phpcs.xml @@ -0,0 +1,17 @@ + + + Slim coding standard + + + + + + + + + + + + src + tests + \ No newline at end of file diff --git a/phpstan.neon.dist b/phpstan.neon.dist new file mode 100644 index 0000000..2e09595 --- /dev/null +++ b/phpstan.neon.dist @@ -0,0 +1,4 @@ +parameters: + level: 4 + paths: + - src diff --git a/phpunit.xml b/phpunit.xml new file mode 100644 index 0000000..f830400 --- /dev/null +++ b/phpunit.xml @@ -0,0 +1,27 @@ + + + + ./tests/ + + + + + ./src/ + + + diff --git a/public/.htaccess b/public/.htaccess new file mode 100644 index 0000000..fe74ec5 --- /dev/null +++ b/public/.htaccess @@ -0,0 +1,34 @@ +Options All -Indexes + + +order allow,deny +deny from all + + + + RewriteEngine On + + # Redirect to HTTPS + # RewriteEngine On + # RewriteCond %{HTTPS} off + # RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301] + + # Some hosts may require you to use the `RewriteBase` directive. + # Determine the RewriteBase automatically and set it as environment variable. + # If you are using Apache aliases to do mass virtual hosting or installed the + # project in a subdirectory, the base path will be prepended to allow proper + # resolution of the index.php file and to redirect to the correct URI. It will + # work in environments without path prefix as well, providing a safe, one-size + # fits all solution. But as you do not need it in this case, you can comment + # the following 2 lines to eliminate the overhead. + RewriteCond %{REQUEST_URI}::$1 ^(/.+)/(.*)::\2$ + RewriteRule ^(.*) - [E=BASE:%1] + + # If the above doesn't work you might need to set the `RewriteBase` directive manually, it should be the + # absolute physical path to the directory that contains this htaccess file. + # RewriteBase / + + RewriteCond %{REQUEST_FILENAME} !-d + RewriteCond %{REQUEST_FILENAME} !-f + RewriteRule ^ index.php [QSA,L] +