loadsys/puphpet-release-composer-installer
最新稳定版本:0.0.5
Composer 安装命令:
composer require loadsys/puphpet-release-composer-installer
包简介
Provides a composer custom installer that works with `loadsys/puphpet-release` to add a PuPHPet.com vagrant box to a project via composer. DANGEROUS! Overwrites non-vendor files! Seriously, don't use this, or read the readme VERY carefully.
README 文档
README
Provides a composer custom installer that works with loadsys/puphpet-release to add a PuPHPet.com vagrant box to a project via composer.
You probably will never need to use this project yourself directly. We use it for our loadsys/puphpet-release package to copy parts of the PuPHPet package into the necessary locations for the consuming project.
⚠️ Big Important Warning
It's critically important to point out that this installer does things that composer very explicitly should not be doing. We break this very good and wise rule only because the tools we're working with (vagrant and puphpet) leave us with no other practical choice. Again: You should NOT do what this installer does. In all likelihood there is a better way.
If you use this installer, it will overwrite existing (important!) files in your project. If you have customized your Vagrantfile, then composer require a project that uses this installer, your Vagrantfile file and puphpet/ folder will be unceremoniously overwritten without notice. Do not complain about this. This is what this installer is designed to do and you've been duly warned of its danger.
Usage
To use this installer with another composer package, add the following block to your package's composer.json file:
"type": "puphpet-release", "require": { "loadsys/puphpet-release-composer-installer": "*" },
Composer Post Install Actions
This installer is responsible for performing post-composer install actions for the loadsys/puphpet-release package.
When this package is included in another project via composer, the installer fires a number of additional actions in order to address some of the incompatibilities between puphpet's default setup and the requirements for Vagrant (such as the Vagrantfile living in the project's root directory instead of the composer-installed /vendors/loadsys/puphpet-release/release/ folder.)
- Copies a Vagrantfile into the consuming project's root folder.
- Copies a puphpet/ folder into the consuming project's root folder.
- Copies the consuming project's
/puphpet.yamlinto the correct place as/puphpet/config.yaml. - Tries to ensure that the consuming project's
/.gitignorefile contains the proper entries to ignore/Vagrantfileand/puphpet/, if it is present.
Unresolved Questions:
- Do we always overwrite the Vagrantfile and puphpet/ folders?
- What if there are customizations to files/ or exec-*/ folders? Should we even try to detect those? (diff the contents of the package's release/ folder with the versions in project root?)
- Should we try to validate that the target project's config.yaml file has all expected (mandatory) keys as the spec changes upstream. Can we write/maintain a "unit test" and/or diffing tool for it? It's just YAML after all.
- What should we do if there isn't a
/puphpet.yamlfor us to copy? The VM will surely not work correctly with completely "default" options. Maybe prompt the user to go generate one?
Contributing
Running Unit Tests
composer installvendor/bin/phpunit
Manually Testing Installer Output
Testing this composer plugin is difficult because it involves at least 2 other projects: the loadsys/puphpet-release, and the project from which you want to consume it. This project contains a tests/integration/ directory that is set up to exercise this installer and test the result of including the loadsys/puphpet-release package in a consumer project. To use it:
-
Check out this project:
git clone git@github.com:loadsys/puphpet-release-composer-installer.git -
Check out a copy of the puphpet-release project somewhere to work on it.
git clone git@github.com:loadsys/puphpet-release.git(Make a note of this path.) -
Create a feature branch in either project, and commit your changes to the branch. (Committing the changes is very important to the process: Any changes you wish to test must exist in the git index already, not just in your working copy.)
-
Run
./tests/integration/simulate-composer-install.shThe script will prompt you for any necessary information, reset the build/ dir for use, write the appropriate "composer.json" changes for you, and execute a
composer installcommand for you in the build/ dir where you can review the results.- The
build/folder should end up with aVagrantfileandpuphpet/folder in it. - The sample
build/puphpet.yamlfile should have been copied tobuild/puphpet/config.yaml. - The sample
.gitignorefile should have been "safely" updated to include the new additions to the "root" project folder (build/).
- The
-
From here, the process loops through the following steps:
- Make changes to the puphpet-release or puphpet-release-composer-installer projects.
- Commit the changes to your working branch.
- Run
./tests/integration/simulate-composer-install.shagain. - Check the results in the
build/directory. - Repeat.
-
Once you're satisfied with the results, push your branch and submit a PR.
Running Integration Tests
The simulation script also includes a number of functional tests for verifying the results of the installer's operation. Use the -t flag to enable them.
./tests/integration/simulate-composer-install.sh -t [puphpet-release-branchname]# Release project branch name defaults tomaster.
The script will report any errors and exit non-zero on failure.
License
MIT. In particular, all PuPHPet work belongs to the original authors. This project is strictly for our own convenience.
Copyright
© Loadsys Web Strategies 2015
loadsys/puphpet-release-composer-installer 适用场景与选型建议
loadsys/puphpet-release-composer-installer 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 467 次下载、GitHub Stars 达 2, 最近一次更新时间为 2015 年 02 月 12 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「vagrant」 「puphpet」 「dangerous」 「do-not-use」 「overwrites-files」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 loadsys/puphpet-release-composer-installer 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 loadsys/puphpet-release-composer-installer 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 loadsys/puphpet-release-composer-installer 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Vagrant(centos7) for web developers.
Provides a Vagrant box for Integrated applications, based on PuPHPet
Fixed the Sublime editor link path when running a project from a VM
A list of dangerous usernames
WordPress boilerplate with modern development tools, easier configuration, and an improved folder structure
setup a wordpress with one terminal-command: composer create-project org_heigl/wordpress_bootstrap my-wordpress-folder
统计信息
- 总下载量: 467
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 2
- 点击次数: 23
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2015-02-12