aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Lange <code@nerdmind.de>2017-04-11 22:51:24 +0200
committerThomas Lange <code@nerdmind.de>2017-04-11 22:51:24 +0200
commit4802aeada5b8fde0848852ee56454c887738ead4 (patch)
tree1fef2384e734c9d3ee74eef74691af6fba431e93
parente38d3ed0c779619c8260585f794931c8f55fdd54 (diff)
downloadblog-4802aeada5b8fde0848852ee56454c887738ead4.tar.gz
blog-4802aeada5b8fde0848852ee56454c887738ead4.tar.xz
blog-4802aeada5b8fde0848852ee56454c887738ead4.zip
The control structures "require_once" have been replaced by a simple "require" (except within the 403.php and 404.php where it makes sense, because these files can be directly called or included).
-rw-r--r--403.php4
-rw-r--r--404.php4
-rw-r--r--admin/auth.php2
-rw-r--r--admin/database.php2
-rw-r--r--admin/index.php2
-rw-r--r--admin/page/delete.php2
-rw-r--r--admin/page/index.php2
-rw-r--r--admin/page/insert.php2
-rw-r--r--admin/page/update.php2
-rw-r--r--admin/post/delete.php2
-rw-r--r--admin/post/index.php2
-rw-r--r--admin/post/insert.php2
-rw-r--r--admin/post/update.php2
-rw-r--r--admin/user/delete.php2
-rw-r--r--admin/user/index.php2
-rw-r--r--admin/user/insert.php2
-rw-r--r--admin/user/update.php2
-rw-r--r--core/application.php6
-rw-r--r--core/namespace/Application.php4
-rw-r--r--index.php2
20 files changed, 23 insertions, 27 deletions
diff --git a/403.php b/403.php
index 7f914c0..24789a9 100644
--- a/403.php
+++ b/403.php
@@ -2,9 +2,7 @@
#===============================================================================
# INCLUDE: Main configuration
#===============================================================================
-if(!defined('ROOT')) {
- require_once 'core/application.php';
-}
+require_once 'core/application.php';
#===============================================================================
# Send HTTP status code
diff --git a/404.php b/404.php
index 10e3716..a90803b 100644
--- a/404.php
+++ b/404.php
@@ -2,9 +2,7 @@
#===============================================================================
# INCLUDE: Main configuration
#===============================================================================
-if(!defined('ROOT')) {
- require_once 'core/application.php';
-}
+require_once 'core/application.php';
#===============================================================================
# Send HTTP status code
diff --git a/admin/auth.php b/admin/auth.php
index 2608171..b90db92 100644
--- a/admin/auth.php
+++ b/admin/auth.php
@@ -7,7 +7,7 @@ define('ADMINISTRATION', TRUE);
#===============================================================================
# INCLUDE: Main configuration
#===============================================================================
-require_once '../core/application.php';
+require '../core/application.php';
#===============================================================================
# IF: Already authenticated
diff --git a/admin/database.php b/admin/database.php
index 01c2dd7..bc25b76 100644
--- a/admin/database.php
+++ b/admin/database.php
@@ -8,7 +8,7 @@ define('AUTHENTICATION', TRUE);
#===============================================================================
# INCLUDE: Main configuration
#===============================================================================
-require_once '../core/application.php';
+require '../core/application.php';
#===============================================================================
# Execute database command(s)
diff --git a/admin/index.php b/admin/index.php
index 0e59da1..1cddb8c 100644
--- a/admin/index.php
+++ b/admin/index.php
@@ -8,7 +8,7 @@ define('AUTHENTICATION', TRUE);
#===============================================================================
# INCLUDE: Main configuration
#===============================================================================
-require_once '../core/application.php';
+require '../core/application.php';
#===============================================================================
# TRY: PDOException
diff --git a/admin/page/delete.php b/admin/page/delete.php
index 564273f..de9ac21 100644
--- a/admin/page/delete.php
+++ b/admin/page/delete.php
@@ -8,7 +8,7 @@ define('AUTHENTICATION', TRUE);
#===============================================================================
# INCLUDE: Main configuration
#===============================================================================
-require_once '../../core/application.php';
+require '../../core/application.php';
#===============================================================================
# TRY: Page\Exception
diff --git a/admin/page/index.php b/admin/page/index.php
index 9dd5da1..1405ff4 100644
--- a/admin/page/index.php
+++ b/admin/page/index.php
@@ -8,7 +8,7 @@ define('AUTHENTICATION', TRUE);
#===============================================================================
# INCLUDE: Main configuration
#===============================================================================
-require_once '../../core/application.php';
+require '../../core/application.php';
$site_size = Application::get('PAGE.LIST_SIZE');
$site_sort = Application::get('PAGE.LIST_SORT');
diff --git a/admin/page/insert.php b/admin/page/insert.php
index 367c154..fc89b20 100644
--- a/admin/page/insert.php
+++ b/admin/page/insert.php
@@ -8,7 +8,7 @@ define('AUTHENTICATION', TRUE);
#===============================================================================
# INCLUDE: Main configuration
#===============================================================================
-require_once '../../core/application.php';
+require '../../core/application.php';
$Attribute = new Page\Attribute();
diff --git a/admin/page/update.php b/admin/page/update.php
index 83a1e54..a5e723e 100644
--- a/admin/page/update.php
+++ b/admin/page/update.php
@@ -8,7 +8,7 @@ define('AUTHENTICATION', TRUE);
#===============================================================================
# INCLUDE: Main configuration
#===============================================================================
-require_once '../../core/application.php';
+require '../../core/application.php';
#===============================================================================
# TRY: Page\Exception
diff --git a/admin/post/delete.php b/admin/post/delete.php
index af049fa..a5151ff 100644
--- a/admin/post/delete.php
+++ b/admin/post/delete.php
@@ -8,7 +8,7 @@ define('AUTHENTICATION', TRUE);
#===============================================================================
# INCLUDE: Main configuration
#===============================================================================
-require_once '../../core/application.php';
+require '../../core/application.php';
#===============================================================================
# TRY: Post\Exception
diff --git a/admin/post/index.php b/admin/post/index.php
index e3f0a9d..54ddd6c 100644
--- a/admin/post/index.php
+++ b/admin/post/index.php
@@ -8,7 +8,7 @@ define('AUTHENTICATION', TRUE);
#===============================================================================
# INCLUDE: Main configuration
#===============================================================================
-require_once '../../core/application.php';
+require '../../core/application.php';
$site_size = Application::get('POST.LIST_SIZE');
$site_sort = Application::get('POST.LIST_SORT');
diff --git a/admin/post/insert.php b/admin/post/insert.php
index ded732d..bcfb679 100644
--- a/admin/post/insert.php
+++ b/admin/post/insert.php
@@ -8,7 +8,7 @@ define('AUTHENTICATION', TRUE);
#===============================================================================
# INCLUDE: Main configuration
#===============================================================================
-require_once '../../core/application.php';
+require '../../core/application.php';
$Attribute = new Post\Attribute();
diff --git a/admin/post/update.php b/admin/post/update.php
index 7b14cee..109c056 100644
--- a/admin/post/update.php
+++ b/admin/post/update.php
@@ -8,7 +8,7 @@ define('AUTHENTICATION', TRUE);
#===============================================================================
# INCLUDE: Main configuration
#===============================================================================
-require_once '../../core/application.php';
+require '../../core/application.php';
#===============================================================================
# TRY: Post\Exception
diff --git a/admin/user/delete.php b/admin/user/delete.php
index 00ae850..7023246 100644
--- a/admin/user/delete.php
+++ b/admin/user/delete.php
@@ -8,7 +8,7 @@ define('AUTHENTICATION', TRUE);
#===============================================================================
# INCLUDE: Main configuration
#===============================================================================
-require_once '../../core/application.php';
+require '../../core/application.php';
#===============================================================================
# TRY: User\Exception
diff --git a/admin/user/index.php b/admin/user/index.php
index 4125801..8631ac9 100644
--- a/admin/user/index.php
+++ b/admin/user/index.php
@@ -8,7 +8,7 @@ define('AUTHENTICATION', TRUE);
#===============================================================================
# INCLUDE: Main configuration
#===============================================================================
-require_once '../../core/application.php';
+require '../../core/application.php';
$site_size = Application::get('POST.LIST_SIZE');
$site_sort = Application::get('POST.LIST_SORT');
diff --git a/admin/user/insert.php b/admin/user/insert.php
index 1e6aa41..334b1ad 100644
--- a/admin/user/insert.php
+++ b/admin/user/insert.php
@@ -8,7 +8,7 @@ define('AUTHENTICATION', TRUE);
#===============================================================================
# INCLUDE: Main configuration
#===============================================================================
-require_once '../../core/application.php';
+require '../../core/application.php';
$Attribute = new User\Attribute();
diff --git a/admin/user/update.php b/admin/user/update.php
index 0905791..1e9fa75 100644
--- a/admin/user/update.php
+++ b/admin/user/update.php
@@ -8,7 +8,7 @@ define('AUTHENTICATION', TRUE);
#===============================================================================
# INCLUDE: Main configuration
#===============================================================================
-require_once '../../core/application.php';
+require '../../core/application.php';
#===============================================================================
# TRY: User\Exception
diff --git a/core/application.php b/core/application.php
index 11f5b83..3f59fdb 100644
--- a/core/application.php
+++ b/core/application.php
@@ -17,7 +17,7 @@ define('ROOT', dirname(__DIR__).'/');
#===============================================================================
spl_autoload_register(function($classname) {
$classname = str_replace('\\', '/', $classname);
- require_once "namespace/{$classname}.php";
+ require "namespace/{$classname}.php";
});
#===============================================================================
@@ -36,7 +36,7 @@ HTTP::init($_GET, $_POST, $_FILES, TRUE);
#===============================================================================
# Include configuration
#===============================================================================
-require_once 'configuration.php';
+require 'configuration.php';
#===============================================================================
# Overwrite configuration if admin
@@ -66,7 +66,7 @@ if(defined('ADMINISTRATION') AND ADMINISTRATION === TRUE) {
#===============================================================================
# Include functions
#===============================================================================
-require_once 'functions.php';
+require 'functions.php';
#===============================================================================
# TRY: PDOException
diff --git a/core/namespace/Application.php b/core/namespace/Application.php
index 5bcd724..e5afb85 100644
--- a/core/namespace/Application.php
+++ b/core/namespace/Application.php
@@ -148,7 +148,7 @@ class Application {
# Exit application with the 403 error page
#===============================================================================
public static function error403(): void {
- require_once ROOT.'403.php';
+ require ROOT.'403.php';
exit();
}
@@ -156,7 +156,7 @@ class Application {
# Exit application with the 404 error page
#===============================================================================
public static function error404(): void {
- require_once ROOT.'404.php';
+ require ROOT.'404.php';
exit();
}
}
diff --git a/index.php b/index.php
index a96d423..360bd4d 100644
--- a/index.php
+++ b/index.php
@@ -2,7 +2,7 @@
#===============================================================================
# INCLUDE: Main configuration
#===============================================================================
-require_once 'core/application.php';
+require 'core/application.php';
#===============================================================================
# Item base directory paths