Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
P
phphr
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
phphr
Commits
050451a0
Commit
050451a0
authored
Apr 08, 2026
by
Administrator
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update 2 files via Son of Anton
parent
2ed51510
Pipeline
#21
canceled with stage
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
196 additions
and
18 deletions
+196
-18
index.php
public/index.php
+16
-18
test.php
public/test.php
+180
-0
No files found.
public/index.php
View file @
050451a0
<?php
declare
(
strict_types
=
1
);
define
(
'ROOT_PATH'
,
dirname
(
__DIR__
));
// Show errors during development
// FORCE error display — remove after debugging
error_reporting
(
E_ALL
);
ini_set
(
'display_errors'
,
'
0
'
);
ini_set
(
'display_errors'
,
'
1
'
);
ini_set
(
'log_errors'
,
'1'
);
ini_set
(
'error_log'
,
ROOT_PATH
.
'/storage/logs/php-error.log'
);
define
(
'ROOT_PATH'
,
dirname
(
__DIR__
));
require
ROOT_PATH
.
'/bootstrap/autoload.php'
;
...
...
@@ -17,18 +16,17 @@ try {
$app
=
\Engine\Core\Container
::
getInstance
()
->
resolve
(
\Engine\Core\App
::
class
);
$app
->
run
();
}
catch
(
\Throwable
$e
)
{
error_log
(
"[FATAL]
{
$e
->
getMessage
()
}
in
{
$e
->
getFile
()
}
:
{
$e
->
getLine
()
}
\n
{
$e
->
getTraceAsString
()
}
"
);
http_response_code
(
500
);
if
(
str_contains
(
$_SERVER
[
'HTTP_ACCEPT'
]
??
''
,
'json'
))
{
header
(
'Content-Type: application/json'
);
echo
json_encode
([
'error'
=>
'Internal Server Error'
,
'message'
=>
$e
->
getMessage
(),
'file'
=>
$e
->
getFile
(),
'line'
=>
$e
->
getLine
()]);
}
else
{
echo
'<!DOCTYPE html><html><head><title>500</title><style>body{font-family:monospace;padding:40px;background:#0f172a;color:#e2e8f0}h1{color:#ef4444}pre{background:#1e293b;padding:20px;border-radius:8px;overflow-x:auto;white-space:pre-wrap}</style></head><body>'
;
echo
'<h1>500 — Server Error</h1>'
;
echo
'<pre>'
.
htmlspecialchars
(
$e
->
getMessage
())
.
"
\n\n
"
;
echo
htmlspecialchars
(
$e
->
getFile
())
.
':'
.
$e
->
getLine
()
.
"
\n\n
"
;
echo
htmlspecialchars
(
$e
->
getTraceAsString
());
echo
'</pre></body></html>'
;
}
header
(
'Content-Type: text/html; charset=utf-8'
);
echo
'<!DOCTYPE html><html><head><title>500 Error</title>'
;
echo
'<style>body{font-family:monospace;padding:40px;background:#0f172a;color:#e2e8f0}h1{color:#ef4444}pre{background:#1e293b;padding:20px;border-radius:8px;overflow-x:auto;white-space:pre-wrap}</style>'
;
echo
'</head><body>'
;
echo
'<h1>500 — Bootstrap Failed</h1>'
;
echo
'<pre>'
;
echo
htmlspecialchars
(
$e
->
getMessage
())
.
"
\n\n
"
;
echo
"File: "
.
htmlspecialchars
(
$e
->
getFile
())
.
":"
.
$e
->
getLine
()
.
"
\n\n
"
;
echo
htmlspecialchars
(
$e
->
getTraceAsString
());
echo
'</pre>'
;
echo
'<p style="margin-top:20px;color:#94a3b8">This error display is temporary. Remove display_errors after fixing.</p>'
;
echo
'</body></html>'
;
}
\ No newline at end of file
public/test.php
0 → 100644
View file @
050451a0
<?php
/**
* DIAGNOSTIC FILE — DELETE AFTER DEBUGGING
* Hit: https://hrsystem.caprover.al-arcade.com/test.php
*/
error_reporting
(
E_ALL
);
ini_set
(
'display_errors'
,
'1'
);
echo
"<h1>AL-ARCADE HR — Diagnostic</h1><pre>"
;
// Step 1: Basic PHP
echo
"✅ Step 1: PHP is alive. Version: "
.
PHP_VERSION
.
"
\n
"
;
// Step 2: ROOT_PATH
define
(
'ROOT_PATH'
,
dirname
(
__DIR__
));
echo
"✅ Step 2: ROOT_PATH = "
.
ROOT_PATH
.
"
\n
"
;
// Step 3: Check critical files exist
$files
=
[
'bootstrap/autoload.php'
,
'bootstrap/app.php'
,
'config/app.php'
,
'config/database.php'
,
'config/permissions.php'
,
'engine/Core/App.php'
,
'engine/Core/Config.php'
,
'engine/Core/Container.php'
,
'engine/Core/Router.php'
,
'engine/Core/Request.php'
,
'engine/Core/Response.php'
,
'engine/Core/MiddlewarePipeline.php'
,
'engine/Database/Connection.php'
,
'engine/Auth/PasswordHasher.php'
,
'engine/Auth/SessionManager.php'
,
'engine/Auth/RateLimiter.php'
,
'engine/Auth/Authenticator.php'
,
'engine/Auth/PermissionEngine.php'
,
'engine/Audit/AuditLogger.php'
,
'engine/Events/EventDispatcher.php'
,
'engine/StateMachine/StateMachine.php'
,
'engine/StateMachine/StateDefinition.php'
,
'engine/Notifications/NotificationManager.php'
,
'engine/Calculation/CalculationEngine.php'
,
'engine/Calculation/CalculatorInterface.php'
,
'engine/Validation/Validator.php'
,
'engine/FileStorage/FileManager.php'
,
'engine/Scheduler/JobRunner.php'
,
'engine/Scheduler/JobInterface.php'
,
'engine/Search/SearchEngine.php'
,
'engine/Export/ExportManager.php'
,
'engine/Template/TemplateEngine.php'
,
'engine/RealTime/SSEController.php'
,
'engine/Cache/QueryCache.php'
,
'middleware/AuthenticationMiddleware.php'
,
'middleware/AuditMiddleware.php'
,
'middleware/JsonBodyParserMiddleware.php'
,
'middleware/ApiKeyAuthMiddleware.php'
,
'middleware/CORSMiddleware.php'
,
'middleware/CSRFMiddleware.php'
,
'middleware/BlockingNotificationMiddleware.php'
,
'middleware/SecurityHeadersMiddleware.php'
,
'templates/auth/login.php'
,
'templates/layouts/app.php'
,
'templates/layouts/auth.php'
,
];
$missing
=
[];
foreach
(
$files
as
$f
)
{
$full
=
ROOT_PATH
.
'/'
.
$f
;
if
(
file_exists
(
$full
))
{
echo
"✅
{
$f
}
\n
"
;
}
else
{
echo
"❌ MISSING:
{
$f
}
\n
"
;
$missing
[]
=
$f
;
}
}
if
(
!
empty
(
$missing
))
{
echo
"
\n\n
🔴 MISSING "
.
count
(
$missing
)
.
" FILES! These must be created.
\n
"
;
echo
"</pre>"
;
exit
;
}
// Step 4: Try autoloader
echo
"
\n
--- Step 4: Autoloader ---
\n
"
;
try
{
require
ROOT_PATH
.
'/bootstrap/autoload.php'
;
echo
"✅ Autoloader loaded
\n
"
;
}
catch
(
\Throwable
$e
)
{
echo
"❌ Autoloader failed: "
.
$e
->
getMessage
()
.
"
\n
"
;
echo
"</pre>"
;
exit
;
}
// Step 5: Try loading classes one by one
echo
"
\n
--- Step 5: Class Loading ---
\n
"
;
$classes
=
[
'Engine\\Core\\Config'
,
'Engine\\Core\\Container'
,
'Engine\\Core\\Router'
,
'Engine\\Core\\Request'
,
'Engine\\Core\\Response'
,
'Engine\\Core\\MiddlewarePipeline'
,
'Engine\\Database\\Connection'
,
'Engine\\Auth\\PasswordHasher'
,
'Engine\\Auth\\SessionManager'
,
'Engine\\Auth\\RateLimiter'
,
'Engine\\Auth\\Authenticator'
,
'Engine\\Auth\\PermissionEngine'
,
'Engine\\Audit\\AuditLogger'
,
'Engine\\Events\\EventDispatcher'
,
'Engine\\StateMachine\\StateMachine'
,
'Engine\\Notifications\\NotificationManager'
,
'Engine\\Calculation\\CalculationEngine'
,
'Engine\\Validation\\Validator'
,
'Engine\\FileStorage\\FileManager'
,
'Engine\\Scheduler\\JobRunner'
,
'Engine\\Search\\SearchEngine'
,
'Engine\\Export\\ExportManager'
,
'Engine\\Template\\TemplateEngine'
,
];
foreach
(
$classes
as
$class
)
{
try
{
if
(
class_exists
(
$class
))
{
echo
"✅
{
$class
}
\n
"
;
}
else
{
echo
"❌ CLASS NOT FOUND:
{
$class
}
\n
"
;
}
}
catch
(
\Throwable
$e
)
{
echo
"❌
{
$class
}
: "
.
$e
->
getMessage
()
.
"
\n
"
;
}
}
// Step 6: Try database connection
echo
"
\n
--- Step 6: Database ---
\n
"
;
try
{
$dbConfig
=
require
ROOT_PATH
.
'/config/database.php'
;
echo
"✅ Database config loaded: host=
{
$dbConfig
[
'host'
]
}
\n
"
;
$dsn
=
"mysql:host=
{
$dbConfig
[
'host'
]
}
;port=
{
$dbConfig
[
'port'
]
}
;dbname=
{
$dbConfig
[
'database'
]
}
;charset=
{
$dbConfig
[
'charset'
]
}
"
;
$pdo
=
new
PDO
(
$dsn
,
$dbConfig
[
'username'
],
$dbConfig
[
'password'
],
$dbConfig
[
'options'
]
??
[]);
echo
"✅ PDO connection successful
\n
"
;
$tables
=
$pdo
->
query
(
"SELECT COUNT(*) FROM information_schema.TABLES WHERE TABLE_SCHEMA='al_arcade_hr'"
)
->
fetchColumn
();
echo
"✅ Tables:
{
$tables
}
\n
"
;
$users
=
$pdo
->
query
(
"SELECT COUNT(*) FROM users"
)
->
fetchColumn
();
echo
"✅ Users:
{
$users
}
\n
"
;
}
catch
(
\Throwable
$e
)
{
echo
"❌ DB Error: "
.
$e
->
getMessage
()
.
"
\n
"
;
}
// Step 7: Try bootstrap
echo
"
\n
--- Step 7: Full Bootstrap ---
\n
"
;
try
{
require
ROOT_PATH
.
'/bootstrap/app.php'
;
echo
"✅ Bootstrap completed!
\n
"
;
$container
=
\Engine\Core\Container
::
getInstance
();
$router
=
$container
->
resolve
(
\Engine\Core\Router
::
class
);
$routes
=
$router
->
getRoutes
();
echo
"✅ Routes loaded: "
.
count
(
$routes
)
.
"
\n
"
;
// Show first 10 routes
foreach
(
array_slice
(
$routes
,
0
,
10
)
as
$r
)
{
echo
"
{
$r
[
'httpMethod'
]
}
{
$r
[
'uri'
]
}
→
{
$r
[
'controller'
]
}
::
{
$r
[
'method'
]
}
\n
"
;
}
if
(
count
(
$routes
)
>
10
)
{
echo
" ... and "
.
(
count
(
$routes
)
-
10
)
.
" more
\n
"
;
}
}
catch
(
\Throwable
$e
)
{
echo
"❌ Bootstrap failed: "
.
$e
->
getMessage
()
.
"
\n
"
;
echo
" File: "
.
$e
->
getFile
()
.
":"
.
$e
->
getLine
()
.
"
\n
"
;
echo
" Trace:
\n
"
.
$e
->
getTraceAsString
()
.
"
\n
"
;
}
echo
"
\n
--- DONE ---
\n
"
;
echo
"</pre>"
;
\ 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