Skip to content

Commit

Permalink
PUSH
Browse files Browse the repository at this point in the history
-> Cleanup
  • Loading branch information
NaysKutzu committed Aug 19, 2024
1 parent f33d57e commit 997c920
Show file tree
Hide file tree
Showing 29 changed files with 18,526 additions and 7,509 deletions.
17 changes: 0 additions & 17 deletions .editorconfig

This file was deleted.

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion .php-cs-fixer.dist.php → .github/.php-cs-fixer.dist.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
use PhpCsFixer\Finder;

$finder = (new Finder())
->in(__DIR__)
->in(__DIR__.'/../')
->exclude([
'vendor',
'node_modules',
Expand Down
9 changes: 0 additions & 9 deletions .prettierrc.json

This file was deleted.

File renamed without changes.
File renamed without changes.
86 changes: 86 additions & 0 deletions app/Web/Installer/install.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
<?php

use MythicalSystemsFramework\Database\MySQL;
use MythicalSystemsFramework\Encryption\XChaCha20;
use MythicalSystemsFramework\Managers\ConfigManager;
use MythicalSystemsFramework\Managers\Settings as SettingsHandler;
use MythicalSystemsFramework\Managers\DBSettingsManager as settings;

ini_set('display_errors', 0);
ini_set('display_startup_errors', 0);
error_reporting(null);

$app_name = $_GET['app_name'];
$app_timezone = $_GET['app_timezone'];
$settings_app_seo_title = $app_name;
$settings_app_seo_description = $_GET['app_seo_description'];
$settings_app_seo_keywords = $_GET['app_seo_keywords'];
$settings_app_logo = $_GET['app_logo'];
$mysql_params = $_GET['mysql'];
parse_str($mysql_params, $mysql);

$mysql_host = $mysql['host'];
$mysql_port = $mysql['port'];
$mysql_username = $mysql['username'];
$mysql_password = $mysql['password'];
$mysql_name = $mysql['name'];

if (!isset($app_name) || $app_name === '') {
exit('Missing APP Name');
}

if (!isset($app_timezone) || $app_timezone === '') {
exit('Missing Timezone');
}
if (!isset($settings_app_seo_title) || $settings_app_seo_title === '') {
exit('Missing SEO Title');
}

if (!isset($settings_app_seo_description) || $settings_app_seo_description === '') {
exit('Missing SEO Description');
}

if (!isset($settings_app_seo_keywords) || $settings_app_seo_keywords === '') {
exit('Missing SEO Keywords');
}

if (!isset($settings_app_logo) || $settings_app_logo === '') {
exit('Missing APP Logo');
}

if (!in_array($app_timezone, timezone_identifiers_list())) {
exit('Invalid Timezone! Please check the timezone list.');
}

try {
ConfigManager::set('database', 'host', $mysql_host);
ConfigManager::set('database', 'port', $mysql_port);
ConfigManager::set('database', 'username', $mysql_username);
ConfigManager::set('database', 'password', $mysql_password);
ConfigManager::set('database', 'name', $mysql_name);
XChaCha20::generateKey();
try {
try {
MySQL::migrate();
} catch (Exception $e) {
exit('Failed to migrate the database: ' . $e->getMessage());
}
SettingsHandler::migrate(true);
settings::update('app', 'name', $app_name);
settings::update('app', 'timezone', $app_timezone);
settings::update('seo', 'title', $settings_app_seo_title);
settings::update('seo', 'description', $settings_app_seo_description);
settings::update('seo', 'keywords', $settings_app_seo_keywords);
settings::update('app', 'logo', $settings_app_logo);
try {
unlink(__DIR__ . '/../../../storage/FIRST_INSTALL');
exit('OK_DEL_FIRST_INSTALL');
} catch (Exception $e) {
exit('OK_DEL_FIRST_INSTALL');
}
} catch (Exception $e) {
exit('Failed to migrate the database: ' . $e->getMessage());
}
} catch (Exception $e) {
exit('Failed to configure the database: ' . $e->getMessage());
}
File renamed without changes.
Empty file added app/Web/Template/.gitkeep
Empty file.
8 changes: 2 additions & 6 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
"scripts": {
"tests": [
"export COMPOSER_ALLOW_SUPERUSER=1",
"vendor/bin/phpunit tests/*"
"vendor/bin/phpunit app/Tests/*"
],
"push": [
"export COMPOSER_ALLOW_SUPERUSER=1",
Expand All @@ -70,10 +70,6 @@
"export COMPOSER_ALLOW_SUPERUSER=1",
"git pull origin develop"
],
"install:dependency": [
"export COMPOSER_ALLOW_SUPERUSER=1",
"composer install && npm i"
],
"framework": [
"export COMPOSER_ALLOW_SUPERUSER=1",
"php framework"
Expand All @@ -84,7 +80,7 @@
],
"lint": [
"export COMPOSER_ALLOW_SUPERUSER=1",
"vendor/bin/php-cs-fixer fix --config=.php-cs-fixer.dist.php"
"vendor/bin/php-cs-fixer fix --config=./.github/.php-cs-fixer.dist.php"
]
}
}
4 changes: 2 additions & 2 deletions package.json → frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
"tailwindcss": "^3.4.4"
},
"scripts": {
"watch": "npx tailwindcss -i ./storage/styles.css -o ./public/style.css --watch",
"build": "npx tailwindcss -i ./storage/styles.css -o ./public/style.css --minify --jit",
"watch": "npx tailwindcss -i ./styles.css -o ./../public/style.css --watch",
"build": "npx tailwindcss -i ./styles.css -o ./../public/style.css --minify --jit",
"clean": "rm -rf ./public/theme.css",
"tests": "composer run tests",
"install:dependency": "npm i && composer install"
Expand Down
File renamed without changes.
Loading

0 comments on commit 997c920

Please sign in to comment.