jmpatricio/sheldon

维护者

详细信息

github.com/jmpatricio/sheldon

源代码

安装: 4

依赖: 0

建议者: 0

安全: 0

星标: 0

关注者: 1

分支: 0

类型:项目


README

新项目的基本模板

入门指南

创建新项目

composer create-project jmpatricio/sheldon blog

初始化项目

cd ./blog

yarn install

对于本地环境,使用 sqlite 数据库

创建 ./var/database.sqlite 文件

将以下内容添加到 ./.env.local

###> doctrine/doctrine-bundle ###
# Format described at https://www.doctrine-project.org/projects/doctrine-dbal/en/latest/reference/configuration.html#connecting-using-a-url
# For an SQLite database, use: "sqlite:///%kernel.project_dir%/var/data.db"
# For a PostgreSQL database, use: "postgresql://db_user:db_password@127.0.0.1:5432/db_name?serverVersion=11&charset=utf8"
# IMPORTANT: You MUST configure your server version, either here or in config/packages/doctrine.yaml
DATABASE_URL=sqlite:///%kernel.project_dir%/var/data.sqlite
###< doctrine/doctrine-bundle ###

初始化数据库

./bin/console doctrine:migrations:migrate

加载默认用户

./bin/console doctrine:fixtures:load

这将创建 2 个用户。

  • admin@localhost (密码:admin)
  • user@localhost (密码:user)

启动本地服务器

synfony serve