Skip to content

Commit

Permalink
autoloader doesn't function
Browse files Browse the repository at this point in the history
  • Loading branch information
N6REJ committed Dec 23, 2024
1 parent a97d6c5 commit 533081d
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 20 deletions.
4 changes: 0 additions & 4 deletions core/classes/class.root.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,6 @@
* Github: https://github.com/Bearsampp
*/

declare(strict_types=1);

use Core\Classes\Win32Ps;

/**
* Class Root
*
Expand Down
9 changes: 0 additions & 9 deletions core/classes/class.vbs.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,6 @@
* Github: https://github.com/Bearsampp
*/

namespace Core\Classes;

use Core\Classes\Util;
use Core\Classes\Win32Ps;
use Core\Classes\Win32Service;
use Core\Classes\Root;
use Core\Classes\Config;
use Core\Classes\Winbinder;

/**
* Class Vbs
*
Expand Down
2 changes: 1 addition & 1 deletion core/libs/winbinder/wb_generic.inc.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php
declare(strict_types=0);


/**
* WINBINDER - The native Windows binding for PHP
Expand Down
2 changes: 1 addition & 1 deletion core/libs/winbinder/wb_resources.inc.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php
declare(strict_types=0);


/**
* RC file parser: Converts Windows resource files to WinBinder commands.
Expand Down
2 changes: 1 addition & 1 deletion core/libs/winbinder/wb_windows.inc.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php
declare(strict_types=0);


/**
* WINBINDER - The native Windows binding for PHP
Expand Down
24 changes: 20 additions & 4 deletions core/root.php
Original file line number Diff line number Diff line change
@@ -1,14 +1,21 @@
<?php

/*
* Bearsampp
*
* Updated for compatibility with PHP 8.2.26.
*
* Copyright (c) 2022 - 2024 Bearsampp
* License: GNU General Public License version 3 or later; see LICENSE.txt
* Website: https://bearsampp.com
* Github: https://github.com/Bearsampp
* GitHub: https://github.com/Bearsampp
*/

/**
* Defines constants used throughout the Bearsampp application.
*
* These constants are used for application metadata, GitHub integration,
* and other configuration settings.
*/
define('APP_AUTHOR_NAME', 'N6REJ');
define('APP_TITLE', 'Bearsampp');
Expand All @@ -18,24 +25,31 @@
define('APP_GITHUB_REPO', 'Bearsampp');
define('APP_GITHUB_USERAGENT', 'Bearsampp');
define('APP_GITHUB_LATEST_URL', 'https://api.github.com/repos/' . APP_GITHUB_USER . '/' . APP_GITHUB_REPO . '/releases/latest');
define('RETURN_TAB', "\t"); // Use double quotes for escape sequences
define('RETURN_TAB', "\t"); // Using double quotes for escape sequences

/**
* Includes the Root class file and creates an instance of Root.
* Registers the root directory of the application.
*
* Updated to ensure compatibility with PHP 8.2.26 by declaring all class properties.
*/
require_once __DIR__ . '/classes/class.root.php'; // Use __DIR__ instead of dirname(__FILE__)
require_once __DIR__ . '/classes/class.root.php'; // Using __DIR__ for portability

$bearsamppRoot = new Root(__DIR__);
$bearsamppRoot->register();

/**
* Creates an instance of the Action class and processes the action based on command line arguments.
*
* Updated for compatibility with PHP 8.2.26. Ensured that all class properties are properly declared.
*/
$bearsamppAction = new Action();
$bearsamppAction->process();

/**
* Checks if the current user has root privileges and stops loading if true.
* Checks if the current script is being run as the root user and stops loading if true.
*
* This is to ensure that the application does not run with root privileges for security reasons.
*/
if ($bearsamppRoot->isRoot()) {
Util::stopLoading();
Expand All @@ -44,6 +58,8 @@
/**
* Creates an instance of the LangProc class to handle language-specific settings.
* Retrieves the locale setting from the language data.
*
* Updated to be compatible with PHP 8.2.26 by ensuring all dynamic properties are declared.
*/
$langProc = new LangProc();
$locale = $langProc->getValue('locale');

0 comments on commit 533081d

Please sign in to comment.