seravo/wordpress

Seravo WordPress项目模板

安装: 4

依赖: 0

建议者: 0

安全: 0

星标: 102

关注者: 13

分支: 54

开放问题: 35

类型:项目

v2.1.0 2024-05-22 08:07 UTC

README

Seravo.com

Seravo WordPress项目模板

Seravo.com提供。

一个用于Git、Composer和Nginx的WordPress项目布局。它还包括用于本地开发的Vagrant box和Docker镜像的配置。

默认情况下,所有Seravo.com实例都使用此项目布局,以便轻松部署工作流程。此存储库的内容等于服务器上/data/wordpress/目录中的内容。

文档

请参阅我们的文档https://seravo.com/docs/,了解有关与此项目模板一起使用的git工作流程的一般信息。

安装

请参阅我们的文档https://seravo.com/docs/development/how-to-install/,了解如何安装Vagrant及其依赖项。

特性

  • 包括Nginx、MariaDB、PHP7、PHP8、Redis和Git,用于在现代堆栈中运行WordPress。
  • Git钩子来测试您的代码,以确保只有高质量的代码被提交到git
  • 使用Codeception和headless Chrome的高级WordPress验收测试
  • PHP Codesniffer代码风格和质量分析器
  • 包括自签名证书(并在OS X中自动信任它们)以测试https://本地
  • XdebugWebgrind用于调试和性能分析您的应用程序
  • Mailcatcher作为SMTP服务器来调试邮件
  • Adminer用于管理您的数据库的图形界面
  • BrowserSync作为WordPress的自动测试中间件

Vagrant凭据

WordPress

user:     vagrant
password: vagrant

MariaDB (MySQL)

user:     root
password: root

开发

此存储库的布局设计为允许在版本控制中存储网站而不会暴露任何机密数据。默认情况下,git会忽略所有敏感数据。

所有插件都由Composer处理,因此git会忽略它们。如果您创建了自定义插件,请强制将其添加到git中以便跟踪,或将新行添加到.gitignore中以便不忽略。

.gitignore中不忽略的示例行

!htdocs/wp-content/plugins/your-plugin/

如果您创建了自定义主题,它们将自动在git中跟踪。

开发自定义插件和主题的最佳方法是将其添加到它们自己的存储库中,并通过composer安装。您可以通过添加插件/主题的composer.json并像下面这样在项目中要求它们来实现

"repositories": [
  {
      "type": "vcs",
      "url": "https://github.com/your-name/custom-plugin.git"
  }
],
"require": {
    "your-name/custom-plugin": "*"
}

更新

Vagrant会在Vagrant box的新版本可用时立即通知您。但是,网站环境不会自动更新到较新版本。

要下载并更新您的Vagrant box以使用最新镜像,请运行

vagrant box update
vagrant destroy
vagrant up

配置

config.yml

将config.yml中的name更改为更改您的站点名称。这将在开发环境中的一些地方使用。

添加production => domainproduction => ssh_port以与您的生产实例同步。

在首次运行vagrant up之前,在development => domains下添加新域名以拥有额外的域名。

有关更多信息,请参阅config-sample.yml

布局

该仓库的根目录等同于Seravo.com实例中/data/wordpress目录的内容。

├── config.yml # Project name, domains and other configuration
├── composer.json # Composer definition, used to pull in WordPress and plugins
├── composer.lock # Composer lock file. This is safe to delete and ignore as detailed dependency control is not relevant in WordPress.
├── gulpfile.js # Gulp example with correct paths
├── Vagrantfile # Vagrantfile for Seravo/WordPress Vagrant box
│
├── nginx # Custom modifications to Nginx which are also used in production
│   └── examples.conf # Some examples to get started
│   └── anything.conf # Your own config files can be named anything *.conf
│
├── scripts
│   ├── hooks # Git hooks for your project
│   │   ├── pre-commit # Run after every git commit
│   │   └── post-receive # Run after every git pull/push
│   │
│   ├── WordPress
│   │   └── Installer.php # Composer helper for WordPress installation
│   │
│   └── run-tests # Bash script as an interface for your tests in Seravo's production and development environments
│
├── vendor # Composer packages go here
└── htdocs # The web root of your site
    ├── wp-content # Directory moved out of WordPress core for git compatibility
    │   ├── mu-plugins
    │   ├── plugins
    │   ├── themes
    │   └── languages
    ├── wp-config.php
    ├── wp-load.php
    ├── index.php
    └── wordpress # WordPress core
        ├── wp-admin
        ├── index.php
        └── ...

致谢

版权所有Seravo Oy,2015–2023及贡献者。本作品在GPLv3许可证下可用。