comsa / booking-bundle
该包的最新版本(2.2.2)没有可用的许可证信息。
带有管理面板的预订包
2.2.2
2022-02-23 08:14 UTC
Requires
- friendsofsymfony/rest-bundle: ^2.5
- gesdinet/jwt-refresh-token-bundle: ^0.6.2
- jms/serializer-bundle: ^2.4
- lexik/jwt-authentication-bundle: ^2.6
- nelmio/cors-bundle: ^1.5
- stof/doctrine-extensions-bundle: ^1.3
- symfony/framework-bundle: 3.4.14
- symfony/orm-pack: ^1.0
README
安装
composer req comsa/booking-bundle dev-master
将以下内容添加到 AppKernel.php 的 bundles [] 中
new \Comsa\BookingBundle\ComsaBookingBundle(),
new \JMS\SerializerBundle\JMSSerializerBundle(),
new \FOS\RestBundle\FOSRestBundle()
将以下内容添加到 routing.yaml 的顶部
comsa_booking:
resource: '@ComsaBookingBundle/Resources/config/routes.yaml'
客户端安装
安装 npm 包(仅限本地) http://lab.comsa.be/ciryk/booking-bundle-vue
npm install <path-to-package>
将以下条目添加到 webpack
'booking_admin': './node_modules/booking-bundle-vue/js/admin/main.js',
'booking_front': './node_modules/booking-bundle-vue/js/front/main.js'
在 parameters.yml 中添加一个名为 theme.assets_url
的参数,该参数将指向资源文件夹
theme.assets_url: 'src/Frontend/Themes/Comsa/Build/'
更新数据库
bin/console doctrine:schema:update -f
通过引入并启用它来启用安全包,并在 AppKernel 中启用它
new \Symfony\Bundle\SecurityBundle\SecurityBundle()
并在 config.yml 或 security.yml 中添加以下内容
security:
encoders:
Symfony\Component\Security\Core\User\User: plaintext
providers:
in_memory:
memory:
users:
admin:
password: booking
roles: 'ROLE_ADMIN'
firewalls:
dev:
pattern: ^/(_(profiler|wdt)|css|images|js)/
security: false
main:
anonymous: ~
http_basic: ~
access_control:
- { path: ^/booking/admin, roles: ROLE_ADMIN }
安全性
composer req lexik/jwt-authentication-bundle
new \Lexik\Bundle\JWTAuthenticationBundle\LexikJWTAuthenticationBundle()
生成 SSH 密钥
mkdir -p config/jwt # For Symfony3+, no need of the -p option
openssl genrsa -out config/jwt/private.pem -aes256 4096
openssl rsa -pubout -in config/jwt/private.pem -out config/jwt/public.pem
在您的 config/packages/lexik_jwt_authentication.yaml 中配置 SSH 密钥路径
lexik_jwt_authentication:
secret_key: '%kernel.project_dir%/config/jwt/private.pem' # required for token creation
public_key: '%kernel.project_dir%/config/jwt/public.pem' # required for token verification
pass_phrase: 'your_secret_passphrase' # required for token creation, usage of an environment variable is recommended
token_ttl: 3600
添加到 .htaccess
RewriteCond %{HTTP:Authorization} .
RewriteRule ^ - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]