eureka2 / g6k
计算模拟器生成器(计算器)
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-09-29 04:37:00 UTC
README
G6K 是一款允许无需编码即可创建和在线发布计算模拟器的工具。它包含一个模拟引擎和一个管理模块。
计算模拟器是一种在线服务,提供给用户以计算其特定情况的结果(如税收、社会福利等)。结果基于用户提供的数据、参考数据(例如税收金额)和反映模拟领域当前立法的业务规则计算。
目录
Symfony 的先决条件
- PHP 版本 7.1.3+
- 启用 JSON
- ctype
- php.ini 中的 date.timezone
- php.ini 中的 auto_detect_line_endings = On
- PHP-XML 模块
- libxml 2.6.21+ 版本
- PHP 标记解析器
- 必须安装以下模块:mbstring, iconv, POSIX(仅在 * nix 上),Intl with ICU 4+ 和 APCU 3.0.17+ APC(强烈推荐)
- 推荐的 php.ini 设置
- short_open_tag = Off
- magic_quotes_gpc = Off
- register_globals = Off
- session.auto_start = Off
G6K 的先决条件
- 启用 PDO
- pdo_pgsql 和/或 pdo_sqlite 和/或 pdo_mysql 激活
- 激活 pgsql 和/或 sqlite3
- 启用 SimpleXML
- php.ini 中的 serialize_precision = -1
- 安装并激活 intl
安装
- 如果您计划使用 MySQL 或 PostgreSQL,请使用您的 RDBMS 管理工具创建一个具有 "CREATE DATABASE" 和 "CREATE TABLE" 特权的用户。
- 放置在 <DOCUMENT_ROOT> Web 服务器
- 在 <DOCUMENT_ROOT> 中下载 composer.phar (https://getcomposer.org.cn/download/)。需要 composer 1.7.2+。
- 在 shell 或 DOS 下执行:
php -d memory_limit=-1 composer.phar create-project eureka2/g6k simulator/ 4.*
- 输入安装程序所需的参数值,包括
- 应用程序环境 [dev 或 prod] (prod)
- 调试模式 [0 或 1] (0)
- 区域设置 [en-GB, en-US, fr-FR, ...] (en-US)
- 上传目录 (%kernel.project_dir%/var/uploads)
- 邮件器 URL (null://)
- 数据库引擎 [sqlite, mysql 或 pgsql] (sqlite)
- 数据库名称 (g6k)
仅适用于 sqlite 数据库
- 数据库版本 (3.15)
- 数据库路径 (%kernel.project_dir%/var/data/databases/g6k.db)
仅适用于 mysql 或 pgsql 数据库
- 数据库主机 [localhost, ...]
- 数据库端口
- 数据库用户
- 数据库密码
- 数据库字符集 [UTF8, LATIN1, ...] (UTF8)
Web 服务器配置
添加重写规则
G6K 在 calcul/
目录中包含一个包含重写规则的 .htaccess
文件。
/admin/...
被重写为 /admin.php/...
,所有其他查询被重写为 /index.php/...
。
因此,可以省略请求 URL 中的 admin.php
和 index.php
前端控制器。
Apache
您必须在服务器配置的 VirtualHost
块中添加 AllowOverride All
指令。
假设 G6K 安装在 /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>
为了获得最佳性能,可以将重写规则从 .htaccess
文件移动到服务器配置的 VirtualHost
块中。
在这种情况下,将 AllowOverride All
改为 AllowOverride None
并删除 .htaccess
文件。
<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>
出于安全考虑,可以将 <DOCUMENT_ROOT> 设置为 calcul/
目录:DocumentRoot /var/www/html/simulator/calcul
在这种情况下,应从请求 URL 的路径中省略 calcul/
。
<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
因为 NGinx 没有使用 .htaccess
文件,所有设置都必须在服务器配置文件中进行管理。
以下配置是完整的。可能还有许多可以改进的地方,但这应该是一个好的起点。
最重要的是,必须将 /admin
路径单独路由到其他应用程序。
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
}
迁移
如果您想将模拟器、数据源和样式表从先前安装迁移过来,请不要手动复制,请使用以下控制台命令
php bin/console g6k:simulator:copy -w abDatepicker -w abListbox -w AutoMoneyFormat all /var/www/html/simulator-old
假设 /var/www/html/simulator-old
是先前版本的安装目录。
此命令执行所有必要的转换,以便在新版本中使用它们。
请注意,在此命令中,-w 选项设置小部件。 abDatepicker
、abListbox
和 AutoMoneyFormat
分别是自动应用于 '日期'、选择(选择)和货币字段的控件。您可以省略您不想使用的控件。
复制完成后,请转到管理界面以清除开发和生产缓存。
文档
管理员指南
类
代码质量
创新奖
版权和许可
© 2015-2019 Eureka2 - Jacques Archimède. 代码在 MIT 许可证 下发布。