pollen-solutions/wp-skeleton
Composer 安装命令:
composer create-project pollen-solutions/wp-skeleton
包简介
Pollen Solution Wordpress project skeleton.
README 文档
README
WordPress Skeleton Component provides structures of WordPress project based on Pollen Solutions suite.
Table of contents
Features
The Pollen solutions Skeleton component embeds :
- Composer, as package manager for PHP libraries.
- ViteJS as assets bundler and responsible for compiling, transpilating, versioning, optimizing ...
- Pollen solutions components suite that includes :
- A dependency injection container
- A routing system
- A templating library
- An asset manager and injector
- An expandable command line interface
- An event manager
- ...
- A preconfigured Docker environment integrating :
- A light-weight command-line interface for interact with Docker easily
- A PHP server that run through Apache
- A MySQL server
- An email previewer service (MailHog)
- A sharing local application service
- ...
- ... And a lot of other kinds of magic !
To try it is already to contribute, you are welcome !
Installation
Standard installation
Prerequisite
- PHP must be installed on your machine see details.
- Composer must be installed on your machine see details.
Launch installation
composer create-project pollen-solutions/wp-skeleton your-app-name
Serve the app
Serve your application using
the built-in web server in PHP (or your server of
choice) from the public directory:
php -S 127.0.0.1:8000 -t public
Visit the application in the browser:
Docker installation
Prerequisite
- Docker must be installed on your machine see details
Launch installation
composer create-project pollen-solutions/wp-skeleton your-app-name --no-install --no-scripts
Launch application builder
cd ./your-app-name
bin/app.build
Visit the application in the browser:
Retrieve More details about docker usage in a Pollen application from the built-in documentation.
Configuration
Environment configuration
During the installation process, the file .env.example is copied to .env.
This file contains all required default configuration.
# ENVIRONMENT APP_ENV=dev APP_DEBUG=true APP_URL=http://127.0.0.1:8000 APP_TIMEZONE=Europe/Paris # DATABASE DATABASE_URL=sqlite:///%%app.base_dir%%/var/database.sqlite
Customize a local environment configuration
To customize your application configuration, you can directly edit the .env file, but the best practice is to
create a new .env.local file that will contain all the configuration attributes specific to your installation.
Through the .env.local file you can if necessary override an environment value declared in the .env file or
define new ones :
# DATABASE DATABASE_URL=mysql://root:root@mysql:3306/pollen #REDIS REDIS_CLIENT=phpredis REDIS_HOST=127.0.0.1
Environment variables types
STRING_VAR=string QUOTES_VAR="quoted variable" EMPTY_STRING= BOOL_VAR=true NULL_VAR=null
Environment variable mapping
You can use another existing global or previously defined environment variable like this :
DB_USERNAME=${MYSQL_USER} DB_PASSWORD=${MYSQL_PASSWORD}
Note that, for security reasons, global environnement variables couldn't be overridden.
Use application variable
In some special cases, you may need to access application variable to complete the configuration of your environment variables and the merge vars could help you.
The paths of the application are natively available :
-
%%app.base_dir%%: Absolute path to the root directory of the app. -
%%app.public_dir%%: Absolute path to the public directory of the app.
Example of usage :
DATABASE_URL=sqlite:///%%app.base_dir%%/var/database.sqlite
Pollen solutions suite uses the vlucas/phpdotenv library to work. More information on its github repository.
Directory structure
The WordPress Skeleton component is a micro-framework to work with the Wordpress CMS. Like other solutions of this type, it is opinionated and its directory structure is intended to provide a starting point for creating a complete web application.
The Root directory structure
|–– bin
|–– bootstrap
|–– config
|–– docker
|–– docs
|–– (node_modules)
|–– public
|–– (assets)
|–– languages
|–– mu-plugins
|–– plugins
|–– themes
|–– uploads
|–– (wordpress)
|–– resources
|–– assets
|–– views
|–– src
|–– tests
|–– var
|–– (vendor)
The Root directory
src
The src directory contains the core PHP code of your application.
resources
The resources directory contains the templating code. This included views and css, js, fonts, images and all other
assets files.
public
The public directory contains the index.php file, which is the entry point for all requests entering your
application and configures autoload.
This directory also houses the build assets such css, js, fonts, images and all other assets files.
config
The config directory, as the name implies, contains all of your application's PHP configuration files.
docs
The docs directory contains the complete documentation of the micro framework and its components.
Work in progress ;)
pollen-solutions/wp-skeleton 适用场景与选型建议
pollen-solutions/wp-skeleton 是一款 基于 Shell 开发的 Composer 扩展包,目前已累计 27 次下载、GitHub Stars 达 3, 最近一次更新时间为 2021 年 08 月 10 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「wordpress」 「boilerplate」 「Skeleton」 「pollen solutions」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 pollen-solutions/wp-skeleton 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 pollen-solutions/wp-skeleton 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 pollen-solutions/wp-skeleton 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
PHP class to extend when building a WordPress plugin allowing you to follow smart plugin setup standards.
Anax htmlform module.
Laravel 5.7 Boilerplate based on Bootstrap 4 and Tabler for Backend.
WordPress Plugin Framework
Slim starter / Slim skeleton package to boost your development with Slim framework
Base Skeleton for Laravel Application
统计信息
- 总下载量: 27
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 3
- 点击次数: 3
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2021-08-10