better singleton instance

This commit is contained in:
2025-05-07 20:26:08 -07:00
parent a9aca43246
commit 60a0472e53
3 changed files with 17 additions and 11 deletions

View File

@@ -5,12 +5,7 @@ require __DIR__ . '/vendor/autoload.php';
use ofc\Site;
# Declare a new Site object
$site = new Site();
# Allow the Site object to be accessed in other files
function site(): Site
{
global $site;
return $site;
return Site::getInstance();
}