定制 eleven-miles/mimir 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

eleven-miles/mimir

Composer 安装命令:

composer create-project eleven-miles/mimir

包简介

A WordPress skeleton installation template with WP CLI integration for modern Wordpress development

README 文档

README

A portable bash setup script for new GAIN WordPress projects. Handles WordPress core installation, Erebus parent theme setup, child theme scaffolding, and git initialisation — all via WP-CLI.

Prerequisites

Ensure the following are available in your environment before running the script:

Tool Install Notes
WP-CLI brew install wp-cli wp --info should return without error
Git brew install git
PHP 8.2+ via Valet or Homebrew
MySQL / MariaDB via Valet or Docker Server must be running before mimir is invoked
MySQL client brew install mysql-client Required by WP-CLI for database operations — see note below

MySQL client note: WP-CLI's database commands require the mysql binary to be available in your PATH, even when MySQL is already running via Valet or Docker. Install the client tools with brew install mysql-client. Homebrew installs this as keg-only (not auto-linked), but the script handles that automatically.

Installation

Install mimir as a global command once, then use it for every new project:

curl -fsSL https://raw.githubusercontent.com/thisisgain/Mimir/main/install.sh | bash

This downloads setup.sh to /usr/local/bin/mimir and prompts for your password (sudo required to write there). You only need to do this once per machine.

To update to the latest version, run the same command again.

Usage

From an empty directory that will become your project root:

mkdir my-project && cd my-project
mimir

Local development (without global install)

If you have the repo cloned locally, you can symlink the script instead of installing a static copy — any changes you make to the repo are reflected immediately:

sudo ln -sf /path/to/Mimir/setup.sh /usr/local/bin/mimir

What the script does

The interactive wizard walks through the following steps in order:

  1. Requirements check — verifies WP-CLI, Git, and PHP are available
  2. Database configuration — DB name, user, password, and host
  3. Site configuration — URL, title, admin credentials
  4. WordPress core — downloads core (en_GB), generates wp-config.php, creates the database, runs the install
  5. Theme setup — clones Erebus as the parent theme, scaffolds a child theme with the correct Template: header
  6. Git initialisation — writes a .gitignore, makes the initial commit on main, optionally sets a remote and pushes
  7. (Placeholder) Plugin installation
  8. (Placeholder) Optional WP settings configuration
  9. (Placeholder) Front-end build dependency installation

After setup

Navigate into the Erebus parent theme directory and follow its README to install and run the front-end build:

cd wp-content/themes/erebus
# follow Erebus README

wp-config.php

wp-config.php is intentionally excluded from version control. It should be created per-environment:

  • Local — generated automatically by this script
  • WP Engine — added via the WP Engine custom config panel or directly on the server

TODO

The following are planned additions. Each has a placeholder stub in setup.sh marked with a TODO comment.

  • Child theme scaffoldsetup_themes() generates placeholder style.css, functions.php, and index.php files. These need updating once the Erebus child theme approach is finalised (asset enqueuing, namespace setup, any required config files).

  • Plugin installationsetup_plugins() is a stub. Implement a default plugin set installed and activated via wp plugin install <slug> --activate. Consider either a hardcoded list or a plugins.json config file for flexibility.

  • Settings configurationsetup_config() is a stub. Implement optional WordPress settings (permalink structure, timezone, default post/comment settings, etc.) using wp option update.

  • Build dependenciessetup_build() is a stub. Once the Erebus build tooling is confirmed, implement npm install (and an optional initial build run) in both the parent and child theme directories.

Troubleshooting

env: mysql: No such file or directory WP-CLI needs the mysql binary even when MySQL is already running. Install the client tools:

brew install mysql-client

The script adds /opt/homebrew/opt/mysql-client/bin to PATH automatically, so no further config is needed.

Error: Database connection error (2002) No such file or directory PHP is trying to connect via a Unix socket but can't find it. Use 127.0.0.1 instead of localhost as the DB host — this forces a TCP connection which works reliably with both Valet and Docker.

Error: WordPress files seem to already be present here The script is resumable — re-run mimir from the same directory and it will skip any steps that already completed (WP download, config, DB creation, theme setup) and continue from where it left off.

Deprecation notices in WP-CLI output The script filters PHP deprecation and notice lines from WP-CLI output automatically. If you still see them, ensure you are running the latest version of the script (mimir --help shows the version).

Contributing

Branch from main, open a PR, and tag the GAIN dev team for review.

eleven-miles/mimir 适用场景与选型建议

eleven-miles/mimir 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 25 次下载、GitHub Stars 达 0, 最近一次更新时间为 2024 年 03 月 11 日, 在 PHP 生态内属于活跃度较高的组件。

我们在过去多个企业项目中使用过 eleven-miles/mimir 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 eleven-miles/mimir 我们能提供哪些服务?
定制开发 / 二次开发

基于 eleven-miles/mimir 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

  • 总下载量: 25
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 10
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: Unlicense
  • 更新时间: 2024-03-11