Skip to content

Commit

Permalink
Update process updated.
Browse files Browse the repository at this point in the history
  • Loading branch information
Trehinos committed Jan 12, 2022
1 parent 33ac03b commit 226024d
Show file tree
Hide file tree
Showing 11 changed files with 165 additions and 67 deletions.
1 change: 0 additions & 1 deletion app/res/config/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ app_vendor: Trehinos
app_name: Thor
app_version: 0.9.5
app_version_name: ω

env: DEV
lang: fr
timezone: Europe/Paris
Expand Down
3 changes: 1 addition & 2 deletions app/res/config/database.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
default:
dsn: 'mysql:host=localhost;dbname=thor'
user: thor
password: 'thor'

password: thor
sqlite:
dsn: 'sqlite:/var/www/thor2/var/db'
7 changes: 3 additions & 4 deletions app/res/config/security.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
security: true
pdo-handler: default
security-factory: Thor\Factories\SecurityFactory:produceSecurity

# option : firewall, protect routes
security-factory: 'Thor\Factories\SecurityFactory:produceSecurity'
firewalls:
- pattern: /index.php
-
pattern: /index.php
redirect: ~
login-route: login
logout-route: logout
Expand Down
2 changes: 1 addition & 1 deletion app/res/config/update.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
source: 'git@github.com:/Trehinos/Thor.git'
composer-command: '~/composer.phar'
composer-command: ~/composer.phar
composer-options: '--ignore-platform-reqs'
migration-folder: migrations/
migration-index: 0
Expand Down
94 changes: 80 additions & 14 deletions app/res/static/commands.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,27 +2,63 @@ user/create:
class: Thor\Framework\Commands\UserCommand
command: createUser
description: 'create a new user in DB'
arguments: { username: { hasValue: true, description: 'user''s login' }, password: { hasValue: true, description: 'user''s clear password. Will be hashed before insertion' } }
arguments:
username:
hasValue: true
description: 'user''s login'
password:
hasValue: true
description: 'user''s clear password. Will be hashed before insertion'
user/list:
class: Thor\Framework\Commands\UserCommand
command: listUsers
description: 'list all users in DB'
arguments: { search: { hasValue: true, description: 'User login search request' } }
arguments:
search:
hasValue: true
description: 'User login search request'
user/edit:
class: Thor\Framework\Commands\UserCommand
command: editUser
description: 'create a new user in DB'
arguments: { pid: { hasValue: true, description: 'user''s PID. Needed to identify the user in DB' }, username: { hasValue: true, description: 'user''s new login' }, password: { hasValue: true, description: 'user''s new clear password. Will be hashed before insertion' } }
arguments:
pid:
hasValue: true
description: 'user''s PID. Needed to identify the user in DB'
username:
hasValue: true
description: 'user''s new login'
password:
hasValue: true
description: 'user''s new clear password. Will be hashed before insertion'
user/delete:
class: Thor\Framework\Commands\UserCommand
command: deleteUser
description: 'delete an existing user in DB'
arguments: { pid: { hasValue: true, description: 'user''s PID. Needed to identify the user in DB' } }
arguments:
pid:
hasValue: true
description: 'user''s PID. Needed to identify the user in DB'
route/set:
class: Thor\Framework\Commands\CoreCommand
command: routeSet
description: 'add or edit a route in app/res/static/routes.yml'
arguments: { name: { hasValue: true, description: 'route identifier' }, path: { hasValue: true, description: 'route PATH' }, method: { hasValue: true, description: 'the request method GET, POST, ...' }, action-class: { hasValue: true, description: 'the controller class' }, action-method: { hasValue: true, description: 'the controller method' } }
arguments:
name:
hasValue: true
description: 'route identifier'
path:
hasValue: true
description: 'route PATH'
method:
hasValue: true
description: 'the request method GET, POST, ...'
action-class:
hasValue: true
description: 'the controller class'
action-method:
hasValue: true
description: 'the controller method'
route/list:
class: Thor\Framework\Commands\CoreCommand
command: routeList
Expand All @@ -31,27 +67,45 @@ daemon/start:
class: Thor\Framework\Commands\DaemonCommand
command: daemonStart
description: 'start a daemon'
arguments: { name: { hasValue: true, description: 'the daemon name' } }
arguments:
name:
hasValue: true
description: 'the daemon name'
daemon/stop:
class: Thor\Framework\Commands\DaemonCommand
command: daemonStop
description: 'stop a daemon'
arguments: { name: { hasValue: true, description: 'the daemon name' } }
arguments:
name:
hasValue: true
description: 'the daemon name'
daemon/status:
class: Thor\Framework\Commands\DaemonCommand
command: daemonStatus
description: 'get the status of a daemon'
arguments: { name: { hasValue: true, description: 'the daemon name' }, all: { hasValue: false, description: 'if present, display all daemons status' } }
arguments:
name:
hasValue: true
description: 'the daemon name'
all:
hasValue: false
description: 'if present, display all daemons status'
daemon/reset:
class: Thor\Framework\Commands\DaemonCommand
command: daemonReset
description: 'reset the daemon state'
arguments: { name: { hasValue: true, description: 'the daemon name' } }
arguments:
name:
hasValue: true
description: 'the daemon name'
daemon/kill:
class: Thor\Framework\Commands\DaemonCommand
command: daemonKill
description: 'stop the daemon immediately'
arguments: { name: { hasValue: true, description: 'the daemon name' } }
arguments:
name:
hasValue: true
description: 'the daemon name'
clear/cache:
class: Thor\Framework\Commands\CoreCommand
command: clearCache
Expand All @@ -60,12 +114,18 @@ clear/logs:
class: Thor\Framework\Commands\CoreCommand
command: clearLogs
description: 'clear all logs'
arguments: { env: { hasValue: true, description: 'prod|verbose|debug|[dev] : the environment to clear' } }
arguments:
env:
hasValue: true
description: 'prod|verbose|debug|[dev] : the environment to clear'
core/setup:
class: Thor\Framework\Commands\CoreCommand
command: setup
description: 'create the PdoRows tables'
arguments: { database: { hasValue: true, description: '(default = default)' } }
arguments:
database:
hasValue: true
description: '(default = default)'
core/install:
class: Thor\Framework\Commands\CoreCommand
command: install
Expand All @@ -82,9 +142,15 @@ database/migrate:
class: Thor\Framework\Commands\DatabaseCommand
command: migrate
description: 'run a migration file with multiple SQL queries'
arguments: { index: { hasValue: true, description: 'the new migration index' } }
arguments:
index:
hasValue: true
description: 'the new migration index'
core/set-env:
class: Thor\Framework\Commands\CoreCommand
command: setEnv
description: 'set the environnement'
arguments: { env: { hasValue: true, description: 'PROD | DEBUG | DEV' } }
arguments:
env:
hasValue: true
description: 'PROD | DEBUG | DEV'
22 changes: 18 additions & 4 deletions app/res/static/langs/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ users:
min_size: 'min. 16 characters'
connect: 'Sign in'
users.login.connect: 'Sign in <strong>{appName}</strong>'
users.parameters: "{username} parameters"
users.parameters: '{username} parameters'
documentation:
alert: 'The documentation is available in the project''s wiki on Github.'
linklabel: 'See the documentation on Github'
Expand All @@ -55,10 +55,15 @@ changelog:
legend: Legend
about:
title: About
about.body: "<strong>Thor</strong> is a PHP framework.<br>\n<strong>Current version :</strong> {version}<br>\n<strong>License</strong> : MIT (&copy; Sébastien GELDREICH)<br>"
about.body: |-
<strong>Thor</strong> is a PHP framework.<br>
<strong>Current version :</strong> {version}<br>
<strong>License</strong> : MIT (&copy; Sébastien GELDREICH)<br>
legal:
title: Legal
description: "<i class=\"far fa-copyright\"></i> 2021 Sébastien GELDREICH<br>\nLicence : MIT"
description: |-
<i class="far fa-copyright"></i> 2021 Sébastien GELDREICH<br>
Licence : MIT
errors:
error: Error
too-short-username: 'Username too short (4 char. min.) or too long (255 char. max.) or invalid characters.'
Expand All @@ -67,7 +72,16 @@ errors:
permissions_page:
add: 'Add a permission'
save: 'Save permissions'
permissions_page.text: "In <strong>Thor</strong>, a permission is a simple <code>string</code> defined in the file <code>{permissionsFile}</code>.<br>\nThe permission is then checked with the <code>authorized()</code> <strong>Twig</strong> function or the <code>#[Authorization]</code> <strong>PHP</strong> attribute.\n<hr>\nThis forms allows you to edit the permissions available in <strong>Thor</strong>.<br>\nIt edits :\n<ul>\n <li>the permissions list in <code>{permissionsFile}</code> and,</li>\n <li>the language files <code>{langsFile}</code> for translations.</li>\n</ul>"
permissions_page.text: |-
In <strong>Thor</strong>, a permission is a simple <code>string</code> defined in the file <code>{permissionsFile}</code>.<br>
The permission is then checked with the <code>authorized()</code> <strong>Twig</strong> function or the <code>#[Authorization]</code> <strong>PHP</strong> attribute.
<hr>
This forms allows you to edit the permissions available in <strong>Thor</strong>.<br>
It edits :
<ul>
<li>the permissions list in <code>{permissionsFile}</code> and,</li>
<li>the language files <code>{langsFile}</code> for translations.</li>
</ul>
permissions:
manage-user: 'Manage users'
create-user: 'Create an user'
Expand Down
24 changes: 19 additions & 5 deletions app/res/static/langs/fr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ users:
min_size: 'min. 16 caractères'
connect: 'Se connecter'
users.login.connect: 'Connexion à <strong>{appName}</strong>'
users.parameters: "Paramètres de {username}"
users.parameters: 'Paramètres de {username}'
documentation:
alert: 'La documentation est disponible dans le Wiki du projet sur Github.'
linklabel: 'Voir la documentation sur Github'
Expand All @@ -55,10 +55,15 @@ changelog:
legend: Légende
about:
title: 'A propos'
about.body: "<strong>Thor</strong> est un framework PHP.<br>\n<strong>Version courante :</strong> {version}<br>\n<strong>License</strong> : MIT (&copy; Sébastien GELDREICH)<br>"
about.body: |-
<strong>Thor</strong> est un framework PHP.<br>
<strong>Version courante :</strong> {version}<br>
<strong>License</strong> : MIT (&copy; Sébastien GELDREICH)<br>
legal:
title: 'Mentions légales'
description: "<i class=\"far fa-copyright\"></i> 2021 Sébastien GELDREICH<br>\nLicense : MIT"
description: |-
<i class="far fa-copyright"></i> 2021 Sébastien GELDREICH<br>
License : MIT
errors:
error: Erreur
too-short-username: 'Nom d''utilisateur trop court (min. 4 car.) ou trop long (max. 255 car.) ou caractères invalides.'
Expand All @@ -67,13 +72,22 @@ errors:
permissions_page:
add: 'Ajouter une permission'
save: 'Enregistrer les permissions'
permissions_page.text: "Dans <strong>Thor</strong>, une permission est juste une <code>string</code> définie dans le fichier <code>{permissionsFile}</code>.<br>\nLa permission est ensuite vérifiée avec la fonction <strong>Twig</strong> <code>authorized()</code> ou l'attribut <strong>PHP</strong> <code>#[Authorization]</code>.\n<hr>\nCe formulaire permet d'éditer les permissions disponibles dans <strong>Thor</strong>.<br>\nIl édite:\n<ul>\n <li>le fichier <code>{permissionsFile}</code> et</li>\n <li>les fichiers de langage <code>{langsFile}</code> pour les traductions.</li>\n</ul>"
permissions_page.text: |-
Dans <strong>Thor</strong>, une permission est juste une <code>string</code> définie dans le fichier <code>{permissionsFile}</code>.<br>
La permission est ensuite vérifiée avec la fonction <strong>Twig</strong> <code>authorized()</code> ou l'attribut <strong>PHP</strong> <code>#[Authorization]</code>.
<hr>
Ce formulaire permet d'éditer les permissions disponibles dans <strong>Thor</strong>.<br>
Il édite:
<ul>
<li>le fichier <code>{permissionsFile}</code> et</li>
<li>les fichiers de langage <code>{langsFile}</code> pour les traductions.</li>
</ul>
permissions:
manage-user: 'Gérer les utilisateurs'
create-user: 'Créer un utilisateur'
edit-user: 'Editer un utilisateur'
remove-user: 'Supprimer un utilisateur'
manage-permissions: 'Gérer les permissions'
parameters:
background_color: Couleur de fond
background_color: 'Couleur de fond'
language: Langue
15 changes: 10 additions & 5 deletions app/res/static/menu.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,23 @@
- label: index
-
label: index
icon: book
route: index-page
- label: users
-
label: users
icon: users
route: users
authorization: manage-user
group:
- icon: list
-
icon: list
route: users-table
label: users
- icon: gavel
-
icon: gavel
route: manage-permissions
label: users_permissions
authorization: manage-permissions
- label: documentation
-
label: documentation
icon: books
route: documentation
21 changes: 5 additions & 16 deletions app/res/static/user-parameters.yml
Original file line number Diff line number Diff line change
@@ -1,21 +1,10 @@
# User parameter
# name:
# type: {input / select}
# default_value:

# type === input
# input-type:

# type === select
# choices:
# multiple: true/(false)

- name: background_color
-
name: background_color
type: input
input-type: color
default_value: #eeeeee

- name: language
default_value: ~
-
name: language
type: select
choices:
en: English
Expand Down
1 change: 0 additions & 1 deletion app/res/static/web-routes.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,3 @@ load:
- Thor\Framework\Actions\Users
- Thor\Framework\Actions\Permissions
- Thor\Framework\Actions\Security

Loading

0 comments on commit 226024d

Please sign in to comment.