Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

19 hyper optimize the app with new cache system #36

Merged
merged 17 commits into from
Aug 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
root = true

[*]
indent_style = space
indent_size = 4
tab_width = 4
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

[*.md]
trim_trailing_whitespace = false

[*.{md,nix,yml,yaml}]
indent_size = 2
tab_width = 2
63 changes: 63 additions & 0 deletions .github/ISSUE_TEMPLATE/bug-report.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
name: Bug Report
description: Something isn't working quite right in the software.
labels: [not confirmed]
body:
- type: markdown
attributes:
value: |
Bug reports should only be used for reporting issues with how the software works. For assistance installing this software, as well as debugging issues with dependencies, please use our [Discord server](https://discord.mythicalsystems.xyz).

- type: textarea
attributes:
label: Current Behavior
description: Please provide a clear & concise description of the issue.
validations:
required: true

- type: textarea
attributes:
label: Expected Behavior
description: Please describe what you expected to happen.
validations:
required: true

- type: textarea
attributes:
label: Steps to Reproduce
description: Please be as detailed as possible when providing steps to reproduce, failure to provide steps will result in this issue being closed.
validations:
required: true

- type: input
id: framework-version
attributes:
label: Framework Version
description: Version number of your Framework (latest is not a version)
placeholder: 1.0.0
validations:
required: true

- type: textarea
id: panel-logs
attributes:
label: Error Logs
description: |
Run the following command to collect logs on your system.

Panel: `cd /var/www/framework && php framework logs`
placeholder: "https://api.mythicalsystems.xyz/logs/123456&plain"
render: bash
validations:
required: false

- type: checkboxes
attributes:
label: Is there an existing issue for this?
description: Please [search here](https://github.com/mythicalltd/framework/issues) to see if an issue already exists for your problem.
options:
- label: I have searched the existing issues before opening this issue.
required: true
- label: I have provided all relevant details.
required: true
- label: I have checked in the Discord server and believe this is a bug with the framework, and not a configuration issue with my specific system.
required: true
11 changes: 11 additions & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
blank_issues_enabled: true
contact_links:
- name: Installation Help
url: https://discord.mythicalsystems.xyz
about: Please visit our Discord for help with your installation.
- name: General Question
url: https://discord.mythicalsystems.xyz
about: Please visit our Discord for general questions about MythicalFramework.
- name: Developer Documentation
url: https://docs.mythicalsystems.xyz
about: Please visit our documentation for help with developing on MythicalFramework.
32 changes: 32 additions & 0 deletions .github/ISSUE_TEMPLATE/feature-request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Feature Request
description: Suggest a new feature or improvement for the software.
labels: [feature request]
body:
- type: checkboxes
attributes:
label: Is there an existing feature request for this?
description: Please [search here](https://github.com/mythicalltd/framework/issues?q=is%3Aissue) to see if someone else has already suggested this.
options:
- label: I have searched the existing issues before opening this feature request.
required: true

- type: textarea
attributes:
label: Describe the feature you would like to see.
description: "A clear & concise description of the feature you'd like to have added, and what issues it would solve."
validations:
required: true

- type: textarea
attributes:
label: Describe the solution you'd like.
description: "You must explain how you'd like to see this feature implemented. Technical implementation details are not necessary, rather an idea of how you'd like to see this feature used."
validations:
required: true

- type: textarea
attributes:
label: Additional context to this request.
description: "Add any other context or screenshots about the feature request."
validations:
required: false
25 changes: 12 additions & 13 deletions .github/README.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,16 @@
# Framework
# MythicalFramework

The core framework for our projects ;)
One of the best frameworks to start learning php <3

For devs that want to modify the frontend using tailwind css make sure you build the frontend first :)
## Support
Donations:
- [GitHub](https://github.com/sponsors/nayskutzu/)
- [PayPal](https://paypal.me/nayskutzu)
- [Discord](https://discord.mythicalsystems.xyz) (Joining the server also helps <3)
- [Star](https://github.com/MythicalLTD/Framework) (Consider staring this repo!)

```bash
# Clean old build files
composer run frontend:clear
# Download the dependency's (Requires NodeJS)
composer run frontend:install:dependency
# Build the new frontend
composer run frontend:build
## Repository Activity

# Or you can also use watch to watch the changes live!
composer run frontend:watch
```
![Alt](https://repobeats.axiom.co/api/embed/c403f00d546911a7f80a4e9ace2628c2ab760b04.svg "Repobeats analytics image")

*Copyright MythicalSystems LTD® 2020-2024*
10 changes: 7 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,6 @@ jobs:
fail-fast: false
matrix:
php-version:
- "8.0"
- "8.1"
- "8.2"
- "8.3"
count: ${{ fromJson(needs.chunk-matrix.outputs.count) }}
Expand Down Expand Up @@ -138,4 +136,10 @@ jobs:
${{ steps.composer-cache.outputs.vcs_cache }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-composer-
${{ runner.os }}-composer-

- name: Install dependencies
run: composer validate --no-check-publish && composer install --prefer-dist --no-progress

- name: Run PHPUnit
run: composer run tests
29 changes: 29 additions & 0 deletions .github/workflows/frontend_build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Build Frontend
on: [push, pull_request]

permissions:
contents: read

jobs:
ui:
name: UI
runs-on: ubuntu-20.04
strategy:
fail-fast: false
matrix:
node-version: [20]
steps:
- name: Code Checkout
uses: actions/checkout@v3

- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: "yarn"

- name: Install dependencies
run: yarn install --frozen-lockfile

- name: Build
run: npm run build
28 changes: 28 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Lint

on: [push, pull_request]

permissions:
contents: read

jobs:
lint:
name: Lint
runs-on: ubuntu-20.04
steps:
- name: Code Checkout
uses: actions/checkout@v3

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: "8.3"
extensions: bcmath, curl, gd, mbstring, mysql, openssl, pdo, tokenizer, xml, zip
tools: composer:v2
coverage: none

- name: Install dependencies
run: composer install --no-interaction --no-progress --no-suggest --prefer-dist

- name: PHP CS Fixer (APP)
run: vendor/bin/php-cs-fixer fix --config=.php-cs-fixer.dist.php
15 changes: 10 additions & 5 deletions .github/workflows/build.yml → .github/workflows/php_build.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
name: Build and PHP APP

on:
push:
branches: [ "develop" ]
workflow_dispatch:
on: [push, pull_request]


env:
PHP_VERSION: '8.2'
Expand Down Expand Up @@ -46,4 +44,11 @@ jobs:

- name: Run composer install if composer.json exists
if: steps.check_files.outputs.files_exists == 'true'
run: composer validate --no-check-publish && composer install --prefer-dist --no-progress
run: composer validate --no-check-publish && composer install --prefer-dist --no-progress

- name: Run composer install if composer.json does not exist
if: steps.check_files.outputs.files_exists == 'false'
run: echo "No composer.json found, skipping composer install"

- name: Run PHP Unit Tests
run: composer run tests
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,6 @@ composer.phar
/package-lock.json
/node_modules
/test.json
/caches/*
/caches/*/
caches/last_settings_migrate_run
.php-cs-fixer.cache
69 changes: 69 additions & 0 deletions .php-cs-fixer.dist.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
<?php
try {
if (file_exists('vendor/autoload.php')) {
require('vendor/autoload.php');
} else {
die('Hello, it looks like you did not run: "composer install --no-dev --optimize-autoloader". Please run that and refresh the page');
}
} catch (Exception $e) {
die('Hello, it looks like you did not run: composer install --no-dev --optimize-autoloader Please run that and refresh');
}


use PhpCsFixer\Config;
use PhpCsFixer\Finder;

$finder = (new Finder())
->in(__DIR__)
->exclude([
'vendor',
'node_modules',
'.github',
'.vscode',
'.git',
'docs',
'caches',
'devtools',
'logs',
'themes',
'app/Handlers/interfaces'
])
->notName(['_ide_helper*']);

return (new Config())
->setRiskyAllowed(true)
->setFinder($finder)
->setRules([
'@Symfony' => true,
'@PSR1' => true,
'@PSR2' => true,
'@PSR12' => true,
'align_multiline_comment' => ['comment_type' => 'phpdocs_like'],
'combine_consecutive_unsets' => true,
'concat_space' => ['spacing' => 'one'],
'heredoc_to_nowdoc' => true,
'no_alias_functions' => true,
'no_unreachable_default_argument_value' => true,
'no_useless_return' => true,
'ordered_imports' => [
'sort_algorithm' => 'length',
],
'phpdoc_align' => [
'align' => 'left',
'tags' => [
'param',
'property',
'return',
'throws',
'type',
'var',
],
],
'random_api_migration' => true,
'ternary_to_null_coalescing' => true,
'yoda_style' => [
'equal' => false,
'identical' => false,
'less_and_greater' => false,
],
]);
9 changes: 9 additions & 0 deletions .prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"printWidth": 120,
"tabWidth": 4,
"useTabs": false,
"semi": true,
"singleQuote": true,
"jsxSingleQuote": true,
"endOfLine": "lf"
}
Empty file modified FIRST_INSTALL
100644 → 100755
Empty file.
5 changes: 0 additions & 5 deletions addons/Example/Example.php
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,13 +1,8 @@
<?php


class Example
{

public function Main(array $args = [])
{

}
}

?>
Empty file modified addons/Example/MythicalFramework.json
100644 → 100755
Empty file.
Empty file modified addons/data.json
100644 → 100755
Empty file.
10 changes: 5 additions & 5 deletions api/System/logs.php
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
<?php
<?php

use MythicalSystems\Api\Api as api;
use MythicalSystemsFramework\Kernel\Logger;
use MythicalSystemsFramework\Kernel\LoggerTypes;
use MythicalSystemsFramework\Kernel\LoggerLevels;

api::init();


if ($_SERVER['REQUEST_METHOD'] === 'GET') {
api::OK("Showing you latest logs", [
"logs" => Logger::getAllSortedByDate(LoggerTypes::OTHER, LoggerLevels::OTHER,10)
api::OK('Showing you latest logs', [
'logs' => Logger::getAllSortedByDate(LoggerTypes::OTHER, LoggerLevels::OTHER, 10),
]);
}
}
Loading
Loading