wordpress/skeleton
Composer 安装命令:
composer require wordpress/skeleton
包简介
Composer based WordPress project skeleton.
README 文档
README
WordPress project skeleton to focus only your own source codes because of composer-friendly design. Inspired by markjaquith/WordPress-Skeleton.
Advantages compared to WordPress-Skeleton:
- You can install via
composer create-project. - You can add plugins via
composer require/install. - You don't need to do
git submodule init/update. (so installing is very fast) - You can set
/wp/as DocumentRoot. (in other words, you can hide "/wp/" from url) - It works even on descendant directory of DocumentRoot. (you can get it to work casually ,without vhost settings, for local development)
- All languages will be installed by default.
Requirements
- PHP 5.3+
Installation
$ composer create-project wordpress/skeleton {project-name}
$ cd {project-name}
$ cp local-config-sample.php local-config.php
$ vi local-config.php # tailor to your environment
You can use Japanese or English environment as you like.
Note: For Windows
On Windows environment, maybe you need to use console (like cmd.exe) as an administrator user for creating symlink.
If you still have any symlink related problem, please create-project in following way 🙇
$ composer create-project wordpress/skeleton {project-name} --no-scripts
$ cd {project-name}
$ mklink /D wp\wp-content\my-themes ..\..\wp-content\themes # or create symlink in some way
$ mklink /D wp\wp-content\uploads ..\..\wp-content\uploads # or create symlink in some way
$ rm -rf wp/wp-content/plugins
$ mklink /D wp\wp-content\plugins ..\..\wp-content\plugins # or create symlink in some way
$ cp local-config-sample.php local-config.php
$ vi local-config.php # tailor to your environment
Usage
WordPress core will be installed in /wp/ so root directory of your website will be /wp/. (e.g. "http://example.com/project-name/wp/")
If you want to hide /wp/ from URL you should set DocumentRoot to /path/to/project/wp/.
Now you can create your own theme in /wp-content/themes/ and install some plugins into /wp-content/plugins/ via composer (as described in the next chapter).
And your git repository doesn't manage /wp/ so you can focus only your own source codes in /wp-content/themes.
Installing plugins via composer
Using WordPress Packagist
You can use WordPress Packagist to install plugins (or themes) via composer like below:
{
"require": {
"wpackagist-plugin/akismet": "dev-trunk",
"wpackagist-plugin/captcha": ">=3.9",
"wpackagist-theme/hueman": "*"
}
}
Installing plugins form GitHub or zip file
You can also install some plugins (which isn't on WordPress.org) from GitHub repository, zip file, and so on.
To do that you should add package with "type": "wordpress-plugin" and require it like below:
{
"repositories": [
{
"type": "package",
"package": {
"name": "something-on-github",
"type": "wordpress-plugin",
"version": "dev-master",
"source": {
"type": "git",
"url": "git@github.com:someone/something.git",
"reference": "master"
}
}
},
{
"type": "package",
"package": {
"name": "something-of-zip",
"type": "wordpress-plugin",
"version": "1.0",
"dist": {
"type": "zip",
"url": "http://something.com/download/1.0.zip"
}
}
}
],
"require": {
"something-on-github": "dev-master",
"something-of-zip": "1.0"
}
}
Backing up database and uploaded files
/backup/ directory is just for saving (and version-managing) database and uploaded files. If you need, you can save them here like below:
$ mysqldump -u[user] -p [database] > backup/dump.sql
$ zip -r backup/uploads.zip wp/wp-content/uploads
Mechanism, FYI
After install/update "wordpress" package, a symlink will be created in /wp/ environment as shown below:
/wp/wp-content/my-themes->/wp-content/themes
And on WordPress's booting process, /wp/wp-content/my-theme will be enabled as an additional theme directory by following process:
WPMU_PLUGIN_DIRpoints/wp-content/mu-pluginsbecause of customizing in/wp-config.php.- In
/wp-content/mu-plugins/add-skeleton-theme-directory.php, theme directory is added withregister_theme_directory()function.
Just to tell you, /wp-config.php (and /local-config.php) need not be symlinked into /wp/ because they will loaded from /wp/wp-load.php during WordPress' normal booting process.
Commonly-used plugins
- TinyMCE Advanced
- Google XML Sitemaps
- Acunetix Secure WordPress
- Simple Local Avatars
- User Role Editor
jyokyoku/wp-ogp-customized- Doesn't work on PHP 7. Use ttskch/wp-ogp-customized instead.
wordpress/skeleton 适用场景与选型建议
wordpress/skeleton 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 1.67k 次下载、GitHub Stars 达 46, 最近一次更新时间为 2014 年 08 月 02 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「composer」 「wordpress」 「Skeleton」 「wpackagist」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 wordpress/skeleton 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 wordpress/skeleton 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 wordpress/skeleton 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
This composer plugin enables installation of GravityForms WordPress plugin and its addons.
Simple ASCII output of array data
Slim starter / Slim skeleton package to boost your development with Slim framework
Base Skeleton for Laravel Application
An awesome skeleton for modern PHP development.
统计信息
- 总下载量: 1.67k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 48
- 点击次数: 8
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: GPL-2.0
- 更新时间: 2014-08-02
