Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
Clubphp
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
Clubphp
Commits
3e80ca64
Commit
3e80ca64
authored
Apr 07, 2026
by
Administrator
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update 6 files via Son of Anton
parent
ea9f177f
Changes
4
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
201 additions
and
180 deletions
+201
-180
.dockerignore
.dockerignore
+0
-4
Dockerfile
Dockerfile
+1
-1
entrypoint.sh
docker/entrypoint.sh
+111
-153
index.php
public/index.php
+89
-22
No files found.
.dockerignore
View file @
3e80ca64
.git
.gitignore
.env.example
docker/
Dockerfile
captain-definition
*.md
.idea/
.vscode/
...
...
Dockerfile
View file @
3e80ca64
...
...
@@ -51,7 +51,7 @@ RUN chown -R www-data:www-data /var/www/html/storage \
&&
chown
-R
www-data:www-data /var/www/html/public
\
&&
chmod
-R
755 /var/www/html/public
# ──
Default e
nvironment (overridable via CapRover env vars) ──
# ──
E
nvironment (overridable via CapRover env vars) ──
ENV
APP_URL=http://localhost
ENV
APP_DEBUG=true
ENV
APP_ENV=local
...
...
docker/entrypoint.sh
View file @
3e80ca64
This diff is collapsed.
Click to expand it.
public/index.php
View file @
3e80ca64
<?php
declare
(
strict_types
=
1
);
require_once
__DIR__
.
'/../app/Core/Autoloader.php'
;
\App\Core\Autoloader
::
register
();
/**
* THE CLUB ERP — Front Controller
* All requests route through here.
*/
// Load .env
$envFile
=
dirname
(
__DIR__
)
.
'/.env'
;
// ── Show ALL errors during startup (before ExceptionHandler takes over) ──
error_reporting
(
E_ALL
);
ini_set
(
'display_errors'
,
'1'
);
// ── Base path resolution ──
define
(
'BASE_PATH'
,
dirname
(
__DIR__
));
// ── Load .env FIRST (before anything else) ──
$envFile
=
BASE_PATH
.
'/.env'
;
if
(
file_exists
(
$envFile
))
{
$lines
=
file
(
$envFile
,
FILE_IGNORE_NEW_LINES
|
FILE_SKIP_EMPTY_LINES
);
if
(
$lines
!==
false
)
{
foreach
(
$lines
as
$line
)
{
$line
=
trim
(
$line
);
if
(
$line
===
''
||
str_starts_with
(
$line
,
'#'
))
{
continue
;
}
if
(
str_contains
(
$line
,
'='
))
{
[
$key
,
$val
]
=
explode
(
'='
,
$line
,
2
);
[
$key
,
$value
]
=
explode
(
'='
,
$line
,
2
);
$key
=
trim
(
$key
);
$val
=
trim
(
$val
);
$_ENV
[
$key
]
=
$val
;
$_SERVER
[
$key
]
=
$val
;
$value
=
trim
(
$value
);
// Remove surrounding quotes
if
((
str_starts_with
(
$value
,
'"'
)
&&
str_ends_with
(
$value
,
'"'
))
||
(
str_starts_with
(
$value
,
"'"
)
&&
str_ends_with
(
$value
,
"'"
)))
{
$value
=
substr
(
$value
,
1
,
-
1
);
}
$_ENV
[
$key
]
=
$value
;
$_SERVER
[
$key
]
=
$value
;
putenv
(
"
{
$key
}
=
{
$value
}
"
);
}
}
}
\App\Core\ExceptionHandler
::
register
();
// ── Autoloader ──
require_once
BASE_PATH
.
'/app/Core/Autoloader.php'
;
App\Core\Autoloader
::
register
();
// ── Helpers (must be loaded before Config since config files call env()) ──
require_once
BASE_PATH
.
'/app/Core/Helpers.php'
;
// ── Exception handler ──
$exHandler
=
new
App\Core\ExceptionHandler
();
$exHandler
->
register
();
$app
=
\App\Core\App
::
getInstance
();
$app
->
boot
();
// ── Boot application ──
try
{
$app
=
App\Core\App
::
getInstance
();
$app
->
boot
();
$request
=
\App\Core\Request
::
capture
();
$response
=
$app
->
router
()
->
dispatch
(
$request
);
$response
->
send
();
\ No newline at end of file
// ── Dispatch request ──
$request
=
App\Core\Request
::
capture
();
$response
=
$app
->
router
()
->
dispatch
(
$request
);
$response
->
send
();
}
catch
(
\Throwable
$e
)
{
// If we get here during boot, show the REAL error
$debug
=
(
$_ENV
[
'APP_DEBUG'
]
??
'false'
)
===
'true'
||
(
getenv
(
'APP_DEBUG'
)
?:
'false'
)
===
'true'
;
if
(
$debug
)
{
http_response_code
(
500
);
header
(
'Content-Type: text/html; charset=utf-8'
);
echo
'<html dir="rtl"><head><meta charset="utf-8"><title>Boot Error</title>'
;
echo
'<style>body{font-family:monospace;background:#1a1a2e;color:#e0e0e0;padding:40px;direction:ltr;text-align:left;}'
;
echo
'h1{color:#ff6b6b;}pre{background:#16213e;padding:20px;border-radius:8px;overflow-x:auto;white-space:pre-wrap;word-wrap:break-word;}'
;
echo
'.info{color:#4ecdc4;margin:10px 0;}</style></head><body>'
;
echo
'<h1>💀 BOOT FAILURE</h1>'
;
echo
'<p class="info">Exception: <strong>'
.
htmlspecialchars
(
get_class
(
$e
))
.
'</strong></p>'
;
echo
'<p class="info">Message: <strong>'
.
htmlspecialchars
(
$e
->
getMessage
())
.
'</strong></p>'
;
echo
'<p class="info">File: '
.
htmlspecialchars
(
$e
->
getFile
())
.
':'
.
$e
->
getLine
()
.
'</p>'
;
echo
'<h3>Stack Trace:</h3>'
;
echo
'<pre>'
.
htmlspecialchars
(
$e
->
getTraceAsString
())
.
'</pre>'
;
echo
'<h3>Environment Check:</h3>'
;
echo
'<pre>'
;
echo
"DB_HOST: "
.
(
getenv
(
'DB_HOST'
)
?:
(
$_ENV
[
'DB_HOST'
]
??
'NOT SET'
))
.
"
\n
"
;
echo
"DB_PORT: "
.
(
getenv
(
'DB_PORT'
)
?:
(
$_ENV
[
'DB_PORT'
]
??
'NOT SET'
))
.
"
\n
"
;
echo
"DB_NAME: "
.
(
getenv
(
'DB_NAME'
)
?:
(
$_ENV
[
'DB_NAME'
]
??
'NOT SET'
))
.
"
\n
"
;
echo
"DB_USER: "
.
(
getenv
(
'DB_USER'
)
?:
(
$_ENV
[
'DB_USER'
]
??
'NOT SET'
))
.
"
\n
"
;
echo
"DB_PASS: "
.
(
getenv
(
'DB_PASS'
)
?
'***SET***'
:
'NOT SET'
)
.
"
\n
"
;
echo
"APP_DEBUG: "
.
(
getenv
(
'APP_DEBUG'
)
?:
(
$_ENV
[
'APP_DEBUG'
]
??
'NOT SET'
))
.
"
\n
"
;
echo
".env exists: "
.
(
file_exists
(
BASE_PATH
.
'/.env'
)
?
'YES'
:
'NO'
)
.
"
\n
"
;
echo
"PHP version: "
.
PHP_VERSION
.
"
\n
"
;
echo
"Extensions: "
.
implode
(
', '
,
get_loaded_extensions
())
.
"
\n
"
;
echo
'</pre>'
;
echo
'</body></html>'
;
}
else
{
http_response_code
(
500
);
header
(
'Content-Type: text/html; charset=utf-8'
);
echo
'<html dir="rtl"><body style="font-family:Cairo,sans-serif;text-align:center;padding:100px;background:#f9fafb;">'
;
echo
'<h1 style="color:#dc2626;">حدث خطأ في النظام</h1>'
;
echo
'<p style="color:#6b7280;">يرجى التواصل مع مسئول النظام</p>'
;
echo
'</body></html>'
;
}
exit
(
1
);
}
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment