eureka2 / g6k
Generator of simulator of calculation (calculator)
Installs: 5 409
Dependents: 0
Suggesters: 0
Security: 0
Stars: 20
Watchers: 6
Forks: 19
Open Issues: 30
Language:JavaScript
Type:project
Requires
- php: ^7.1.3
- ext-ctype: *
- ext-iconv: *
- ashleydawson/simple-pagination: 1.0.*
- eureka2/acroforms: ^1.0.6
- flow/jsonpath: ^0.4.0
- mobiledetect/mobiledetectlib: ^2.8
- mpdf/mpdf: ^8.0
- sensio/framework-extra-bundle: ^5.1
- symfony/asset: ^4.3.0
- symfony/console: ^4.3.0
- symfony/expression-language: ^4.3.0
- symfony/flex: ^1.1
- symfony/framework-bundle: ^4.3.0
- symfony/lock: ^4.3.0
- symfony/monolog-bundle: ^3.1
- symfony/orm-pack: *
- symfony/process: ^4.3.0
- symfony/security-bundle: ^4.3.0
- symfony/serializer-pack: *
- symfony/swiftmailer-bundle: ^3.1
- symfony/twig-bundle: ^4.3.0
- symfony/validator: ^4.3.0
- symfony/web-link: ^4.3.0
- symfony/yaml: ^4.3.0
- willdurand/js-translation-bundle: ^3.0
Requires (Dev)
- symfony/browser-kit: ^4.2
- symfony/css-selector: ^4.3.0
- symfony/debug-pack: *
- symfony/dotenv: ^4.3.0
- symfony/maker-bundle: ^1.0
- symfony/phpunit-bridge: ~3.4|~4.0
- symfony/profiler-pack: *
- symfony/test-pack: *
- symfony/var-dumper: ^4.3.0
Conflicts
- 5.x-dev
- 4.x-dev
- dev-master / 4.x-dev
- 4.4.8
- 4.4.7
- 4.4.6
- 4.4.5
- 4.4.4
- 4.4.3
- 4.4.2
- 4.4.1
- 4.3.8
- 4.3.7
- 4.3.6
- 4.3.5
- 4.3.4
- 4.3.3
- 4.3.2
- 4.3.1
- 4.3.0
- 4.2.24
- 4.2.23
- 4.2.22
- 4.2.21
- 4.2.20
- 4.2.19
- 4.2.18
- 4.2.17
- 4.2.16
- 4.2.15
- 4.2.14
- 4.2.13
- 4.2.12
- 4.2.11
- 4.2.10
- 4.2.9
- 4.2.8
- 4.2.7
- 4.2.6
- 4.2.5
- 4.2.4
- 4.2.3
- 4.2.2
- 4.2.1
- 4.1.2
- 4.1.1
- 4.1.0
- 3.x-dev
- 3.4.3
- 3.4.2
- 3.4.1
- 3.4.0
- 3.3.3
- 2.x-dev
- 2.3.3
- 2.3.2
- 2.3.1
- 2.3.0
- 2.2.8
- 2.2.7
- 2.2.6
- 2.2.5
- 2.2.4
- 2.2.3
- 2.2.2
- 2.2.1
- 2.2.0
- 2.1.11
- 2.1.10
- 2.1.9
- 2.1.8
- 2.1.7
- 2.1.6
- 2.1.5
- 2.1.4
- 2.1.3
- 2.1.2
- 2.1.1
- 2.0.1
- 1.3.6
- 1.3.5
- 1.3.4
- 1.3.3
- 1.2
- 1.0
This package is auto-updated.
Last update: 2024-10-29 04:47:36 UTC
README
G6K is a tool that enables the creation and online publishing of calculation simulators without coding. It has a simulation engine and an administration module.
A calculation simulator is an online service made available to a user to enable them to calculate the results (taxes, social benefits, etc.) corresponding to their particular situation. The results are calculated on the basis of data supplied by the user, reference data (eg amount of a tax) and business rules reflecting the current legislation in the field of simulation.
Table of contents
- Prerequisites for Symfony
- Prerequisites for G6K
- Installation
- Web server configuration
- Migration
- Documentation
- Code quality
- Innovation Award
- Copyright and license
Prerequisites for Symfony
- PHP Version 7.1.3+
- JSON enabled
- ctype
- date.timezone in php.ini
- auto_detect_line_endings = On in php.ini
- PHP-XML module
- 2.6.21+ version of libxml
- PHP tokenizer
- Modules mbstring, iconv, POSIX (only on * nix), Intl with ICU 4+, and APCU 3.0.17+ APC (highly recommended) must be installed
- recommended php.ini settings:
- short_open_tag = Off
- magic_quotes_gpc = Off
- register_globals = Off
- session.auto_start = Off
Prerequisites for G6K
- PDO enabled
- pdo_pgsql and/or pdo_sqlite and/or pdo_mysql activated
- pgsql and/or sqlite3 activated
- SimpleXML enabled
- serialize_precision = -1 in php.ini
- intl installed and activated
Installation
- If you plan to use MySQL or PostgreSQL, create a user with "CREATE DATABASE" and "CREATE TABLE" privileges using the administration tool of your RDBMS.
- Be placed in the <DOCUMENT_ROOT> Web Server
- Download composer.phar (https://getcomposer.org/download/) in <DOCUMENT_ROOT>. composer 1.7.2+ is required.
- Under a shell or DOS, execute:
php -d memory_limit=-1 composer.phar create-project eureka2/g6k simulator/ 4.*
- Enter the parameter values required by the installer, including:
- application environment [dev or prod] (prod) :
- debug mode [0 or 1] (0) :
- locale [en-GB, en-US, fr-FR, ...] (en-US) :
- upload directory (%kernel.project_dir%/var/uploads) :
- mailer URL (null://localhost) :
- database engine [sqlite, mysql or pgsql] (sqlite) :
- database name (g6k) :
for sqlite database only:
- database version (3.15) :
- database path (%kernel.project_dir%/var/data/databases/g6k.db) :
for mysql or pgsql database:
- database host [localhost, ...] :
- database port :
- database user :
- database password :
- database character set [UTF8, LATIN1, ...] (UTF8) :
Web server configuration
Adding Rewrite Rules
G6K comes with a .htaccess
file in the calcul/
directory that contains the rewrite rules.
/admin/...
is rewritten in /admin.php/...
and all other queries in /index.php/...
.
Thus, the admin.php
and index.php
front-end controllers can be omitted from the request urls.
Apache
You must add the AllowOverride All
directive in the VirtualHost
block of the server configuration.
Assuming G6K is installed in the directory /var/www/html/simulator
:
<VirtualHost *:80>
ServerName domain.tld
ServerAlias www.domain.tld
DocumentRoot /var/www/html/simulator
<Directory /var/www/html/simulator>
AllowOverride All
Order Allow,Deny
Allow from All
</Directory>
# other directives
</VirtualHost>
For best performance, rewrite rules can be moved from the .htaccess
file to the VirtualHost
block of the server configuration.
In this case, change AllowOverride All
to AllowOverride None
and delete the .htaccess
file.
<VirtualHost *:80>
ServerName domain.tld
ServerAlias www.domain.tld
DocumentRoot /var/www/html/simulator
<Directory /var/www/html/simulator>
AllowOverride None
Order Allow,Deny
Allow from All
</Directory>
<Directory /var/www/html/simulator/calcul>
# rewrite rules from .htaccess
</Directory>
# other directives
</VirtualHost>
For security reasons, the <DOCUMENT_ROOT> can be set to the calcul/
directory : DocumentRoot /var/www/html/simulator/calcul
In this case, calcul/
should be omitted from the path of the request URL.
<VirtualHost *:80>
ServerName domain.tld
ServerAlias simulators.domain.tld
DocumentRoot /var/www/html/simulator/calcul
<Directory /var/www/html/simulator/calcul>
# rewrite rules from .htaccess
AllowOverride None
Order Allow,Deny
Allow from All
</Directory>
# other directives
</VirtualHost>
NGinx
Because NGinx does not have .htaccess
files, all of the setup has to be managed within the server config file.
The following is fully working. There are probably a number of improvements which can be made, but this should be a good starting-point.
The most important point is that the /admin
path has to be routed separately to the other app.
server {
rewrite ^/index\.php/?(.*)$ /$1 permanent;
## Admin ##
## Required for the admin area (this is in .htaccess inside /calcul) ##
location /admin {
rewrite ^(.*)$ /admin.php/$1 last;
}
## Main ##
location @rewriteapp {
rewrite ^(.*)$ /index.php/$1 last;
}
## Symfony ##
## PRODUCTION ENV ##
location ~ ^/(index|admin)\.php(/|$) {
fastcgi_pass unix:/var/run/php/php7.2-fpm.sock; #-> this needs to be your php-fpm location
fastcgi_split_path_info ^(.+\.php)(/.*)$;
include fastcgi_params;
internal;
}
# other directives
}
Migration
If you want to transfer simulators, their data sources and style sheets from a previous installation, do not copy them manually, use the following console command:
php bin/console g6k:simulator:copy -w abDatepicker -w abListbox -w AutoMoneyFormat all /var/www/html/simulator-old
assuming /var/www/html/simulator-old
is the installation directory of the previous version.
This command performs all the necessary conversions to enable their use with this new version.
Note that in this command, the -w option sets widgets.
abDatepicker
, abListbox
and AutoMoneyFormat
are widgets that will automatically apply to 'date', choice (select), and money fields, respectively.
You can omit those you do not want to use.
At the end of the copy, go to the administration interface to clear the development and production caches.
Documentation
Administrator's Guide
Classes
Code quality
Innovation Award
Copyright and license
© 2015-2019 Eureka2 - Jacques Archimède. Code released under the MIT license.