Rewrites and Formatting
This commit is contained in:
+3
-30
@@ -1,30 +1,3 @@
|
||||
RewriteEngine On
|
||||
|
||||
##
|
||||
## You may need to uncomment the following line for some hosting environments,
|
||||
## if you have installed to a subdirectory, enter the name here also.
|
||||
##
|
||||
RewriteBase /phpCourse/exam
|
||||
|
||||
##
|
||||
## Black listed folders
|
||||
##
|
||||
RewriteRule ^phpCourse/exam/config/.* index.php [L,NC]
|
||||
RewriteRule ^phpCourse/exam/vendor/.* index.php [L,NC]
|
||||
RewriteRule ^phpCourse/exam/routes/.* index.php [L,NC]
|
||||
RewriteRule ^phpCourse/exam/react/.* index.php [L,NC]
|
||||
|
||||
##
|
||||
## API routes
|
||||
##
|
||||
RewriteCond %{REQUEST_FILENAME} /api/.*
|
||||
RewriteCond %{REQUEST_FILENAME} !/api/docs
|
||||
RewriteRule ^ api/index.php [L,NC,QSA]
|
||||
|
||||
##
|
||||
## Standard routes
|
||||
##
|
||||
RewriteCond %{REQUEST_FILENAME} !-f
|
||||
RewriteCond %{REQUEST_FILENAME} !/api/docs
|
||||
RewriteCond %{REQUEST_FILENAME} !/dist
|
||||
RewriteRule ^ dist [L,NC,QSA]
|
||||
Order deny,allow
|
||||
Deny from all
|
||||
Allow from 127.0.0.1
|
||||
@@ -3,6 +3,7 @@
|
||||
namespace Khofmann\Database;
|
||||
|
||||
use PDO;
|
||||
use Config\Config;
|
||||
|
||||
class Database extends PDO
|
||||
{
|
||||
@@ -17,7 +18,7 @@ class Database extends PDO
|
||||
{
|
||||
$cls = static::class;
|
||||
if (!isset(self::$instances[$cls])) {
|
||||
$dataAccess = \Config\Config::getDatabase();
|
||||
$dataAccess = Config::getDatabase();
|
||||
self::$instances[$cls] = new static(
|
||||
"mysql:host={$dataAccess["host"]};dbname={$dataAccess["database"]};charset={$dataAccess["charset"]}",
|
||||
$dataAccess["user"],
|
||||
|
||||
@@ -14,6 +14,6 @@ class Request
|
||||
|
||||
public static function header(string $name, $defaultValue = null, bool $tryParse = true): ?string
|
||||
{
|
||||
return request()->getHeader($name, $defaultValue, $tryParse);
|
||||
return Request::request()->getHeader($name, $defaultValue, $tryParse);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user