From ce01f6c12fe4993a676f6b05eeb0e75c58145ce0 Mon Sep 17 00:00:00 2001 From: NaysKutzu Date: Tue, 6 Aug 2024 23:55:43 +0200 Subject: [PATCH] PUSH -> Update packages :) -> Finish caches -> Removed ol settings profiler --- FIRST_INSTALL | 0 ...tingsManager.php => DBSettingsManager.php} | 30 +----- app/Managers/LanguageManager.php | 2 +- app/Managers/Settings.php | 2 +- composer.lock | 96 +++++++++---------- install/install.php | 2 +- migrate/config/1.php | 2 +- migrate/config/2.php | 2 +- migrate/config/3.php | 2 +- public/index.php | 11 ++- settings.json | 0 11 files changed, 61 insertions(+), 88 deletions(-) mode change 100644 => 100755 FIRST_INSTALL rename app/Managers/{SettingsManager.php => DBSettingsManager.php} (80%) mode change 100644 => 100755 settings.json diff --git a/FIRST_INSTALL b/FIRST_INSTALL old mode 100644 new mode 100755 diff --git a/app/Managers/SettingsManager.php b/app/Managers/DBSettingsManager.php similarity index 80% rename from app/Managers/SettingsManager.php rename to app/Managers/DBSettingsManager.php index 03b91b3..e2f6f9f 100755 --- a/app/Managers/SettingsManager.php +++ b/app/Managers/DBSettingsManager.php @@ -7,36 +7,8 @@ /** * DEPRECATED: Use Settings class instead!! */ -class SettingsManager +class DBSettingsManager { - /** - * DEPRECATED: Use Settings class instead!! - * - * Get a setting from the database! - * - * @param string $category The category of the setting you want to get! - * @param string $key The key of the setting you want to get! - * - * @return string|null Incase if found then return the value else return null! - */ - public static function get(string $category, string $key): ?string - { - if (self::exists($category, $key)) { - $mysql = new MySQL(); - $conn = $mysql->connectMYSQLI(); - $stmt = $conn->prepare('SELECT `svalue` FROM framework_settings WHERE `skey` = ? AND `scategory` = ?'); - $stmt->bind_param('ss', $key, $category); - $stmt->execute(); - $stmt->bind_result($value); - $stmt->fetch(); - $stmt->close(); - - return $value; - } else { - return null; - } - } - /** * DEPRECATED: Use Settings class instead!! * Set a setting in the database! diff --git a/app/Managers/LanguageManager.php b/app/Managers/LanguageManager.php index f12b7d8..7cd537b 100755 --- a/app/Managers/LanguageManager.php +++ b/app/Managers/LanguageManager.php @@ -16,7 +16,7 @@ public static function getLang(): mixed try { $fallback_lang = __DIR__ . '/../../lang/en_US.php'; if (file_exists($fallback_lang)) { - $langConfig = SettingsManager::get('app', 'lang'); + $langConfig = Settings::getSetting('app', 'lang'); if (!$langConfig == '') { $langFilePath = __DIR__ . '/../../lang/' . $langConfig . '.php'; if (file_exists($langFilePath)) { diff --git a/app/Managers/Settings.php b/app/Managers/Settings.php index 248e754..a66310b 100755 --- a/app/Managers/Settings.php +++ b/app/Managers/Settings.php @@ -50,7 +50,7 @@ public static function getSetting(string $category, string $name): ?string */ public static function updateSetting(string $category, string $name, string $value, bool $updateCache = true): void { - SettingsManager::update($category, $name, $value); + DBSettingsManager::update($category, $name, $value); if ($updateCache) { MySQLCache::saveCache('framework_settings'); } diff --git a/composer.lock b/composer.lock index b2f45b1..b7135c8 100755 --- a/composer.lock +++ b/composer.lock @@ -929,16 +929,16 @@ }, { "name": "friendsofphp/php-cs-fixer", - "version": "v3.60.0", + "version": "v3.61.1", "source": { "type": "git", "url": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer.git", - "reference": "e595e4e070d17c5d42ed8c4206f630fcc5f401a4" + "reference": "94a87189f55814e6cabca2d9a33b06de384a2ab8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/PHP-CS-Fixer/PHP-CS-Fixer/zipball/e595e4e070d17c5d42ed8c4206f630fcc5f401a4", - "reference": "e595e4e070d17c5d42ed8c4206f630fcc5f401a4", + "url": "https://api.github.com/repos/PHP-CS-Fixer/PHP-CS-Fixer/zipball/94a87189f55814e6cabca2d9a33b06de384a2ab8", + "reference": "94a87189f55814e6cabca2d9a33b06de384a2ab8", "shasum": "" }, "require": { @@ -1020,7 +1020,7 @@ ], "support": { "issues": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues", - "source": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/tree/v3.60.0" + "source": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/tree/v3.61.1" }, "funding": [ { @@ -1028,7 +1028,7 @@ "type": "github" } ], - "time": "2024-07-25T09:26:51+00:00" + "time": "2024-07-31T14:33:15+00:00" }, { "name": "myclabs/deep-copy", @@ -1591,16 +1591,16 @@ }, { "name": "phpunit/phpunit", - "version": "11.2.8", + "version": "11.3.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "a7a29e8d3113806f18f99d670f580a30e8ffff39" + "reference": "a8dce73a8938dfec7ac0daa91bdbcaae7d7188a3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/a7a29e8d3113806f18f99d670f580a30e8ffff39", - "reference": "a7a29e8d3113806f18f99d670f580a30e8ffff39", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/a8dce73a8938dfec7ac0daa91bdbcaae7d7188a3", + "reference": "a8dce73a8938dfec7ac0daa91bdbcaae7d7188a3", "shasum": "" }, "require": { @@ -1639,7 +1639,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "11.2-dev" + "dev-main": "11.3-dev" } }, "autoload": { @@ -1671,7 +1671,7 @@ "support": { "issues": "https://github.com/sebastianbergmann/phpunit/issues", "security": "https://github.com/sebastianbergmann/phpunit/security/policy", - "source": "https://github.com/sebastianbergmann/phpunit/tree/11.2.8" + "source": "https://github.com/sebastianbergmann/phpunit/tree/11.3.0" }, "funding": [ { @@ -1687,7 +1687,7 @@ "type": "tidelift" } ], - "time": "2024-07-18T14:56:37+00:00" + "time": "2024-08-02T03:56:43+00:00" }, { "name": "psr/container", @@ -2216,31 +2216,31 @@ }, { "name": "react/socket", - "version": "v1.15.0", + "version": "v1.16.0", "source": { "type": "git", "url": "https://github.com/reactphp/socket.git", - "reference": "216d3aec0b87f04a40ca04f481e6af01bdd1d038" + "reference": "23e4ff33ea3e160d2d1f59a0e6050e4b0fb0eac1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/reactphp/socket/zipball/216d3aec0b87f04a40ca04f481e6af01bdd1d038", - "reference": "216d3aec0b87f04a40ca04f481e6af01bdd1d038", + "url": "https://api.github.com/repos/reactphp/socket/zipball/23e4ff33ea3e160d2d1f59a0e6050e4b0fb0eac1", + "reference": "23e4ff33ea3e160d2d1f59a0e6050e4b0fb0eac1", "shasum": "" }, "require": { "evenement/evenement": "^3.0 || ^2.0 || ^1.0", "php": ">=5.3.0", - "react/dns": "^1.11", + "react/dns": "^1.13", "react/event-loop": "^1.2", - "react/promise": "^3 || ^2.6 || ^1.2.1", - "react/stream": "^1.2" + "react/promise": "^3.2 || ^2.6 || ^1.2.1", + "react/stream": "^1.4" }, "require-dev": { "phpunit/phpunit": "^9.6 || ^5.7 || ^4.8.36", - "react/async": "^4 || ^3 || ^2", + "react/async": "^4.3 || ^3.3 || ^2", "react/promise-stream": "^1.4", - "react/promise-timer": "^1.10" + "react/promise-timer": "^1.11" }, "type": "library", "autoload": { @@ -2284,7 +2284,7 @@ ], "support": { "issues": "https://github.com/reactphp/socket/issues", - "source": "https://github.com/reactphp/socket/tree/v1.15.0" + "source": "https://github.com/reactphp/socket/tree/v1.16.0" }, "funding": [ { @@ -2292,7 +2292,7 @@ "type": "open_collective" } ], - "time": "2023-12-15T11:02:10+00:00" + "time": "2024-07-26T10:38:09+00:00" }, { "name": "react/stream", @@ -3297,16 +3297,16 @@ }, { "name": "symfony/console", - "version": "v7.1.2", + "version": "v7.1.3", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "0aa29ca177f432ab68533432db0de059f39c92ae" + "reference": "cb1dcb30ebc7005c29864ee78adb47b5fb7c3cd9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/0aa29ca177f432ab68533432db0de059f39c92ae", - "reference": "0aa29ca177f432ab68533432db0de059f39c92ae", + "url": "https://api.github.com/repos/symfony/console/zipball/cb1dcb30ebc7005c29864ee78adb47b5fb7c3cd9", + "reference": "cb1dcb30ebc7005c29864ee78adb47b5fb7c3cd9", "shasum": "" }, "require": { @@ -3370,7 +3370,7 @@ "terminal" ], "support": { - "source": "https://github.com/symfony/console/tree/v7.1.2" + "source": "https://github.com/symfony/console/tree/v7.1.3" }, "funding": [ { @@ -3386,7 +3386,7 @@ "type": "tidelift" } ], - "time": "2024-06-28T10:03:55+00:00" + "time": "2024-07-26T12:41:01+00:00" }, { "name": "symfony/event-dispatcher", @@ -3612,16 +3612,16 @@ }, { "name": "symfony/finder", - "version": "v7.1.1", + "version": "v7.1.3", "source": { "type": "git", "url": "https://github.com/symfony/finder.git", - "reference": "fbb0ba67688b780efbc886c1a0a0948dcf7205d6" + "reference": "717c6329886f32dc65e27461f80f2a465412fdca" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/finder/zipball/fbb0ba67688b780efbc886c1a0a0948dcf7205d6", - "reference": "fbb0ba67688b780efbc886c1a0a0948dcf7205d6", + "url": "https://api.github.com/repos/symfony/finder/zipball/717c6329886f32dc65e27461f80f2a465412fdca", + "reference": "717c6329886f32dc65e27461f80f2a465412fdca", "shasum": "" }, "require": { @@ -3656,7 +3656,7 @@ "description": "Finds files and directories via an intuitive fluent interface", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/finder/tree/v7.1.1" + "source": "https://github.com/symfony/finder/tree/v7.1.3" }, "funding": [ { @@ -3672,7 +3672,7 @@ "type": "tidelift" } ], - "time": "2024-05-31T14:57:53+00:00" + "time": "2024-07-24T07:08:44+00:00" }, { "name": "symfony/options-resolver", @@ -3978,16 +3978,16 @@ }, { "name": "symfony/process", - "version": "v7.1.1", + "version": "v7.1.3", "source": { "type": "git", "url": "https://github.com/symfony/process.git", - "reference": "febf90124323a093c7ee06fdb30e765ca3c20028" + "reference": "7f2f542c668ad6c313dc4a5e9c3321f733197eca" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/process/zipball/febf90124323a093c7ee06fdb30e765ca3c20028", - "reference": "febf90124323a093c7ee06fdb30e765ca3c20028", + "url": "https://api.github.com/repos/symfony/process/zipball/7f2f542c668ad6c313dc4a5e9c3321f733197eca", + "reference": "7f2f542c668ad6c313dc4a5e9c3321f733197eca", "shasum": "" }, "require": { @@ -4019,7 +4019,7 @@ "description": "Executes commands in sub-processes", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/process/tree/v7.1.1" + "source": "https://github.com/symfony/process/tree/v7.1.3" }, "funding": [ { @@ -4035,7 +4035,7 @@ "type": "tidelift" } ], - "time": "2024-05-31T14:57:53+00:00" + "time": "2024-07-26T12:44:47+00:00" }, { "name": "symfony/service-contracts", @@ -4184,16 +4184,16 @@ }, { "name": "symfony/string", - "version": "v7.1.2", + "version": "v7.1.3", "source": { "type": "git", "url": "https://github.com/symfony/string.git", - "reference": "14221089ac66cf82e3cf3d1c1da65de305587ff8" + "reference": "ea272a882be7f20cad58d5d78c215001617b7f07" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/string/zipball/14221089ac66cf82e3cf3d1c1da65de305587ff8", - "reference": "14221089ac66cf82e3cf3d1c1da65de305587ff8", + "url": "https://api.github.com/repos/symfony/string/zipball/ea272a882be7f20cad58d5d78c215001617b7f07", + "reference": "ea272a882be7f20cad58d5d78c215001617b7f07", "shasum": "" }, "require": { @@ -4251,7 +4251,7 @@ "utf8" ], "support": { - "source": "https://github.com/symfony/string/tree/v7.1.2" + "source": "https://github.com/symfony/string/tree/v7.1.3" }, "funding": [ { @@ -4267,7 +4267,7 @@ "type": "tidelift" } ], - "time": "2024-06-28T09:27:18+00:00" + "time": "2024-07-22T10:25:37+00:00" }, { "name": "theseer/tokenizer", diff --git a/install/install.php b/install/install.php index db5201b..3959452 100755 --- a/install/install.php +++ b/install/install.php @@ -2,8 +2,8 @@ use MythicalSystemsFramework\Database\MySQL; use MythicalSystemsFramework\Managers\ConfigManager; -use MythicalSystemsFramework\Managers\SettingsManager as settings; use MythicalSystemsFramework\Database\exception\database\MySQLError; +use MythicalSystemsFramework\Managers\DBSettingsManager as settings; use MythicalSystemsFramework\Database\exception\migration\NoMigrationsFound; ini_set('display_errors', 0); diff --git a/migrate/config/1.php b/migrate/config/1.php index 34b9428..146b658 100755 --- a/migrate/config/1.php +++ b/migrate/config/1.php @@ -1,6 +1,6 @@ addFunction(new Twig\TwigFunction('setting', function ($section, $key) { - return setting::get($section, $key); + return Settings::getSetting($section, $key); })); /* * Add the cfg function to the renderer diff --git a/settings.json b/settings.json old mode 100644 new mode 100755